How jordi7-7/pos-store works
This is a multi-tenant retail POS backend: users authenticate, select a branch and cash register, look up products, and run sales against cash sessions; the API also manages inventory, purchasing, customers, staff, media, and reports. Controllers dispatch commands and queries through Nest CQRS, while some controllers use TypeORM directly. The tree documents these feature areas, but excerpts show only selected controller and handler wiring; unsampled connections are not inferred.
Main entry points: data-source.ts Relational database · sales.controller.ts Sales and cash · auth.controller.ts Authentication · products.controller.ts Products and stock
Components 19
API and access
- Authentication
src/modules/auth/infrastructure/controllers/auth.controller.ts - Staff accounts
src/modules/users/infrastructure/controllers/users.controller.ts - Roles and permissions
src/modules/roles/infrastructure/controllers/roles.controller.ts
Catalog and inventory
- Products and stock
src/modules/products/infrastructure/controllers/products.controller.ts - Catalog handlers
src/modules/products/application
POS and purchasing
- Sales and cash
src/modules/sales/infrastructure/controllers/sales.controller.ts - Sales handlers
src/modules/sales/application - Purchasing
src/modules/purchases/infrastructure/controllers/purchases.controller.ts - Purchase handlers
src/modules/purchases/application
Store operations
- Branches
src/modules/branches/infrastructure/controllers/branches.controller.ts - Customers
src/modules/customers/infrastructure/controllers/customers.controller.ts - Reports
src/modules/reports/infrastructure/controllers/reports.controller.ts - Tenant settings
src/modules/tenants/infrastructure/controllers/tenants.controller.ts - Product media
src/modules/media/infrastructure/controllers/media.controller.ts
Shared infrastructure
- Object storage
- Relational database
src/config/data-source.ts - Redis service
src/common/redis/redis.service.ts - Tenant context
src/common/tenant/tenant.middleware.ts
Other components
- POS client
Connections 24
- POS client → Authentication: authenticates
- POS client → Products and stock: manages catalog
- POS client → Sales and cash: runs POS
- POS client → Purchasing: records purchases
- POS client → Customers: manages customers
- POS client → Reports: requests reports
- Authentication → Relational database: reads profile
- Authentication → Staff accounts: authenticates staff
- Staff accounts → Relational database: reads and writes
- Roles and permissions → Relational database: reads and writes
- Products and stock → Catalog handlers: dispatches commands and queries
- Sales and cash → Sales handlers: dispatches commands and queries
- Sales and cash → Relational database: queries records
- Purchasing → Purchase handlers: dispatches commands and queries
- Customers → Relational database: dispatches via CQRS
- Reports → Relational database: queries reports
- Branches → Relational database: queries branches
- Tenant settings → Relational database: manages tenant data
- Product media → Relational database: stores image records
- Product media → Object storage: uploads and deletes files
- Tenant context → POS client: sets tenant context
- Sales handlers → Relational database: stores session data
- Products and stock → Sales and cash: supplies POS lookup
- Redis service → Relational database: support integration