- 🏃 Quick Start
- 📝 Description
- ➕ Dependencies
- 📁 Setting up database
- 🔨 Building the project
- 🚀 Running the app
- ✅ Testing
- Create
.env
file based on.env.example
in the project folder - For security reasons, change values of
JWT_SECRET
and andPOSTGRES*
in.env
file - If you will use Docker, also change
PGADMIN_DEFAULT_PASSWORD
andPGADMIN_DEFAULT_EMAIL
indocker-compose.yml
file - Install dependencies using
yarn
ornpm install
- Start the project for development using
yarn start:dev
ornpm run start:dev
This project is a boilerplate for Nodejs/Typescript server-side applications. It already includes:
- 🟢 docker-compose file including postgres and pgadmin container setup
- 🟢 Database connection with TypeORM configured (
seeds
included) - 🟢 JWT Authentication with Passport
- 🟢 Routes configured
- 🟢 Password encryptation
- 🟢 Unit tests configured
- 🟢 Enviroments configured (for development, production, stage and qa)
- 🟢 Validation schemas (using Joi)
- 🔴 Swagger
These tecnologies listed below are required to run the project properly:
- Node >= v14.18
- NPM => v8.1.2
- (optional) Docker >= 20.10.12
To install the dependencies, use yarn
or npm install
.
- Start docker containers using
docker-compose up
- (optional) To create tables, run
yarn schema:sync
ornpm run schema:sync
- (optional) To create seeds, run
yarn seed:run
ornpm run seed:run
- Use
yarn build
ornpm run build
- Create a
.env.production
file and change theTYPEORM_DIR*
variables (specified in.env.example
) - Use
yarn start
ornpm run start
- Start docker containers using
docker-compose up
- Install dependencies using
yarn
ornpm install
- Production:
yarn start
ornpm start
- Development:
yarn start:dev
ornpm run start:dev
Each start:*
script will run node/nodemon with an specific *.env
file. Here are the .env
files for each one:
yarn start:dev
default env file is.env
yarn start
default env file isproduction.env
Note that except start:dev
, all the other scripts will run
the builded project. It means that it will not use Typescript, but Javascript, so make sure to change the TYPEORM_DIR*
in the .env*
files as specified in .env.example
- Use
yarn test
ornpm test