[READ-ONLY] Mirror of https://github.com/maybeanerd/booktracker. a multi platform application and server to track your book reading journey
hacktoberfest
booktracker apps backend
3 folders · 14 files

README.md

BookTracker Backend #

NestJS backend API for BookTracker, using Drizzle ORM with PostgreSQL.

Getting Started #

Prerequisites #

  • Node.js 24.11.0
  • PostgreSQL 16+

Setup #

  1. Install dependencies (from root):

    pnpm install
    
  2. Set up environment variables:

    cp .env.example .env
    # Edit .env with your database credentials
    
  3. Run migrations:

    pnpm db:migrate
    

Development #

# Run dev server
pnpm start:dev

# Run tests
pnpm test

# Run e2e tests
pnpm test:e2e

# Lint
pnpm lint

# Format
pnpm format

Database #

# Generate migrations from schema changes
pnpm db:generate

# Run migrations
pnpm db:migrate

# Open Drizzle Studio (database GUI)
pnpm db:studio

Docker #

# Build image
docker build -t booktracker-backend .

# Run container
docker run -p 3001:3001 \
  -e DATABASE_URL=postgresql://user:pass@host:5432/booktracker \
  booktracker-backend

Or use docker-compose from the root:

docker-compose up backend

API Endpoints #

  • GET / - Health check
  • More endpoints to be documented...

Tech Stack #

  • Framework: NestJS 11
  • ORM: Drizzle ORM
  • Database: PostgreSQL
  • Language: TypeScript