This boilerplate follows clean architecture with SOLID principles. This sample define a simple user schema and handle two endpoints that allows users to create new accounts and login by them. There is also a middleware to validate JWT tokens that are provided by clients with Bearer authorization header.
- Environment: Nodejs
- Language: Typescript
- Framework: Expressjs
- ORM: Prisma
- Database: Postgresql
- Authentication: Basic, JWT
- Inversion Of Control (D in SOLID): Awillix
- Password hash library: bcryptjs
- Create the .envfile by copying the.env.examplefile
- Database:
- The easy way to have a Postgresql server is using docker or you can use Postgreql cloud
- Once you have the database connection URL, replace the sample one in the .envfile by yours
 
- Install dependencies
npm install- Initialize database schema
npx prisma migrate dev --name "init" --preview-feature
npx prisma db push --preview-featuredocker build -t app-name .- Run dev
npm run dev- Linting
npm run lint- Build
npm run build- Run production
npm run start