How hertilan/kaizen-be works
Kaizen BE is an Express backend for a business-management portal. A client request enters through the API server and a domain route, then a controller performs domain operations and accesses persisted records through Prisma; selected routes also apply authentication. The visible capabilities include general commerce, finance, supplier distribution, engineering project management, tasks, notifications, and exports. Controller and route files establish these domains, but only some controller implementations were sampled, so internal links are shown only where supported.
Main entry points: prisma.ts Prisma client · index.ts Express API · productController.ts Commerce controllers · financeRoutes.ts Finance routes
Components 24
API platform
- Express API
src/index.ts - Auth routes
src/routes/authRoutes.ts - Authentication
src/controllers/authController.ts - Auth middleware
src/middlewares/auth.ts - User management
src/controllers/userController.ts - Prisma client
src/prisma.ts
Commerce operations
- Commerce routes
src/routes/productRoutes.ts - Commerce controllers
src/controllers/productController.ts - Purchasing
src/controllers/purchaseController.ts - Inventory
src/controllers/stockController.ts - Invoicing
src/controllers/invoiceController.ts - Payments
src/controllers/paymentController.ts
Finance
- Finance routes
src/routes/financeRoutes.ts - Finance and reports
src/controllers/financeController.ts
Specialty operations
- Distribution routes
src/routes/sdRoutes.ts - Supplier distribution
src/controllers/sdController.ts - Engineering routes
src/routes/engRoutes.ts - Engineering projects
src/controllers/engController.ts - Task management
src/controllers/taskController.ts
Shared services
- Notifications
src/services/notificationService.ts - Exports
src/controllers/exportController.ts - Export generation
src/services/exportService.ts
Other components
- API client
- PostgreSQL database
Connections 30
- API client → Express API: sends requests
- Express API → Auth routes: mounts auth
- Express API → Commerce routes: mounts commerce
- Express API → Finance routes: mounts finance
- Express API → Distribution routes: mounts distribution
- Express API → Engineering routes: mounts engineering
- Express API → Prisma client: initializes client
- Auth routes → Authentication: dispatches
- Commerce routes → Commerce controllers: dispatches
- Finance routes → Auth middleware: authenticates
- Finance routes → Finance and reports: dispatches
- Distribution routes → Auth middleware: authenticates
- Distribution routes → Supplier distribution: dispatches
- Engineering routes → Auth middleware: authenticates
- Engineering routes → Engineering projects: dispatches
- Commerce controllers → Purchasing: delegates
- Commerce controllers → Inventory: delegates
- Commerce controllers → Invoicing: delegates
- Commerce controllers → Payments: delegates
- Task management → Notifications: creates alerts
- Engineering projects → Notifications: uses service
- Exports → Export generation: generates files
- Authentication → Prisma client: accesses records
- User management → Prisma client: accesses records
- Finance and reports → Prisma client: reads and writes
- Supplier distribution → Prisma client: reads and writes
- Engineering projects → Prisma client: reads and writes
- Task management → Prisma client: reads and writes
- Notifications → Prisma client: reads and writes
- Prisma client → PostgreSQL database: queries