BusinessOS
A multi-tenant app for CRM, invoicing and staff bookings, built with Next.js and PostgreSQL.
Built as a working showcase that can serve as a foundation for a customized business implementation.
Inspect the evidence
Review the implementation, data model and tests in the repository.
What I built
- Full-stack Next.js 15 App Router architecture with React 19 and TypeScript 5.7
- Multi-tenant relational database schema with 15 Prisma models and company-level data isolation
- 14 automated suites covering authentication, tenant isolation and business workflows
- CRM opportunity pipeline with stage progression, customer directories, and activity tracking
- Itemized billing engine with automated tax calculations and immutable invoice snapshots
- Deterministic appointment booking system with staff scheduling and IANA timezone handling
- Integrated task management, SKU inventory tracking, employee directory, and document records
- Role-based access control (Admin, Manager, Employee) with HTTP-only signed session cookies
- Production deployment on Vercel with 14 App Router views, server action endpoints, and zero build warnings
Operational Fragmentation & Relational Data Inconsistency
Service organizations often manage daily workflows across disconnected applications: contacts in one tool, invoices in another, scheduling on separate calendars, and financial tracking in spreadsheets. This separation breaks relational integrity: customer contact details diverge from billed accounts, appointments overlap across staff schedules, and issued financial documents risk retroactive corruption when master records are updated.
Multi-Tenant Relational Core with Strict Isolation
BusinessOS establishes a centralized relational database architecture where operational workflows cascade through validated foreign-key relationships. Converting a deal links directly to an itemized invoice, scheduling reservations validates calendar conflicts, and financial ledgers aggregate settled transactions—all enforced within strict server-side company boundaries, role-based authorization guards, and immutable document snapshots.
03 / PRODUCT EXPERIENCE
Core Capabilities & Workflow
Executive Telemetry & Financial Health Indicators
A consolidated operational overview calculating active revenue metrics, monthly pipeline volume, pending receivables, recent activity feeds, and cross-module status.
Enables business owners and team leaders to assess operational throughput and cash flow at a glance without manual report compilation.
Executive telemetry dashboard with revenue KPIs, activity audit logs, and financial metrics
CRM Opportunity Pipeline & Client Directory
A multi-stage Kanban sales opportunity tracker with structured client records, contact histories, deal progression stages, and customer profile management.
Structures customer relationships from initial inquiry through negotiation to closed deal, establishing persistent relational records for downstream billing.
CRM pipeline board with stage-by-stage deal tracking and centralized client directory
Itemized Billing & Immutable Invoice Snapshots
An integrated billing engine featuring automatic line-item calculations, tax handling, payment status progression, and immutable customer/seller snapshots at issuance.
Guarantees regulatory financial accuracy: historical customer and tax details remain frozen on issued invoices, preventing historical drift after settlement.
Dynamic invoicing interface with automatic tax computation and payment status management
Resource Scheduling & IANA Timezone Normalization
An interactive scheduling system with staff capacity planning, service duration settings, IANA timezone normalization, and atomic server-side conflict prevention.
Eliminates double-booking errors and scheduling drift across daylight-saving transitions while linking appointments directly to customer and employee records.
Resource appointment calendar with staff availability and consultation booking management
Task Coordination, Inventory Tracking & Staff RBAC
Coordinated operational modules spanning task queues with status progression and assignees, SKU inventory tracking with stock adjustments, and staff directories with role-based access control.
Bridges sales and execution by allowing team members to execute operational workflows within verified company boundaries and role permissions.
Financial General Ledger & BI Telemetry
Real-time financial analytics powered by Recharts, tracking net cash flow, income versus expense categorization, operational document records, and automated audit logs.
Provides clear, real-time business visibility across historical performance, helping operators make informed budgeting decisions based on settled data.
Financial ledger and real-time cash flow analytics with net profit telemetry
04 / TECHNICAL ARCHITECTURE
Engineering Foundation & Architecture
Multi-Tenant Boundary Enforcement & IDOR Defense
Object IDs alone cannot safely identify records in a multi-tenant architecture. Every database query and Server Action enforces compound tenant filtering (where: { id, companyId }). Foreign keys across customers, invoices, bookings, and tasks are strictly verified against the caller's authenticated company session before linking, preventing cross-tenant data leakage or IDOR vulnerabilities.
Invoice Snapshot Immutability & Financial Audit Integrity
If a customer updates their corporate name, address, or tax ID after an invoice has been issued, dynamic foreign-key joins would silently rewrite past financial records. To preserve regulatory audit compliance, invoice issuance captures immutable snapshots of customer details, billing address, tax rates, and line items directly onto the invoice record, reinforced with HTTP 409 conflict locks against mutating paid invoices.
Deterministic IANA Timezone & Conflict-Free Scheduling
Appointments and calendar intervals can drift by hours or days when wall-clock times are converted naively across client timezones. Using date-fns-tz, appointments are parsed against the company's configured IANA timezone (e.g., America/New_York) and stored as normalized UTC timestamps, with explicit validation rejecting non-existent local times during Daylight Saving Time (DST) spring-forward transitions alongside atomic overlap detection.
Automated Verification (14 Suites)
The repository contains 14 test suites and a unified runner. They exercise authentication, tenant boundaries, invoices, bookings and cross-module workflows. Inspect the source and setup instructions to reproduce the checks.
INSIDE THE CODE
Architecture & evidence
The path of a request, the rules it needs to preserve, and the files where you can inspect them.
From browser to database
- 01
Interface
Input and rendering
- 02
Session & roles
Server-verified identity
- 03
Server actions
Validation and company scoping
- 04
Prisma / PostgreSQL
Relationships and persistence
Company identity comes from the verified session. Actions check record ownership and roles before changing data.
Invoice history
Billing details, prices and taxes are stored on the invoice. Updating a customer record does not rewrite those historical values.
Inspect invoice testsAutomated verification
14 suites cover authentication, cross-tenant access, invoices, bookings and cross-module transitions. The repository documents how to run them; this page does not display a live pass status.
Inspect test suites05 / ENGINEERING DECISIONS
Technical decisions & trade-offs
Tenant isolation at the query boundary
Challenge: A record ID alone must not grant access to another company’s data.
Derive companyId from the verified session and include it in server-side reads and mutations.
The database query checks ownership even when a user changes an ID in a request.
Trade-off: Every new action needs the same scoping discipline and a cross-tenant regression test.
Snapshots for invoice history
Challenge: Customer details and product prices can change after an invoice is issued.
Store billing details, line-item prices and tax rates on the invoice instead of reading current master data.
An old invoice keeps the values used when it was issued.
Trade-off: Snapshots duplicate data and require an explicit correction workflow instead of silently updating issued invoices.
One relational model across workflows
Challenge: Deals, invoices and appointments need consistent links to customers and staff.
Use PostgreSQL relationships and Prisma models to connect the operational records.
Foreign keys make relationships explicit and help prevent orphaned records.
Trade-off: Schema changes need migrations, and deletion rules must account for linked financial records.
06 / REFLECTIONS & LEARNINGS
What This Project Demonstrated
Relational Consistency Across Interconnected Lifecycles
Designing BusinessOS demonstrated that business software reliability depends on how cleanly cross-module transitions are structured. Modeling how a CRM deal progression cascades into billing records and audit logs while preserving referential constraints formed the core architectural discipline.
Server-Side Authorization as the Sole Security Boundary
Hiding UI controls or disabling buttons client-side provides zero security. In a multi-tenant system, every Server Action and database query must independently verify caller session, company ownership, and role permissions before executing mutations.
Deterministic Timezone Normalization in Resource Scheduling
Calendar scheduling across distributed teams requires authoritative company timezone references. Converting wall-clock inputs into normalized UTC timestamps and guarding against Daylight Saving Time (DST) gaps eliminated subtle scheduling conflicts before records touch the database.
Deployed interactive web application on Vercel
Read the implementation and browse its history.
Inspect the layouts in the screenshots and demo.
Explore the architecture and decisions in this case study.
Explore the Application Live
Access the dashboard, operational modules, and interactive workflows in a safe, read-only demo environment.
🔒 Read-only environment · Synthetic data
FULL-STACK ARCHITECTURE & SYSTEMS
Interested in complex system design or operational software?
I'm always open to discussing multi-tenant architectures, database schemas, software development, or upcoming engineering opportunities.
Looking specifically for member management or reception check-in software? See the Gym CRM management system →