# Vestra Financial Management

> Mobile-first PWA for personal finance: shared workspaces with owner/member roles, recurring transactions and push reminders. Turborepo with a React 19 dashboard, a Next.js site and a NestJS API.

Case study · Vinícius Albuquerque · https://www.vinicius-albuquerque.com.br/en

- Live site: https://www.vestra-financas.com.br/
- View code: https://github.com/allbdev/vestra-v2
- Case study (HTML): https://www.vinicius-albuquerque.com.br/en/projeto/vestra-gestao-financeira

## Overview

Vestra is a mobile-first PWA for personal finance where several people can share a workspace. It is a pnpm + Turborepo monorepo with three apps and four shared packages: a Vite + React 19 dashboard installed as a PWA through a custom Workbox service worker, a Next.js 16 marketing site, and a NestJS 11 API on Prisma and PostgreSQL. The API is split into 14 domain modules over a 17-model schema, with money stored as Decimal rather than floats. Authentication is global by default: a JWT guard protects every route unless it is explicitly marked public, refresh tokens rotate on every use in an httpOnly cookie, and workspace owner/member guards enforce who can see and change what. Workspaces can be deep-cloned in a single database transaction that remaps every foreign key. A scheduled job generates recurring transactions and payment reminders, delivered in real time through Pusher and as Web Push notifications with per-user deduplication. Free and pro plans are enforced on the server. Both frontends share a shadcn-style component library on Tailwind 4, and the stack runs on Fly.io and Vercel with Neon Postgres, applying migrations on release with rolling deploys.

## Highlights

- pnpm + Turborepo monorepo: React 19 dashboard, Next.js 16 site and NestJS 11 API sharing UI, types and lint/tsconfig packages
- Secure by default: a global JWT guard with an explicit public opt-out, refresh-token rotation in httpOnly cookies, and workspace owner/member guards
- Workspace deep clone in one database transaction that remaps every foreign key
- 17-model Prisma schema on PostgreSQL, with money stored as Decimal, never floats
- Scheduled recurring transactions and payment reminders, delivered through Pusher and Web Push with per-user deduplication
- Installable PWA (Workbox service worker) on Vercel, API on Fly.io with release-time migrations, rolling deploys and Neon Postgres


## Technologies

Turborepo, NestJS, Next.js, Vite, React, TypeScript, Prisma, PostgreSQL, Tailwind CSS, shadcn/ui

## Screenshots

![Vestra finance dashboard overview](https://www.vinicius-albuquerque.com.br/projects/vestra-gestao-financeira/vestra-dahboard.png)

![Vestra transactions list](https://www.vinicius-albuquerque.com.br/projects/vestra-gestao-financeira/vestra-lancamentos.png)

![Vestra notifications view](https://www.vinicius-albuquerque.com.br/projects/vestra-gestao-financeira/vestra-notifications.png)
