Skip to content

appdevjohn/web-messages-service

Repository files navigation

Messenger Hawk - Service

This is a basic backend service to support a messaging web app. It has REST API endpoints for certain functions and offers real-time message support with Socket.IO.

This backend service was made to support the web app that was made alongside it. You can find the codebase for that project here. In addition, this project requires a running PostgreSQL database, the setup of which can be found here.

Required Environment Variables

Name Description Example
PGUSER The user for the PostgreSQL database. user
PGHOST The host name for the database. localhost
PGDATABASE The database name. messages_db
PGPASSWORD The password for the user of the database. password1
PGPORT The port for the database. 5432
PORT The port which the application runs. 8000
TOKEN_SECRET JWT signing secret. secretsecret
APP_BASE_URL Frontend application URL for password reset links. https://your.site
BASE_URL Backend application URL for the image base URL links. https://api.your.site
VERIFY_USERS Set to 'true' to enable email verification. true
SEND_EMAILS Set to 'true' to enable any email sending. true
ENABLE_UPLOADS Set to 'true' to enable image uploads. true
SENDGRID_API_KEY API key to authenticate with SendGrid apikey
NODE_ENV Set to 'test' to enable additional logging. test

Running on your Local Machine

  1. Ensure Node.js is installed on your machine.
  2. Run npm install in this directory to install dependencies.
  3. Run npm run dev to run in a development environment.

Running in a Production Environment

  1. Ensure Node.js is installed on your machine.
  2. Run npm install in this directory.
  3. Run npm run build to build a production application.
  4. Run npm start to serve the production application.

Running in Production with Docker

You can run this in a production context in a Docker container.

docker build -t messages-service .
docker run -p 8000:8000 --env-file .env web-messages-service

About

Backend service to support a messaging app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages