How thanhvu134/cong_nghe_phan_mem works
This is a product-catalog and inventory-management web application with a React frontend, Express API, and MySQL persistence. Users browse and filter products, inspect details, and register or sign in; administrators can maintain products and manage user roles. Authentication also supports PDF-based token login, while the interface includes profile, statistics, and PDF-generation capabilities. The graph follows shown imports, route registrations, and SQL calls; frontend-to-backend endpoint matching is not asserted where excerpts do not establish the wiring.
Main entry points: App.jsx Page routing · products.js Product API client · AuthContext.jsx Session state · auth.middleware.js JWT authorization
Components 23
Web interface
- Page routing
quanLySP/frontend/src/App.jsx - Session state
quanLySP/frontend/src/context/AuthContext.jsx - Sign in and register
quanLySP/frontend/src/pages/Login.jsx - Account profile
quanLySP/frontend/src/pages/Profile.jsx - Home and PDF export
quanLySP/frontend/src/pages/Home.jsx - Product browsing
quanLySP/frontend/src/pages/Products.jsx - Product detail
quanLySP/frontend/src/pages/ProductDetail.jsx - Statistics
quanLySP/frontend/src/pages/Statistics.jsx - PDF generator
quanLySP/frontend/src/utils/pdfGenerator.js - Embedded font
quanLySP/frontend/src/utils/fonts/roboto-regular.js
API and authentication
- Authentication API client
quanLySP/frontend/src/api/auth.js - Product API client
quanLySP/frontend/src/api/products.js - HTTP API service
- Authentication routes
quanLySP/backend/src/routes/auth.routes.js - Authentication and PDF login
quanLySP/backend/src/controllers/auth.controller.js - JWT authorization
quanLySP/backend/src/middleware/auth.middleware.js - JWT configuration
quanLySP/backend/src/config/jwt.config.js - Admin user management
quanLySP/backend/src/routes/user.routes.js
Catalog management
- Product routes
quanLySP/backend/src/routes/product.routes.js - Product operations
quanLySP/backend/src/controllers/product.controller.js
Persistence
- MySQL connection pool
quanLySP/backend/src/config/db.js - MySQL product database
Other components
- Visitor or admin
Connections 30
- Visitor or admin → Page routing: opens
quanLySP/frontend/src/App.jsx - Page routing → Session state: provides session
quanLySP/frontend/src/App.jsx - Page routing → Home and PDF export: routes to
quanLySP/frontend/src/App.jsx - Page routing → Sign in and register: routes to
quanLySP/frontend/src/App.jsx - Page routing → Product browsing: routes to
quanLySP/frontend/src/App.jsx - Page routing → Product detail: routes to
quanLySP/frontend/src/App.jsx - Page routing → Account profile: routes to
quanLySP/frontend/src/App.jsx - Page routing → Statistics: routes to
quanLySP/frontend/src/App.jsx - Session state → Authentication API client: calls
quanLySP/frontend/src/context/AuthContext.jsx - Sign in and register → Session state: uses session
quanLySP/frontend/src/pages/Login.jsx - Account profile → Session state: uses session
quanLySP/frontend/src/pages/Profile.jsx - Home and PDF export → Product API client: fetches products
quanLySP/frontend/src/pages/Home.jsx - Home and PDF export → PDF generator: generates PDF
quanLySP/frontend/src/pages/Home.jsx - PDF generator → Embedded font: embeds font
quanLySP/frontend/src/utils/pdfGenerator.js - Product browsing → Product API client: manages products
quanLySP/frontend/src/pages/Products.jsx - Product detail → Product API client: loads product
quanLySP/frontend/src/pages/ProductDetail.jsx - Statistics → Product API client: loads statistics data
quanLySP/frontend/src/pages/Statistics.jsx - Authentication API client → HTTP API service: sends auth requests
quanLySP/frontend/src/api/auth.js - Product API client → HTTP API service: sends product requests
quanLySP/frontend/src/api/products.js - Authentication routes → Authentication and PDF login: dispatches
quanLySP/backend/src/routes/auth.routes.js - Authentication routes → JWT authorization: protects profile route
quanLySP/backend/src/routes/auth.routes.js - Authentication and PDF login → MySQL connection pool: queries users
quanLySP/backend/src/controllers/auth.controller.js - Authentication and PDF login → JWT configuration: signs and verifies
quanLySP/backend/src/controllers/auth.controller.js - JWT authorization → JWT configuration: verifies tokens
quanLySP/backend/src/middleware/auth.middleware.js - Product routes → Product operations: dispatches
quanLySP/backend/src/routes/product.routes.js - Product routes → JWT authorization: guards admin routes
quanLySP/backend/src/routes/product.routes.js - Product operations → MySQL connection pool: queries products
quanLySP/backend/src/controllers/product.controller.js - Admin user management → JWT authorization: requires authentication
quanLySP/backend/src/routes/user.routes.js - Admin user management → MySQL connection pool: manages user records
quanLySP/backend/src/routes/user.routes.js - MySQL connection pool → MySQL product database: connects to