Building an Expenses Tracker API with NestJS — Back at It After a Break

typescript dev.to

Expenses Tracker API

A personal finance tracking API built with NestJS and PostgreSQL. Designed both as a practical tool for managing personal expenses and as a showcase of serious backend architecture patterns.

Tech Stack






































Layer Technology
Backend NestJS (v11)
Database PostgreSQL 16
ORM Prisma (v5)
Auth JWT + Argon2
Frontend (planned)
Next.js / React
Caching (planned)
Redis
Deployment Docker + VPS

Features

Implemented

  • User registration (POST /auth/signup) with email/password validation
  • Password hashing with Argon2
  • Duplicate email detection — Prisma P2002 → 403 ForbiddenException
  • User signin (POST /auth/signin) — credential lookup + Argon2 verify
  • Global ValidationPipe with whitelist (strips unexpected fields)
  • Prisma ORM integration with PostgreSQL
  • Database schema: users and expenses tables with relations
  • Expense table indexes on userId and date for query performance
  • Docker Compose setup for local development database
  • Empty module scaffolding: UserModule, ExpenseModule

In Progress

  • JWT access token returned on signin (@nestjs/jwt

Source: dev.to

arrow_back Back to Tutorials