NestFlow is an AI-assisted tenant lifecycle platform for property managers.
This repository currently implements the first MVP wave end-to-end:
- Property creation with public application links
- Tenant application submission through
/apply/[token] - AI application scoring (structured + cached)
- Applicant review (including top-3 shortlist)
- Accept/reject decisions with lease draft creation
- Lease signing with tenant activation
- Tenant portal gating and maintenance request submission
- AI maintenance urgency scoring (structured + cached + manual refresh)
- Next.js 15 (App Router)
- TypeScript
- Prisma + PostgreSQL
- Tailwind CSS
- Zod
- Google Gemini API
cp .env.example .env
npm install
npx prisma generate
npm run db:push
npm run db:seed
npm run devOpen http://localhost:3000.
DATABASE_URLGEMINI_API_KEYGEMINI_MODEL(optional, defaults togemini-2.5-flash)BLOB_READ_WRITE_TOKEN(reserved for future upload integration)
/dashboardManager landing/propertiesProperty creation + application links/apply/harbour-view-demoPublic application form/properties/:idApplicant review + top 3 + accept/reject/lease/:leaseIdLease draft + signing/tenant?applicationId=:applicationIdTenant portal (gated)/maintenanceManager maintenance queue + urgency scoring display
NestFlow follows a modular monolith pattern:
app/*: pages, route handlers, and server actionsfeatures/*: domain services and Zod contractslib/db/repositories/*: DB-only persistence helperslib/ai/*: Gemini wrapper and AI output schemas
Rules enforced in implementation:
- UI does not call Gemini directly
- Server actions call services
- Services orchestrate repositories and AI helpers
- AI outputs are structured JSON validated with Zod
- AI results are cached in DB and reused when possible
- Identity is demo-scoped via route/query context (not full auth yet)
- AI outputs are advisory only and do not make autonomous decisions
- Maintenance urgency does not auto-update request status
- Move-in/move-out inspection comparison is planned, not implemented in this wave