An opinionated template for building a NodeJS/TypeScript API.
- NodeJS/TypeScript
- Express
- Express Validator
- Prisma ORM (configured for PostgreSQL)
- Redis
- BullMQ
- Firebase Auth
- Morgan for HTTP logging
- Winston for other logging
- Docker
- NodeJS
- NVM
- Yarn
Install Node & Node modules, then set environment variables.
# Install Node 18
$ nvm install 18
# Use Node 18 in current shell session
$ nvm use
# Install Node modules
$ yarn
# Create a PostgreSQL database in a Docker container
$ yarn db:create
# Create a Redis database in a Docker container
$ yarn redis:create
# Copy environment variables
$ cp .env.example .env
You'll need a Firebase key to a development project to begin.
Save this file as firebase-key.json
in the project directory and set the full path of the file as the value for GOOGLE_APPLICATION_CREDENTIALS
in your .env
file.
# Migrate the database schema
$ yarn db:migrate
# Use correct node version
$ nvm use
# Start the server
$ yarn start