How rohit1817-45/lost_found_universal works
Purpose and Entry Points
This is a case-reporting and matching platform with distinct user, NGO, police, and admin experiences. The frontend application starts at frontend/src/index.js and composes routes/UI from frontend/src/App.js. Backend API startup is centered on backend/server.py.
Client Application and Role-Based Experiences
React frontend pages implement public, account, reporting, browsing, case-detail, messaging, and role-specific dashboard flows. Route access is guarded by frontend/src/components/ProtectedRoute.jsx; session/auth state is handled in frontend/src/lib/auth.jsx.
• frontend/src/pages/Apply.jsx
• frontend/src/pages/Browse.jsx
• frontend/src/pages/PoliceDashboard.jsx
Case Reporting and Investigation Domain
Case creation and presentation form the core domain boundary. The report workflow is represented by frontend/src/components/ReportWizard.jsx, case discovery/detail by page components, and backend case operations by backend/cases.py. Matching logic is isolated from case CRUD in backend/matching.py.
• frontend/src/pages/CaseDetail.jsx
• frontend/src/components/CaseCard.jsx
• backend/cases.py
API, Authorization, and Service Boundaries
The backend groups API responsibilities by domain: authentication, cases, matching, messaging, and administration. Shared request dependencies/authorization enforcement likely belong in backend/deps.py, while persistence-facing schemas/entities are centralized in backend/models.py.
• backend/auth.py
• backend/messaging.py
• backend/admin.py
Data Platform and External Services
Supabase is the primary managed data boundary, with SQL migrations defining the database schema and storage setup. The frontend directly configures a Supabase client, while backend services likely use the same underlying platform for protected operations. Environment-specific secrets/configuration are separated under frontend and backend .env files.
• supabase/migrations/00_schema.sql
• supabase/migrations/01_storage.sql
• frontend/src/lib/supabase.js
Operational Automation
Deployment guidance is captured in DEPLOY.md. Emergent-managed cron scripts monitor and dispatch webhook-triggered scheduled work, creating an infrastructure boundary outside the application request path.
• .emergent/cron/watch_crons.sh
• .emergent/cron/dispatch_webhook.sh
• .emergent/cron/webhook_crond.sh
Main entry points: App.js App routes · server.py API server · cases.py Case operations · models.py Data models
Components 24
React client
Role-specific reporting and case experiences.
- Client entry
frontend/src/index.js - App routes
frontend/src/App.js - Auth session
frontend/src/lib/auth.jsx - Protected routes
frontend/src/components/ProtectedRoute.jsx - Report wizard
frontend/src/components/ReportWizard.jsx - Case browsing
frontend/src/pages/Browse.jsx - Case detail
frontend/src/pages/CaseDetail.jsx - Role experiences · Application and police dashboard flows.
frontend/src/pages/Apply.jsx - Police dashboard
frontend/src/pages/PoliceDashboard.jsx - Supabase client
frontend/src/lib/supabase.js
Backend API
Domain APIs and authorization boundary.
- API server
backend/server.py - Request authorization
backend/deps.py - Authentication API
backend/auth.py - Case operations · Case CRUD and investigation operations.
backend/cases.py - Matching engine · Matching is isolated from case CRUD.
backend/matching.py - Messaging API
backend/messaging.py - Administration API
backend/admin.py - Data models
backend/models.py
Data platform
Managed persistence and storage.
- Supabase platform · Primary database and storage boundary.
supabase/migrations/00_schema.sql - Storage setup
supabase/migrations/01_storage.sql
Operations
Deployment and scheduled webhook automation.
- Deployment guidance
DEPLOY.md - Cron monitor
.emergent/cron/watch_crons.sh - Webhook dispatcher
.emergent/cron/dispatch_webhook.sh - Webhook cron runner
.emergent/cron/webhook_crond.sh
Connections 31
- Client entry → App routes: boots
- App routes → Auth session: uses session
- App routes → Protected routes: guards access
- App routes → Report wizard: serves
- App routes → Case browsing: serves
- App routes → Case detail: serves
- App routes → Role experiences: serves
- Role experiences → Police dashboard: includes
- Auth session → Authentication API: authenticates via
- Report wizard → Case operations: creates cases
- Case browsing → Case operations: queries cases
- Case detail → Case operations: reads cases
- Police dashboard → Matching engine: uses matches
- App routes → Messaging API: messages via
- App routes → Administration API: admin actions
- Supabase client → Supabase platform: connects to
- API server → Request authorization: enforces
- API server → Authentication API: mounts
- API server → Case operations: mounts
- API server → Matching engine: mounts
- API server → Messaging API: mounts
- API server → Administration API: mounts
- Case operations → Request authorization: authorizes with
- Case operations → Data models: uses
- Matching engine → Data models: uses
- Messaging API → Data models: uses
- Administration API → Data models: uses
- Data models → Supabase platform: persists to
- Storage setup → Supabase platform: provisions
- Cron monitor → Webhook dispatcher: triggers
- Webhook cron runner → Webhook dispatcher: runs