How dedsking/test-nutech works
This is an Express REST API for membership, profile management, service information, and account transactions. The principal flow is an HTTP request routed through authentication where required, handled by a controller, and fulfilled through models backed by MySQL. Transaction stages include balance lookup, top-up or service payment, and history retrieval. Profile-image uploads are handled by route-level Multer storage. Several model implementations and the README are unavailable, so uncertain database wiring is omitted.
Main entry points: index.js Route handlers · transactionController.js Transaction controller · auth.js Authentication model · membershipController.js Membership controller
Components 15
API routing
- Express server
server.js - Route handlers
routes/index.js
Membership
- JWT middleware
middleware/middlewareAuth.js - Membership controller
controller/membershipController.js - Authentication model
model/auth.js - User model
model/users.js - Profile uploads
routes/index.js
Service information
- Information controller
controller/informationController.js - Information model
model/information.js
Transactions and storage
- Transaction controller
controller/transactionController.js - Transaction model
model/transaction.js - Invoice generator
utils/generateInvoice.js - MySQL database
- MySQL connection pool
config/database.js
Other components
- API client
Connections 19
- API client → Express server: sends requests
- Express server → Route handlers: mounts routes
- Route handlers → Membership controller: dispatches membership
- Route handlers → Information controller: dispatches information
- Route handlers → Transaction controller: dispatches transactions
- Route handlers → JWT middleware: protects routes
- Route handlers → Profile uploads: stores uploaded files
- Membership controller → Authentication model: checks and registers
- Membership controller → User model: updates profiles
- Authentication model → MySQL connection pool: queries through
- MySQL connection pool → MySQL database: connects to
- Information controller → Authentication model: checks identity
- Information controller → Information model: fetches information
- Transaction controller → Authentication model: checks identity and balance
- Transaction controller → Information model: checks service
- Transaction controller → Transaction model: records and reads
- Transaction controller → User model: updates balance
- Transaction model → Invoice generator: generates invoice
- Transaction model → MySQL connection pool: queries through