Fluxo API is a modular ERP backend built as a decoupled modular monolith for SaaS usage.
The current v1 covers:
assetsfinanceemployeespayroll- adaptive
overview - tenant provisioning
- subscription and access-key management
Fluxo is designed to let one company subscribe to one or more business modules, then operate inside its own isolated tenant database.
Current functional domains:
assets: asset registry, assignments, finance data, maintenancefinance: transactions, accounts, journal entries, reconciliationsemployees: staff directory, roles, positions, assignments, contractspayroll: payslips, pay runs, payroll-finance integration
Fluxo uses a multi-tenant architecture with two database layers:
- global admin database:
- companies
- subscription requests
- plans
- access keys
- tenant database registry
- global audit
- tenant database:
- assets
- finance
- employees
- payroll
- tenant audit
Prisma schemas:
- global SaaS schema: prisma/schema.prisma
- tenant business schema: prisma/tenant.schema.prisma
Runtime behavior:
- access keys are validated against the global database
- the tenant company is resolved from the access key
- requests are routed to the company tenant database
- business modules operate only on tenant data
v1 modules currently available:
assetsfinanceemployeespayroll
All four modules are:
- tenant-aware
- protected by subscription access keys
- documented in Swagger
- exposed in the adaptive
/api/overview
The /api/overview endpoint is progressive and subscription-aware.
It returns:
- one block per module
cross_modulemetrics when multiple ready modules are enabled
Current cross-module coverage includes:
assets + employeesassets + financepayroll + financepayroll + employeesassets + payroll + finance
The public API contract is frontend-friendly:
- request payloads may be sent in
snake_case - internal backend logic stays in
camelCase - responses are returned in
snake_case
Pagination is centralized and reusable across modules.
Fluxo currently uses module access keys instead of multi-user authentication.
Access flow:
- the client requests modules from the portal
- an admin approves the subscription
- a tenant company database is provisioned
- an access key is generated
- the key grants access only to subscribed modules
Related docs:
Operational features already included:
- request logging with
request_id - rate limiting
- health endpoint
- metrics endpoint
- monitoring snapshot
- global audit
- tenant audit
- backup and restore scripts
- tenant schema synchronization
Related docs:
Install:
pnpm installGenerate Prisma clients:
pnpm run prisma:generateValidate both Prisma schemas:
pnpm run prisma:validateRun the API in development:
pnpm run devBuild production bundle:
pnpm run buildRun tests:
pnpm testCreate a release locally, then push commits and tags:
pnpm run release
pnpm run release:pushThis flow:
- updates
package.json - updates
CHANGELOG.md - creates a Git tag like
v1.2.0 - pushes commits and tags to
main - triggers GitHub Actions to create the GitHub Release automatically
Synchronize tenant schemas:
pnpm run tenant:syncSeed asset mock data for one tenant:
pnpm run tenant:seed:assets -- --company <tenant-slug> --count 25Create a database backup:
pnpm run db:backupRestore a backup:
pnpm run db:restore -- --file backups/<file>.dumpMain endpoints:
/docs/openapi.json/health/metrics/observability/modules/api/overview/api/access/plans/api/access/me/api/assets/api/finance/api/employees/api/payroll
Public subscription/admin web pages:
/portal/admin/subscriptions?token=...
Module docs:
Development guide:
The project is now in a v1 production-ready zone for controlled SaaS rollout, with the main remaining work being:
- final deployment validation
- real SMTP configuration
- final backup/restore rehearsal
- final production environment setup
From an application and architecture perspective, the first version is now functionally complete.