Skip to content

OneLiL05/awesome-backend-starter

Repository files navigation

Awesome Node.js backend starter

Note

The template will be updated over the time

Description

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.

Getting started

  1. Template is working with Node.js 22 and larger. First of all make sure that your Node.js version is capatible with requirements.

  2. Install dependencies. We use pnpm as package manager, but you can change it to one you more familiar with:

pnpm i
# npm i
# yarn i
  1. Copy .env.example to new .env. You can do it by simply running following script:
node --run copy:config
  1. Launch the db:
# Using docker cli
docker compose up db -d

# Using provided npm script
node --run db:start:dev
  1. Generate and apply migration:
# Generate migration
node --run db:generate-migration

# Apply
node --run db:apply-migration
  1. Run the application:
node --run start:dev

# For running in watch mode
node --run start:dev:watch

Working with migrations

  1. Edit an existing schema or create new.
  2. Run following command to generate migration:
node --run db:generate-migration
  1. In order to apply the migration run:
node --run db:apply-migration
  1. If you want to drop a migration, just run this command:
node --run db:drop-migration

Stay in touch

Author - Kyrylo Savieliev

License

awesome-backend-starter is MIT licensed

About

Awesome starter template for your next Node.js backend

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •