How khoaanh0405/crm_shoesstore works
This repository’s evidenced product is a backend CRM API for customer/account management and customer surveys. Customers register or log in, access and update their profiles, and can submit assigned surveys; administrators manage accounts and customers, create and assign surveys, and inspect results. The graph emphasizes those domain stages and the API-to-service-to-data layers. Survey routes and account/customer flows are sampled; other capabilities are represented from the file tree, so their internal wiring is not inferred.
Main entry points: survey.routes.js Survey routes · app.js Express app · customer.routes.js Customer routes · account.service.js Account service
Components 23
API entry
- Express app
backend/src/app.js - Account routes
backend/src/routes/account.routes.js - Customer routes
backend/src/routes/customer.routes.js - Survey routes
backend/src/routes/survey.routes.js - JWT signing
backend/src/utils/jwt.util.js
Accounts and customers
- Account controller
backend/src/controllers/account.controller.js - Account service
backend/src/services/account.service.js - Account repository
backend/src/repositories/account.repository.js - Customer controller
backend/src/controllers/customer.controller.js - Customer service
backend/src/services/customer.service.js - Customer repository
backend/src/repositories/customer.repository.js - Customer preferences
backend/src/controllers/customerPreference.controller.js - Customer feedback
backend/src/controllers/feedback.controller.js
Survey lifecycle
- Survey controller
backend/src/controllers/survey.controller.js - Survey service
backend/src/services/survey.service.js - Survey repository
backend/src/repositories/survey.repository.js - Survey responses
backend/src/controllers/surveyResponse.controller.js - Answers and stats
backend/src/controllers/surveyAnswer.controller.js - Survey assignments
backend/src/controllers/surveyTarget.controller.js
Persistence
- Prisma connection
backend/src/config/database.js - PostgreSQL
Other components
- Administrator
- Customer
Connections 23
- Customer → Express app: calls API
- Administrator → Express app: calls API
- Express app → Account routes: mounts API
- Express app → Customer routes: mounts API
- Express app → Survey routes: mounts API
- Account routes → Account controller: dispatches
- Customer routes → Customer controller: dispatches
- Customer routes → Customer preferences: dispatches
- Customer routes → Customer feedback: dispatches
- Survey routes → Survey controller: dispatches
- Survey routes → Survey responses: dispatches
- Survey routes → Answers and stats: dispatches
- Survey routes → Survey assignments: dispatches
- Account controller → Account service: calls
- Account controller → JWT signing: signs token
- Account service → Account repository: reads and writes
- Account service → Prisma connection: creates account
- Account service → PostgreSQL: writes via Prisma
- Customer controller → Customer service: calls
- Customer service → Customer repository: reads and writes
- Prisma connection → PostgreSQL: connects
- Survey controller → Survey service: calls
- Survey service → Survey repository: reads and writes