Skip to content

medaymenTN/ts-express-jwt-rest-api

Repository files navigation

JWT-REST api boilerplate

A REST based solution made with Nodejs,Typescript,Express,TypeORM,Passport,Docker,ApiDocs,postgresSQL

Requirments

  • docker 19+
  • docker-compose 1.21.0+

Installation

  • clone the projet from the git repository
$ npm install

Running in development enviroment

  • under your project directory execute this command
$ bash ./scripts/script-dev.sh

Docker image will run the project in development enviroment

Test Image 7

  • pg admin ui will be displayed on http://localhost:5050/

  • pg admin default credentials : (email: [email protected] , password : admin)

    Test Image 7

  • Now we need to connect to our postgres and in order to do that go to create -> server

    Test Image 7

  • this form will be displayed so that you can set your server name

    Test Image 7

  • Now switch to connection tab and enter the infomation below

Note: db credentials (username:postgres,password:postgres)

Test Image 7

  • the hostname as you can see is an IPV4 adress which could be found using docker command. In order to get the IPV4 adress tape these commands on your terminal
$ docker ps

this will display all the running containers so that you can get the id of the container running postgres image

  • Now run:
$ docker inspect pg_containers_ID
  • you can see now in the image below that we can get the IPV4 adress in the terminal

Test Image 7

  • finally the dashboard will display your database details

    Test Image 7

Running in production enviroment

  • under your project directory execute this command
$ bash ./scripts/script-prod.sh

-Docker will execute a multistage build and run the required images in detached mode for production enviroment

About

JWT based authentication system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published