How shrivishal007/vendiconnect works
VendiConnect is a backend platform connecting local street vendors with nearby residents. Its main workflow accepts vendor location updates, finds residents within their notification radii, throttles and records alerts, then sends push notifications; residents can also query nearby vendors. Separate API branches support resident accounts and preferences, vendor sessions and analytics, ratings, categories, and administrative operations. The graph reflects documented routes and sampled imports/calls; some capability links rely on README or route references, since several controllers and services were not excerpted.
Main entry points: app.js API server · vendorRoutes.js Vendor routes · proximityWorker.js Resident matching · residentRoutes.js Resident routes
Components 27
API and access
- API server
Backend/src/app.js - Resident routes
Backend/src/routes/residentRoutes.js - Vendor routes
Backend/src/routes/vendorRoutes.js - Admin routes
Backend/src/routes/adminRoutes.js - Authentication
Backend/src/middleware/auth.js
Location discovery
- Location updates
Backend/src/controllers/locationController.js - Nearby search
Backend/src/controllers/proximityController.js - Vendor locations
Backend/src/models/Location.js - Distance and status
Backend/src/utils/haversine.js - Resident matching
Backend/src/services/proximityWorker.js - Alert records
Backend/src/services/alertService.js - Push notifications
Backend/src/services/fcmService.js
Community features
- Resident accounts
Backend/src/controllers/residentAuthController.js - Resident profiles
Backend/src/models/Resident.js - Resident preferences
Backend/src/controllers/preferenceController.js - Vendor consent sessions
Backend/src/controllers/vendorSessionController.js - Vendor ratings
Backend/src/controllers/ratingController.js - Categories
Backend/src/controllers/categoryController.js
Operations and reporting
- Vendor analytics
Backend/src/controllers/analyticsController.js - Admin operations
Backend/src/controllers/adminController.js - Vendor administration
Backend/src/controllers/adminVendorController.js - Vendor records
Backend/src/models/Vendor.js - Admin accounts
Backend/src/models/AdminUser.js
Other components
- Residents
- Street vendors
- Administrators
- Firebase services
Connections 34
- Residents → API server: calls API
Backend/src/app.js - Street vendors → API server: calls API
Backend/src/app.js - Administrators → API server: calls API
Backend/src/app.js - API server → Resident routes: mounts routes
Backend/src/app.js - API server → Vendor routes: mounts routes
Backend/src/app.js - API server → Admin routes: mounts routes
Backend/src/app.js - Resident routes → Authentication: authenticates
Backend/src/routes/residentRoutes.js - Resident routes → Resident accounts: routes requests
Backend/src/routes/residentRoutes.js - Resident accounts → Resident profiles: reads and updates
Backend/src/controllers/residentAuthController.js - Resident routes → Resident preferences: routes preferences
Backend/src/routes/residentRoutes.js - Vendor routes → Location updates: routes updates
Backend/src/routes/vendorRoutes.js - Vendor routes → Nearby search: routes searches
Backend/src/routes/vendorRoutes.js - Location updates → Vendor locations: updates location
Backend/src/controllers/locationController.js - Nearby search → Vendor locations: queries nearby
Backend/src/controllers/proximityController.js - Nearby search → Resident profiles: reads resident location
Backend/src/controllers/proximityController.js - Nearby search → Distance and status: calculates distance
Backend/src/controllers/proximityController.js - Location updates → Resident matching: triggers matching
Backend/src/controllers/locationController.js - Resident matching → Resident profiles: reads residents
Backend/src/services/proximityWorker.js - Resident matching → Vendor records: reads vendor
Backend/src/services/proximityWorker.js - Resident matching → Distance and status: calculates distance
Backend/src/services/proximityWorker.js - Resident matching → Alert records: checks and throttles
Backend/src/services/proximityWorker.js - Resident matching → Push notifications: sends notification
Backend/src/services/proximityWorker.js - Push notifications → Firebase services: uses messaging
Backend/src/services/fcmService.js - Vendor routes → Vendor consent sessions: routes consent
Backend/src/routes/vendorRoutes.js - Vendor routes → Vendor analytics: routes reports
Backend/src/routes/vendorRoutes.js - Admin routes → Authentication: authenticates
Backend/src/routes/adminRoutes.js - Admin routes → Admin operations: routes dashboard
Backend/src/routes/adminRoutes.js - Admin operations → Admin accounts: reads admin
Backend/src/controllers/adminController.js - Admin operations → Vendor records: counts vendors
Backend/src/controllers/adminController.js - Admin operations → Resident profiles: counts residents
Backend/src/controllers/adminController.js - Admin routes → Vendor administration: routes management
Backend/src/routes/adminRoutes.js - Vendor administration → Vendor records: manages vendors
Backend/src/controllers/adminVendorController.js - Vendor routes → Vendor ratings: routes ratings
- API server → Categories: mounts public routes
Backend/src/app.js