How xuantruongfpt28/quanlicuahang works
This is a small electric-vehicle shop customer-management application. Staff load and search customer records, create or edit sales, print a sales receipt/contract, and export filtered records; Google Forms can also submit customer data through a webhook. The backend exposes customer CRUD and separate branch CRUD handlers, although the sampled app does not mount the branch routes. The source excerpts establish the customer API and persistence calls; branch mounting, database-provider wiring, and some frontend rendering details were not shown.
Main entry points: CustomerManagement.tsx Customer management · customerRoutes.ts Customer routes · database.ts Prisma client · App.tsx Application shell
Components 13
Shop frontend
- Application shell
cua-hang-frontend/src/App.tsx - Customer management
cua-hang-frontend/src/components/CustomerManagement.tsx - Contract print
cua-hang-frontend/src/components/ContractPrint.tsx
Backend API
- Express application
backend/src/app.ts - Customer routes
backend/src/routes/customerRoutes.ts - Customer operations
backend/src/controllers/customerController.ts - Form ingestion
backend/src/controllers/createCustomerFromGoogleForm.ts - Branch routes
backend/src/routes/branchRoutes.ts - Branch operations
backend/src/controllers/branchController.ts
Persistence
- Prisma client
backend/src/config/database.ts - Data schema
backend/prisma/schema.prisma
Other components
- Shop staff
- Google Form
Connections 11
- Shop staff → Application shell: uses
cua-hang-frontend/src/App.tsx - Application shell → Customer management: renders
cua-hang-frontend/src/App.tsx - Customer management → Express application: requests customer API
cua-hang-frontend/src/components/CustomerManagement.tsx - Customer management → Contract print: prints contract
cua-hang-frontend/src/components/CustomerManagement.tsx - Express application → Customer routes: mounts
backend/src/app.ts - Customer routes → Customer operations: dispatches
backend/src/routes/customerRoutes.ts - Google Form → Customer routes: submits webhook
- Customer operations → Prisma client: reads/writes
backend/src/controllers/customerController.ts - Form ingestion → Prisma client: writes
backend/src/controllers/createCustomerFromGoogleForm.ts - Branch routes → Branch operations: dispatches
backend/src/routes/branchRoutes.ts - Branch operations → Prisma client: reads/writes
backend/src/controllers/branchController.ts