How alamin147/lost-and-found works
Lost & Found is a full-stack community platform: users authenticate, report lost or found belongings, search listings, and submit claims; administrators manage listings, claims, users, categories, and statistics. The frontend routes users into public, personal, and administrative views, while the Express API dispatches requests to domain controllers and services backed by Prisma. AI search reads eligible listings and asks Gemini to rank matches, with a text-search fallback. Backend routing and several controller/service interactions are sampled; frontend API-call wiring and some unsampled service internals are not shown, so those links are omitted.
Main entry points: routes.ts API route dispatch · prisma.ts PostgreSQL via Prisma · main.tsx React entry and routes · aiSearch.service.ts AI matching and fallback
Components 21
Web application
- React entry and routes
frontend/src/main.tsx - Browse and report
frontend/src/pages - Login and registration
frontend/src/pages - Personal item and claim views
frontend/src/dashboard - Admin dashboard
frontend/src/dashboard/pages - Frontend API layer
frontend/src/redux/api
API and identity
- Express application
server/src/app.ts - API route dispatch
server/src/app/routes/routes.ts - Authentication endpoints
server/src/app/auth/auth.controller.ts - Identity and account service
server/src/app/auth/auth.service.ts - User administration endpoints
server/src/app/modules/user/user.controllers.ts
Items and claims
- Found item endpoints
server/src/app/modules/foundItems/foundItem.controller.ts - Lost item endpoints
server/src/app/modules/lostItem/lost.controller.ts - Claim endpoints
server/src/app/modules/claim/claim.controller.ts - Category endpoints
server/src/app/modules/itemCategory/itemcategory.controller.ts
Administration and search
- AI search endpoint
server/src/app/modules/aiSearch/aiSearch.controller.ts - AI matching and fallback
server/src/app/modules/aiSearch/aiSearch.service.ts - Admin statistics
server/src/app/utils/adminStats.ts
Other components
- User or admin
- PostgreSQL via Prisma
server/src/app/config/prisma.ts - Google Gemini
Connections 27
- User or admin → React entry and routes: uses
- React entry and routes → Browse and report: routes to
- React entry and routes → Login and registration: routes to
- React entry and routes → Personal item and claim views: routes to
- React entry and routes → Admin dashboard: routes to
- User or admin → Frontend API layer: submits requests
- Frontend API layer → Express application: API requests
- Express application → API route dispatch: mounts API
- API route dispatch → Authentication endpoints: dispatches
- API route dispatch → User administration endpoints: dispatches
- API route dispatch → Found item endpoints: dispatches
- API route dispatch → Lost item endpoints: dispatches
- API route dispatch → Claim endpoints: dispatches
- API route dispatch → Category endpoints: dispatches
- API route dispatch → AI search endpoint: dispatches
- API route dispatch → Admin statistics: dispatches
- Authentication endpoints → Identity and account service: calls
- Identity and account service → PostgreSQL via Prisma: reads and writes
- Found item endpoints → PostgreSQL via Prisma: service accesses
- Lost item endpoints → PostgreSQL via Prisma: service accesses
- Claim endpoints → PostgreSQL via Prisma: service accesses
- Category endpoints → PostgreSQL via Prisma: service accesses
- User administration endpoints → PostgreSQL via Prisma: service accesses
- AI search endpoint → AI matching and fallback: calls
- AI matching and fallback → PostgreSQL via Prisma: loads listings
- AI matching and fallback → Google Gemini: requests matches
- Admin statistics → PostgreSQL via Prisma: reads metrics