Authenticated registration, login, profile access, protected web routes, and JWT-protected API routes
MVP / SaaS Foundation / Project Detail
Billora SaaS Invoicing & Billing Platform
A full-stack SaaS invoicing MVP with organization ownership, team membership, business profiles, customer records, invoice creation, manual payments, PDF generation, background jobs, and audit visibility.
MVP / SaaS Foundation / Multi-tenant SaaS billing platform
Project Overview
This page expands the case-study summary into a clearer view of scope, architecture, workflow, and technical signals.
Stack
Next.js, NestJS, PostgreSQL, Prisma, Redis, TypeScript, JWT, bcrypt
- Authenticated SaaS invoicing workflows, organization and team management, business profiles, customers, invoice items, manual payments, payment status tracking, PDF generation, audit logs, background jobs, and dashboard summaries.
- Small businesses often manage invoices through spreadsheets, manually edited PDFs, message threads, and disconnected payment notes. That creates duplicate records, unclear payment state, inconsistent customer data, and weak ownership across teams.
- Built a working SaaS invoicing MVP foundation with authentication, organization membership, business profiles, customer management, invoice creation, calculated totals, manual payment tracking, generated invoice documents, audit logs, dashboard summaries, and initial API/web test coverage.
Features
Functional Scope
The project scope is framed around real product and operations behavior rather than a surface-level screen list.
Organization, member, invite, and role-aware team workflow foundation
Business profile and customer management tied to organization ownership
Invoice creation with line items, tax, discounts, due dates, notes, calculated totals, and status tracking
Manual payment recording with paid amount, outstanding balance, partial payment, and paid-state handling
Generated invoice documents with current payment summary and invalidation after edits or payment updates
Audit logs for important organization, business, customer, invoice, invite, and payment events
Redis-backed job queue foundation for invoice PDF generation and email job orchestration
Engineering
Technical Signals
These signals show the implementation concerns that matter when a system moves beyond a prototype.
Engineering Signal
NestJS modules separate auth, users, businesses, customers, invoices, payments, organizations, audit, jobs, dashboard, and health endpoints
Engineering Signal
Prisma relational models connect users, organizations, members, invites, businesses, customers, invoices, invoice items, payments, and audit logs
Engineering Signal
DTO validation and global validation pipes keep create/update payloads explicit before business logic runs
Engineering Signal
Ownership checks scope business, customer, invoice, payment, invite, organization, and audit operations to authorized members
Engineering Signal
Manual payment creation prevents overpayment by checking successful payments against the invoice total
Engineering Signal
Invoice total updates prevent reducing the invoice below already received payments
Engineering Signal
PDF documents are invalidated after invoice edits, manual payments, and mark-paid actions so stale billing documents are not served
Engineering Signal
Frontend workflows use reusable API helpers, loading states, empty states, pagination, validation helpers, and deduplicated toast feedback
Workflow
How The System Moves
The strongest project pages explain what happens to state as users, admins, workers, and services interact.
- A user registers or logs in and accesses an organization-scoped workspace.
- The user creates or selects a business profile and manages customer records.
- The user creates an invoice with line items, tax, discounts, due dates, and notes.
- The API validates ownership, calculates totals, writes invoice records and items in a transaction, and records audit activity.
- Manual payments are recorded against the invoice and checked against outstanding balance.
- The invoice status moves through unpaid, partially paid, or paid states based on recorded payments.
- Generated invoice documents are refreshed when invoice or payment state changes.
- Dashboard and audit views expose operational state for the workspace.
Case Study
Architecture Breakdown
The original systems-delivered breakdown remains available here for a compact architecture view.
Billora SaaS Invoicing & Billing Platform
Engineering Scope
Authenticated SaaS invoicing workflows, organization and team management, business profiles, customers, invoice items, manual payments, payment status tracking, PDF generation, audit logs, background jobs, and dashboard summaries.
Problem Statement
Small businesses often manage invoices through spreadsheets, manually edited PDFs, message threads, and disconnected payment notes. That creates duplicate records, unclear payment state, inconsistent customer data, and weak ownership across teams.
Architecture Overview
Next.js and TypeScript web app with authenticated dashboard, customer, invoice, settings, registration, and invite flows. A modular NestJS API uses Prisma and PostgreSQL for users, organizations, members, invites, businesses, customers, invoices, invoice items, payments, and audit logs. Redis-backed jobs support invoice PDF generation and email job orchestration.
Data Flow Explanation
An authenticated user selects a business and customer, enters invoice items, tax, discount, issue date, due date, and notes, then submits the invoice to the API. The backend validates the DTO, checks organization and business access, calculates totals, writes invoice data through Prisma transactions, and records audit events. Manual payments update payment records, paid totals, invoice status, and generated-document freshness.
Engineering Decisions
NestJS was selected for modular backend boundaries, guards, dependency injection, and DTO validation. Prisma and PostgreSQL fit the relational billing model, while Next.js provides a practical TypeScript web foundation. Redis-backed jobs keep document and email workflows outside the request path. Real payment gateways, production email delivery, and the planned Flutter mobile app were deferred so the core SaaS ownership and billing model could be hardened first.
Scale & Reliability Considerations
Organization-level ownership prepares the platform for teams and multi-business workspaces. Pagination and filtering support customers, invoices, payments, and audit logs. Transactions protect invoice creation and payment recording, while background jobs prepare PDF and email workflows for heavier workloads.
Outcome
Built a working SaaS invoicing MVP foundation with authentication, organization membership, business profiles, customer management, invoice creation, calculated totals, manual payment tracking, generated invoice documents, audit logs, dashboard summaries, and initial API/web test coverage.