Bootstrapping a NestJS API for Personal Finance

Published: (February 2, 2026 at 08:41 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Overview

The majority of NestJS tutorials online stop at basic CRUD operations or simple TODO list applications. In this series we’ll move beyond those beginner examples and build a Personal Finance API from scratch—a production‑ready REST API to manage income, expenses, and account types.

Each post is a short 3–4 minute read focusing on one specific aspect of the application. By the end you’ll have a fully functional API that can be extended or integrated with any frontend.

Architecture

  • NestJS – backend framework (TypeScript, dependency injection, decorators)
  • Supabase – PostgreSQL database hosting and authentication
  • Drizzle ORM – type‑safe database queries and migrations
  • REST – clear resource modeling

Feature Modules

  • auth – user authentication and authorization
  • accounts – account types: cash, debit, and credit
  • transactions – income and expense tracking
  • categories – transaction categorization

We’ll use semantic versioning throughout the series (e.g., v0.1.0 → v0.1.1 → … → v1.0.0).

Bootstrap the NestJS Application

# Install the Nest CLI globally
npm i -g @nestjs/cli

# Create a new project
nest new finance-api

# Choose your preferred package manager (npm, yarn, or pnpm)

The CLI generates a clean project structure with:

  • TypeScript configuration
  • Basic module, controller, and service
  • Testing setup with Jest
  • ESLint and Prettier configurations

Project Structure

src/
├── auth/             # Authentication module
├── accounts/         # Accounts module
├── transactions/     # Transactions module
├── categories/       # Categories module
├── common/           # Shared utilities, decorators, guards
│   ├── decorators/
│   ├── guards/
│   ├── interceptors/
│   └── filters/
├── config/           # Configuration module
├── database/         # Database connection and Drizzle setup
│   ├── migrations/
│   ├── schema/
│   └── seeds/
├── app.module.ts
└── main.ts

Supabase Provides

  • Managed PostgreSQL database with automatic backups
  • Built‑in authentication (email/password, OAuth, magic links)
  • Real‑time subscriptions (optional for future features)
  • Auto‑generated REST API (we’ll build our own)
  • Free tier perfect for development

Why Drizzle ORM?

  • Full TypeScript type safety without decorators
  • Lightweight and performant (faster than TypeORM)
  • SQL‑like syntax that’s easy to learn
  • Migration system that’s version‑control friendly
  • Perfect integration with NestJS’s modular architecture

Alternative considered: Prisma (great, but Drizzle gives more control over queries and better performance for complex relations).

What You Have So Far

  • ✅ A clean NestJS project ready for development
  • ✅ Understanding of the overall architecture
  • ✅ A clear folder structure to keep code organized
  • ✅ Knowledge of why we chose Supabase and Drizzle

Next Steps

Review the code so far:

🔗 Code: [GitHub repository]

💡 Next post: We’ll set up Supabase.

Back to Blog

Related posts

Read more »

Searcher of lyrics's musics

Overview This application allows users to search for song lyrics by providing the band/artist name and the song title. The graphical interface is built with St...