Multi-tenant onboarding SaaS with billing and automated follow-up orchestration.
PT-BR: Plataforma SaaS de onboarding com foco em organizacao multi-tenant e operacao de produto real.
Teams need a repeatable way to onboard clients with clear lifecycle, billing controls, and follow-up automation.
flowchart LR
User[Authenticated User] --> Web[Next.js App Router]
Web --> API[Server Actions / API Routes]
API --> Domain[Onboarding + Billing + Follow-up Services]
Domain --> DB[(PostgreSQL via Prisma)]
Domain --> MP[Mercado Pago]
Domain --> AI[Gemini Models]
Domain --> Storage[S3/Local Storage]
- Application: Next.js 16, TypeScript
- Data: Prisma + PostgreSQL (Supabase-compatible)
- Auth: NextAuth
- Billing: Mercado Pago
- Tests: Vitest
- CI: GitHub Actions
app/ # App Router pages and APIs
components/ # Shared UI components
lib/ # Domain services and integrations
prisma/ # Schema and seed scripts
tests/ # Automated tests
docs/ # Architecture and deployment notes
npm install
cp .env.example .env.local
npm run devnpm run lint
npm test
npm run build- CI enforces lint, tests, and production build readiness on the public branch.
- Product and deployment notes live in
docs/, while schema and service behavior stay close to the codebase. - The main workflow is operational by design: tenant-scoped onboarding, billing hooks, and follow-up automation run as one product system.
npm run lint
npm test
npm run build- For local DB setup, run
npx prisma db pushafter configuringDATABASE_URL. - Storage defaults to local in development and should use S3-compatible backend in production.
- Application-level tenant isolation (
organizationId) keeps the code explicit; RLS can be added later. - Prisma chosen for developer speed and schema migration workflow.
- Billing and automation hooks are integrated early to reflect production-like constraints.
- Add integration tests for billing lifecycle transitions
- Add tenant-level observability dashboards
- Add stronger policy checks for follow-up automation jobs
MIT. See LICENSE.