How davidericson00/cade works
Cadê? is a lost-and-found web platform: visitors browse and filter items and download reports, while administrators register, authenticate with emailed two-factor codes, manage items, and inspect access logs. The SPA routes these tasks through a shared HTTP client to the Express API; API handlers delegate domain work to services and repositories, with MongoDB and optional Cloudinary/SMTP integrations. README descriptions supply important unsampled capabilities; edges are limited to relationships evidenced by excerpts, indexed references, or README statements.
Main entry points: client.ts HTTP client · routes.tsx Page routing · items.routes.ts Item endpoints · LogsPage.tsx Access log viewer
Components 31
Web experience
- Page routing
web/src/routes.tsx - Item browsing
web/src/pages/items - Item editor
web/src/pages/items/ItemFormPage.tsx - Report downloads
web/src/pages/reports/ReportsPage.tsx - Access log viewer
web/src/pages/logs/LogsPage.tsx - HTTP client
web/src/api/client.ts - System status gate
web/src/system
Identity and access
- Login and 2FA
web/src/pages/auth - Session state
web/src/auth/session.ts - Authentication handlers
api/src/controllers/auth.controller.ts - Account authentication
api/src/services/auth.service.ts - Challenge service
api/src/services/twoFactor.service.ts - Email delivery
api/src/services/email.service.ts
Item management
- Item endpoints
api/src/routes/items.routes.ts - Item handlers
api/src/controllers/items.controller.ts - Item operations
api/src/services/items.service.ts - Item persistence
api/src/repositories/items.repository.ts - Image storage
api/src/services/storage.service.ts
Reports and operations
- PDF report handler
api/src/controllers/report.controller.ts - CSV export handler
api/src/controllers/export.controller.ts - PDF generation
api/src/services/report.service.ts - CSV generation
api/src/services/export.service.ts - Log handlers
api/src/controllers/requestLog.controller.ts - Log queries
api/src/services/requestLog.service.ts - In-memory request logs
api/src/data/request-logs.ts
API foundation
- Express application
api/src/app.ts - MongoDB
Other components
- Visitor or admin
- Cloudinary
- SMTP service
- Browser
Connections 33
- Visitor or admin → Page routing: uses
- Page routing → Item browsing: routes to
web/src/routes.tsx - Page routing → Item editor: routes to
web/src/routes.tsx - Page routing → Report downloads: routes to
web/src/routes.tsx - Page routing → Access log viewer: routes to
web/src/routes.tsx - Page routing → Login and 2FA: routes to
web/src/routes.tsx - Item editor → HTTP client: calls
web/src/pages/items/ItemFormPage.tsx - Report downloads → HTTP client: downloads via
- Access log viewer → HTTP client: fetches via
web/src/pages/logs/LogsPage.tsx - Login and 2FA → HTTP client: calls
web/src/pages/auth/TwoFactorPage.tsx - HTTP client → Session state: reads token
web/src/api/client.ts - HTTP client → Express application: HTTP requests
- Browser → HTTP client: runs
- HTTP client → System status gate: signals failures
web/src/App.tsx - Express application → Item endpoints: mounts routes
api/src/app.ts - Item endpoints → Item handlers: dispatches
api/src/routes/items.routes.ts - Item handlers → Item operations: calls
api/src/controllers/items.controller.ts - Item operations → Item persistence: uses
api/src/services/items.service.ts - Item persistence → MongoDB: persists items
api/src/repositories/items.repository.ts - Item handlers → Image storage: calls
api/src/controllers/items.controller.ts - Image storage → Cloudinary: uploads or deletes
api/src/services/storage.service.ts - Authentication handlers → Account authentication: starts login
api/src/controllers/auth.controller.ts - Authentication handlers → Challenge service: verifies or resends
api/src/controllers/auth.controller.ts - Account authentication → Challenge service: starts challenge
api/src/services/auth.service.ts - Challenge service → Email delivery: sends codes
api/src/services/twoFactor.service.ts - Email delivery → SMTP service: delivers email
- Item endpoints → PDF report handler: dispatches report
api/src/routes/items.routes.ts - Item endpoints → CSV export handler: dispatches export
api/src/routes/items.routes.ts - PDF report handler → PDF generation: calls
api/src/controllers/report.controller.ts - CSV export handler → CSV generation: calls
api/src/controllers/export.controller.ts - Access log viewer → Log handlers: requests logs
- Log handlers → Log queries: delegates
- Log queries → In-memory request logs: reads logs