Project created to be used as a backend boilerplate for future projects.
In the folder src/services
you can add your services, and in the folder src/routes
you can add your routes.
You must register your services in the src/main.ts
file.
There is the start function where the service is started and if you have a stop function in your service you have to call it in the stop function.
There is a config service that is managed from the database, so see schema.prisma
.
- Clone the repository.
- Install the dependencies.
- Create a
.env
file. - Run the project.
- Prisma
- Typescript
- Fastify
- Fastify Autoload
- Fastify CORS
- Fastify RateLimit
- Fastify Bcrypt
- Fastify File-Upload
- Fastify Static
- Fastify 204
- Fastify Metrics
- Fastify Qs
- ts-node
- tslib
- Pino Pretty
- npm-check-updates
- nodemon
dev
: Run the project in development mode.start
: Run the project in production mode.prisma:generate
: Generate the prisma client.prisma:push
: Push the prisma schema to the database.prisma:pull
: Pull the prisma schema from the database.prisma:seed
: Seed the database. IT OVERRIDE ALL SETTINGS!prisma:studio
: Open the prisma studio.
DATABASE_URL=postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public
- Add Event System
- Add Custom Logger