How jojo-valentine/product-management works
This is a product-management web application. Its main workflow is managing products and categories: users search/filter and page through records, create or edit products with category assignments and images, and manage status; requests pass through Next.js API proxies to Express controllers and persistent storage. The README also documents Redis caching and Swagger. The sampled source confirms representative product/category flows and cache behavior; some UI-to-proxy and image-service wiring is inferred only at the subsystem level from the tree and README.
Main entry points: productController.ts Product operations · server.ts Express runtime · categoryController.ts Category operations · index.ts API routes
Components 26
Web client
- Catalog pages
client/app/(main)/products/page.tsx - Product forms
client/app/(main)/products/create/page.tsx - Category pages
client/app/(main)/categories/page.tsx - Dashboard
client/app/(main)/page.tsx - Next API proxies
client/app/api/products/route.ts - Image proxies
client/app/api/products/[id]/images/route.ts - Category proxies
client/app/api/categories/route.ts - Dashboard proxy
client/app/api/dashboard/route.ts
API and domain
- Express runtime
server/src/server.ts - API routes
server/src/routes/index.ts - Product operations
server/src/controllers/productController.ts - Category operations
server/src/controllers/categoryController.ts - Dashboard stats
server/src/controllers/dashboardController.ts - Request validation
server/src/validations/product.ts - Category lookup
server/src/services/CategoryService.ts - Product lookup
server/src/services/ProductService.ts - Product queries
server/src/repositories/productRepository.ts - Response resources
server/src/resources/ProductResource.ts - Image handling
server/src/controllers/productController.ts
Persistence and cache
- Catalog models
server/src/models/Associations.ts - Cache operations
server/src/services/CacheService.ts
Runtime integrations
- MySQL
server/src/config/database.ts - Redis
server/src/config/redis.ts - Uploaded files
- API documentation
server/src/config/swagger.ts
Other components
- Catalog manager
Connections 33
- Catalog manager → Catalog pages: browse catalog
- Catalog manager → Product forms: edit products
- Catalog manager → Category pages: manage categories
- Catalog manager → Dashboard: view stats
- Catalog pages → Next API proxies: request products
- Product forms → Next API proxies: submit products
- Product forms → Image proxies: upload images
- Category pages → Category proxies: request categories
- Dashboard → Dashboard proxy: request stats
- Next API proxies → Express runtime: forward requests
- Image proxies → Express runtime: forward images
- Category proxies → Express runtime: forward requests
- Dashboard proxy → Express runtime: forward request
- Express runtime → API routes: mount routes
- API routes → Product operations: dispatch product
- API routes → Category operations: dispatch category
- API routes → Dashboard stats: dispatch stats
- Product operations → Request validation: validate input
- Product operations → Category lookup: resolve categories
- Product operations → Product lookup: check product
- Product operations → Product queries: load relations
- Product operations → Catalog models: read and write
- Category operations → Category lookup: check category
- Category operations → Catalog models: read and write
- Product operations → Response resources: format response
- Category operations → Response resources: format response
- Product queries → Catalog models: query relations
- Catalog models → MySQL: persist records
- Product operations → Cache operations: update cache
- Category operations → Cache operations: update cache
- Cache operations → Redis: read and write
- Express runtime → API documentation: configure docs
- Image handling → Uploaded files: serve image files