A backen api built with Node.js, Typescript and Postgres SQL. This app (api) is hosted here.
- Clone this repo
- Install dependencies:
npm install
- Setup a pg db using any of the client app. I used postgres db provision from Render
- Setup environment variables: create a
.env
file with the database url
JWT_SECRET=<your secret JWT key>
JWT_EXPIRES=12h
DB_URL=
PORT=5000
REDIS_URL=<your redis url>
- If you are using local postgres then your env might look like this
JWT_SECRET=<your secret JWT key>
JWT_EXPIRES=12h
DB_USER=<db user>
DB_HOST=localhost
DB_PASSWORD=<your password>
DB_PORT=5432
PORT=5000/
DB_NAME=<db name>
REDIS_URL=<your redis url>
- Start dev server:
npm run dev
The app will be available on http://localhost:5000.
- Clone this repo
- Build docker image using docker-compose:
docker-compose up
The app will be available at http://localhost:5000.
The docker-compose.yml file contains the config to build and run the app using Docker. This allows running the app using Docker without manually building the image.
To run tests on Postman, kindly visit the collection using this link
To run the unit test, run this command:
npm run test