How rajeshmore369/placio works
1. Purpose and Runtime Topology
Placio is a multi-tenant smart-campus placement platform covering practice, assessments, placement workflows, LMS-style features, proctoring, analytics, billing, and notifications. It runs as a Next.js web client, NestJS API, and Flutter mobile client.
• Web entry: frontend/src/app/layout.tsx, frontend/src/app/page.tsx
• API bootstrap/composition: backend/src/main.ts, backend/src/app.module.ts
• Mobile entry: mobile/lib/main.dart
2. Web and Mobile Clients
The Next.js App Router frontend provides public, authentication, practice, and role-specific dashboard routes. Dashboard layout is the primary client-side navigation boundary for Student, Institute, TPO, and Super Admin experiences. frontend/src/lib/api.ts is the browser-to-API boundary; tenant context and desktop restrictions are client concerns.
• frontend/src/app/dashboard/layout.tsx
• frontend/src/app/dashboard/student/page.tsx
• frontend/src/lib/tenantContext.tsx
Flutter is a separate API-consuming client with centralized routing and services for authentication, connectivity, FCM, cached state, exams, and proctoring.
• mobile/lib/core/router/app_router.dart
• mobile/lib/core/services/api_service.dart
• mobile/lib/core/services/proctor_service.dart
3. API, Identity, and Tenant Enforcement
NestJS is organized by domain modules with controllers as HTTP boundaries and services as business/data orchestration. OTP authentication issues JWTs; guards enforce JWT, role, plan, B2B, CSRF, and desktop policies. Tenant middleware/context establishes institutional isolation before domain services execute.
• backend/src/auth/auth.module.ts
• backend/src/common/middleware/tenant.middleware.ts
• backend/src/common/guards/plan.guard.ts
User, tenant, and billing domains govern administrative access and subscription entitlement across feature modules.
• backend/src/users/users.service.ts
• backend/src/tenants/tenants.service.ts
• backend/src/billing/billing.service.ts
4. AI Practice and Asynchronous Feedback Pipeline
Nine practice domains expose dedicated APIs and session workflows: interview, aptitude, coding, English, GD simulation, resume review, daily challenge, skill roadmap, and company preparation. They share the AI layer rather than calling models directly.
• backend/src/practice/practice.module.ts
• backend/src/practice/interview/interview.service.ts
• backend/src/practice/coding/coding.service.ts
ModelRouterService selects Claude models by task/cost. Question generation is precomputed into PostgreSQL; real-time sessions use appropriate models; longer feedback is queued, submitted to Anthropic Batch API, polled, and persisted. Redis/BullMQ is the production asynchronous boundary, with fallback behavior when unavailable.
• backend/src/ai/model-router.service.ts
• backend/src/ai/question-bank.service.ts
• backend/src/ai/feedback.processor.ts
5. Core Campus Workflows and Integrations
Placement tracks jobs and student applications through a staged pipeline. Assessments own exam/test handling and delegate code execution to Judge0. Frontend proctoring is browser-local—camera/face, audio, and browser monitoring—while assessment/proctoring results are submitted to backend workflows.
• backend/src/placement/placement.service.ts
• backend/src/assessments/judge0.service.ts
• frontend/src/lib/proctoring/engine.ts
Supporting domains provide persisted resumes/files, analytics, multi-channel notifications, and mail delivery. External boundaries include Cloudflare R2/S3-compatible storage, Razorpay, Resend/SMTP, Firebase Cloud Messaging, and Judge0.
• backend/src/files/files.service.ts
• backend/src/notifications/notifications.service.ts
• backend/src/analytics/analytics.service.ts
6. Data and Deployment Boundaries
Prisma defines the shared PostgreSQL persistence model, targeting Neon PostgreSQL. Redis supports cache and queue workloads. Docker Compose deploys frontend, backend, reverse proxy, and supporting services; Nginx is the public ingress. The frontend proxies API traffic during development rather than directly embedding backend connectivity.
• backend/prisma/schema.prisma
• backend/src/prisma/prisma.service.ts
• backend/src/redis/redis.service.ts
• docker-compose.yml
• nginx/nginx.conf
Production variants and CI/CD are represented by DigitalOcean deployment assets and GitHub Actions.
• .do/docker-compose.prod.yml
• .do/nginx.prod.conf
• .github/workflows/ci-cd.yml
Main entry points: layout.tsx Next.js web client · app.module.ts NestJS API · feedback.processor.ts Feedback worker · docker-compose.yml Docker Compose stack
Components 19
Client apps
- Next.js web client · Public, auth, practice, and role-specific experiences.
frontend/src/app/layout.tsx - Dashboard boundary · Role-specific student, institute, TPO, and admin navigation.
frontend/src/app/dashboard/layout.tsx - Tenant context
frontend/src/lib/tenantContext.tsx - Browser proctoring · Captures local camera, audio, face, and browser signals.
frontend/src/lib/proctoring/engine.ts - Flutter mobile client · API client with centralized routing, cached state, and FCM.
mobile/lib/main.dart - Mobile API service
mobile/lib/core/services/api_service.dart
NestJS API
- NestJS API · HTTP composition root for domain modules.
backend/src/app.module.ts - Identity and tenant enforcement · JWT, policy, entitlement, and institutional isolation boundary.
backend/src/common/middleware/tenant.middleware.ts - Campus workflow domains · Placement, assessments, files, analytics, notifications, users, tenants, and billing.
backend/src/placement/placement.service.ts - Practice domains · Nine practice workflows share the AI layer.
backend/src/practice/practice.module.ts
AI feedback pipeline
- Model router · Selects Claude models by task and cost.
backend/src/ai/model-router.service.ts - Question bank generation · Generates and stores practice questions ahead of sessions.
backend/src/ai/question-bank.service.ts - Feedback worker · Submits, polls, and persists long-running AI feedback.
backend/src/ai/feedback.processor.ts
Data and integrations
- Neon PostgreSQL · Shared Prisma persistence model.
backend/prisma/schema.prisma - Redis · Production cache and BullMQ boundary.
backend/src/redis/redis.service.ts - External services · Anthropic, Judge0, R2/S3, Razorpay, Resend/SMTP, and FCM.
backend/src/assessments/judge0.service.ts
Deployment
- Nginx ingress · Public entrypoint for deployed services.
nginx/nginx.conf - Docker Compose stack · Runs frontend, backend, proxy, and supporting services.
docker-compose.yml - CI/CD · Builds and deploys production variants.
.github/workflows/ci-cd.yml
Connections 25
- Next.js web client → Dashboard boundary: renders
- Next.js web client → Tenant context: sets client tenant
- Dashboard boundary → Browser proctoring: runs assessment monitoring
- Next.js web client → NestJS API: API requests
- Flutter mobile client → Mobile API service: uses
- Mobile API service → NestJS API: API requests
- NestJS API → Identity and tenant enforcement: applies before services
- Identity and tenant enforcement → Campus workflow domains: authorizes and scopes
- Identity and tenant enforcement → Practice domains: authorizes and scopes
- Campus workflow domains → Neon PostgreSQL: persists workflows
- Campus workflow domains → External services: uses payments, files, mail, FCM, Judge0
- Browser proctoring → Campus workflow domains: submits results
- Practice domains → Model router: requests AI work
- Model router → Question bank generation: supports generation
- Question bank generation → Neon PostgreSQL: stores questions
- Model router → Feedback worker: queues long feedback
- Feedback worker → Redis: consumes jobs
- Feedback worker → External services: Anthropic Batch API
- Feedback worker → Neon PostgreSQL: persists feedback
- Nginx ingress → Next.js web client: routes public traffic
- Nginx ingress → NestJS API: routes API traffic
- Docker Compose stack → Nginx ingress: deploys
- Docker Compose stack → NestJS API: runs
- Docker Compose stack → Next.js web client: runs
- CI/CD → Docker Compose stack: deploys