How alifaizan786-op/amp_csr works
AMP CSR Portal is a customer-service application for finding accounts and resolving membership issues. A CSR searches and filters the customer list, opens an account to review vehicles, subscriptions, purchases and activity, then edits account details or performs guarded vehicle and membership actions. The React client calls an Express API; controllers apply business rules and persist customer, purchase and activity records in MongoDB. The README documents UI and API capabilities beyond the sampled excerpts; those branches are represented without inferring unsampled call links.
Main entry points: customerController.ts Customer rules · vehicleController.ts Membership rules · CustomerDetailPage.tsx Account detail · customers.ts Customer requests
Components 23
CSR client
- Routes and layout
client/src/App.tsx - Customer search
client/src/pages/CustomerListPage.tsx - Account detail
client/src/pages/CustomerDetailPage.tsx - Account actions
client/src/components/customer - Vehicle actions
client/src/components/vehicle - Customer requests
client/src/api/customers.ts - Vehicle requests
client/src/api/vehicles.ts - HTTP client
client/src/api/client.ts
API and rules
- API routes
server/routes - Customer rules
server/controllers/customerController.ts - Membership rules
server/controllers/vehicleController.ts - Search filters
server/utils/customerQuery.ts - Vehicle operations
server/utils/vehicleHelpers.ts - Plan definitions
server/utils/plans.ts - Activity logging
server/utils/logActivity.ts - Database connection
server/config/connection.ts
MongoDB records
- Customer and vehicles
server/models/Customer.ts - Purchase records
server/models/Purchase.ts - Activity records
server/models/Activity.ts
Demo data
- Demo scenarios
server/seeds/seedData.ts - Seed runner
server/seeds/seed.ts
Other components
- CSR
- MongoDB
Connections 30
- CSR → Routes and layout: uses portal
README.md - Routes and layout → Customer search: routes to
client/src/App.tsx - Routes and layout → Account detail: routes to
client/src/App.tsx - Customer search → Customer requests: requests list
client/src/pages/CustomerListPage.tsx - Account detail → Customer requests: loads account
client/src/pages/CustomerDetailPage.tsx - Account detail → Account actions: renders
client/src/pages/CustomerDetailPage.tsx - Account detail → Vehicle actions: renders
client/src/pages/CustomerDetailPage.tsx - Account actions → Customer requests: submits changes
- Vehicle actions → Vehicle requests: submits actions
- Customer requests → HTTP client: sends requests
client/src/api/customers.ts - Vehicle requests → HTTP client: sends requests
- HTTP client → API routes: calls API
client/src/api/client.ts - API routes → Customer rules: dispatches
server/routes/customers.ts - API routes → Membership rules: dispatches
server/routes/vehicles.ts - Customer rules → Search filters: builds filters
server/controllers/customerController.ts - Customer rules → Customer and vehicles: reads and saves
server/controllers/customerController.ts - Customer rules → Purchase records: reads purchases
server/controllers/customerController.ts - Customer rules → Activity records: reads activity
server/controllers/customerController.ts - Customer rules → Activity logging: logs changes
server/controllers/customerController.ts - Membership rules → Customer and vehicles: saves customer
server/controllers/vehicleController.ts - Membership rules → Vehicle operations: applies operations
server/controllers/vehicleController.ts - Membership rules → Plan definitions: validates plans
server/controllers/vehicleController.ts - Membership rules → Activity logging: logs changes
server/controllers/vehicleController.ts - Activity logging → Activity records: creates entries
server/utils/logActivity.ts - Database connection → MongoDB: connects
server/config/connection.ts - Customer and vehicles → MongoDB: persists
- Purchase records → MongoDB: persists
- Activity records → MongoDB: persists
- Seed runner → Demo scenarios: builds fixtures
server/seeds/seed.ts - Seed runner → Customer and vehicles: writes demo records
server/seeds/seed.ts