Skip to content

IgorKrupenja/nestjs-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

NestJS starter

Description

NestJS starter project. Uses Postgres and Prisma ORM.

Set up the project

This project requires Node 22.14. If you do not have it, the easiest option is to install nvm.

Run the following commands or just the ./setup.sh that will do this automatically (and will also install nvm if it's missing).

# Install the correct Node version
nvm install
# Install the correct pnpm version
corepack enable pnpm
corepack up
# Install dependencies
pnpm install
cp .env.example .env
# Start DB
docker compose up -d
# Prepare Prisma
pnpm exec prisma migrate dev
pnpm exec prisma generate
pnpm exec prisma db seed

Run the project

pnpm run dev

Run tests

# Unit tests in watch mode
pnpm run test

# Test coverage
pnpm run test:cov

Lint

pnpm run lint

Format

pnpm run format

Testing Docker image

You should NEVER use this to run locally. This is only for testing the Docker image.

docker build -t nestjs-starter . --no-cache

docker run \
    -p 3000:3000 \
    -e DATABASE_URL="postgresql://postgres:[email protected]:5432/nestjs_starter?schema=starter" \
    nestjs-starter

About

A simple NestJS backend starter with Prisma, Postgres โ€” and 100% test coverage ๐Ÿš€

Topics

Resources

Stars

Watchers

Forks