How fedhako7/lead-management works
LeadFlow is a full-stack lead-management application. Users review dashboard metrics and recent leads, browse a searchable, filterable, sortable, paginated lead list, and create leads; the API also supports reading, updating, and deleting leads. The backend routes requests through controllers to a MongoDB model, while the frontend’s API client communicates with the backend. Dashboard and list calls are visible in excerpts; some form-to-API wiring and unsampled integrations are shown only as documented capabilities.
Main entry points: api.ts API client · start.ts Express server · page.tsx Dashboard · leadController.ts Lead operations and analytics
Components 15
LeadFlow interface
- Dashboard
frontend/app/page.tsx - Lead list page
frontend/app/leads/page.tsx - Lead search and list
frontend/app/leads/leads-client.tsx - Create lead form
frontend/app/leads/new/page.tsx - API client
frontend/lib/api.ts
Lead API
- Express server
backend/start.ts - Lead routes
backend/routes/leadRoutes.ts - Lead operations and analytics
backend/controllers/leadController.ts - Error handling
backend/middleware/errorHandler.ts - Lead API types
backend/types/index.ts
Lead persistence
- Lead model
backend/models/Lead.ts - MongoDB connection
backend/db/connection.ts
Other components
- Sales user
- Lead API
- MongoDB
Connections 18
- Sales user → Dashboard: views
README.md - Sales user → Lead list page: browses
README.md - Sales user → Create lead form: creates
README.md - Lead list page → Lead search and list: renders
frontend/app/leads/page.tsx - Dashboard → API client: requests metrics
frontend/app/page.tsx - Dashboard → API client: requests recent leads
frontend/app/page.tsx - Lead search and list → API client: fetches leads
frontend/app/leads/leads-client.tsx - Create lead form → API client: submits lead
- API client → Lead API: sends HTTP requests
README.md - Lead API → Express server: reaches
README.md - Express server → MongoDB connection: connects
backend/start.ts - Express server → Lead routes: mounts routes
backend/start.ts - Express server → Error handling: registers middleware
backend/start.ts - Lead routes → Lead operations and analytics: dispatches
backend/routes/leadRoutes.ts - Lead operations and analytics → Lead model: queries and updates
backend/controllers/leadController.ts - Lead operations and analytics → Lead API types: uses response types
backend/controllers/leadController.ts - MongoDB connection → MongoDB: connects
backend/db/connection.ts - Lead model → MongoDB: reads and writes