Note
The template will be updated over the time
awesome-backend-starter provides a powerful starter template for Node.js backend services.
It comes with:
- fastify;
- Modular structure;
- Dependency injection (via awilix);
- Powerful error-handling capabilities using Rust-inspired result container.
-
Template is working with Node.js 22 and larger. First of all make sure that your Node.js version is capatible with requirements.
-
Install dependencies. We use
pnpmas package manager, but you can change it to one you more familiar with:
pnpm i
# npm i
# yarn i- Copy
.env.exampleto new.env. You can do it by simply running following script:
node --run copy:config- Launch the db:
# Using docker cli
docker compose up db -d
# Using provided npm script
node --run db:start:dev- Generate and apply migration:
# Generate migration
node --run db:generate-migration
# Apply
node --run db:apply-migration- Run the application:
node --run start:dev
# For running in watch mode
node --run start:dev:watch- Edit an existing schema or create new.
- Run following command to generate migration:
node --run db:generate-migration- In order to apply the migration run:
node --run db:apply-migration- If you want to drop a migration, just run this command:
node --run db:drop-migrationAuthor - Kyrylo Savieliev
awesome-backend-starter is MIT licensed