Internal business management platform for Las Flores Melbourne. Built with Next.js App Router, TypeScript, and Prisma.
The platform is fully multi-tenant. Every resource (customers, invoices, products, employees, etc.) is scoped to a tenant via tenantId enforced at the repository layer — no cross-tenant data leakage is possible.
- Tenant isolation — All database queries include
tenantIdin thewhereclause. - RBAC — Role-based access control is scoped per tenant. Roles:
OWNER,ADMIN,MANAGER,STAFF, and others — each with a defined permission policy. - Invitations — Users are invited to a tenant via email. Accepted invitations create a tenant-scoped user record.
- Super Admin — Super admins can manage all tenants and switch the active tenant context via a session cookie (
sa_active_tenant_id). - Tenant settings — Each tenant has its own configurable settings (branding, defaults, etc.).
Dashboard with key business metrics — revenue charts, recent sales, and summary stats.
- Customers — Create, search, and manage customer profiles with contact details and linked organisations.
- Organisations — Group customers under organisations; manage org-level contact and billing info.
- Invoices — Full invoice lifecycle: create, send, record payments, cancel. PDF preview. Analytics dashboard.
- Quotes — Create and manage quotes, convert to invoices. PDF preview and analytics.
- Transactions — Record and categorise income/expense transactions. Analytics and filtering.
- Recipes — Cost recipes linked to products for COGS tracking, grouped by recipe groups.
- Products — Manage product catalogue with pricing, categories, and stock.
- Vendors — Supplier management with contact details and linked products.
- Price List — Maintain customer-facing price lists linked to products.
- Employees — Employee records with roles, contact info, and employment details.
- File browser with upload, folder view, and list view. Backed by AWS S3 (LocalStack for local dev).
- Background job monitoring via Inngest — view execution history, steps, results, and error details.
- Tenant-scoped settings management.
- Tenants — Create and manage tenants.
- Users — Manage all users across tenants.
- Invitations — Send and manage user invitations.
| Layer | Technology |
|---|---|
| Framework | Next.js (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS + shadcn/ui |
| Database | Neon PostgreSQL |
| ORM | Prisma |
| Auth | NextAuth (Auth.js) |
| File Storage | AWS S3 / LocalStack |
| Background Jobs | Inngest |
| Resend | |
| Tests | Vitest, Playwright |
| Package Manager | pnpm |
pnpm installCopy .env.example to .env and fill in your values:
cp .env.example .envRequired services:
- PostgreSQL — Neon or any Postgres instance
- NextAuth —
AUTH_SECRET(generate withopenssl rand -base64 32) - AWS S3 / LocalStack — For file uploads (use LocalStack locally)
- Resend — For transactional email
- Inngest — For background jobs
- Google Maps — For address autocomplete (
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY)
pnpm prisma migrate devpnpm devAccess the app at http://localhost:3000.
src/
├── actions/ # Server actions (mutations + queries)
├── features/ # UI feature modules (components, hooks, types)
├── repositories/ # Database access layer (Prisma)
├── schemas/ # Zod validation schemas
├── filters/ # URL search param parsers (nuqs)
├── components/ # Shared UI components
├── lib/ # Auth, utilities, permissions, error handling
├── app/ # Next.js routes and pages
└── types/ # Global TypeScript types
Data flow: UI Component → Hook → Server Action → Repository → Prisma → Database
# Unit tests
pnpm vitest
# E2E tests
pnpm playwright test