Backend · Finance Coming soon 16 mins read

Building a Finance Platform with FastAPI

By James Nguyen

How I'm rebuilding back-office operations at Day & Night Solar on FastAPI + SQLAlchemy + Alembic — designed from day one to migrate off SQLite onto Postgres.

The problem

Commercial solar ops ran out of Excel. 170+ projects, 15 states, dozens of vendors. A single source of truth the whole team could query was overdue.

What you'll build

  • A FastAPI service with SQLAlchemy models and Pydantic schemas
  • Alembic migrations set up to move from SQLite to Postgres without rewrites
  • Routes for customers, POs, invoices, and bank transactions
  • Clean separation: ORM layer, service layer, API layer

1. Project layout that scales

Coming soon — the folder structure I landed on and why.

2. Models, schemas, and the migration path

Coming soon — SQLAlchemy models designed for Postgres; Alembic from day one.

3. Services vs. controllers

Coming soon — where business logic lives and why the route handlers stay thin.

Wrap-up

Coming soon — what I'd do differently starting over.