How antonious-sameh/tahoonaaaaback works
System 1 is a single-shop inventory, point-of-sale, and bookkeeping backend built with Express and MongoDB. A client request enters the shared API app, is routed to an endpoint and its domain service, and returns operational data or reports; authentication protects shop operations. Major documented areas include inventory, people and balances, sales and purchases, returns, cashbox and expenses, reporting, settings, uploads, and audit/activity records. Source excerpts show app wiring, authentication, person routing, and reporting; some domain links below rely on README documentation and the source index.
Main entry points: index.js API Routes · db.js MongoDB · auditLog.service.js Audit Trail · auth.service.js Auth and Devices
Components 22
API and Routing
- Express App
src/app.js - API Routes
src/routes/index.js - Auth Routes
src/routes/auth.route.js - Auth Controller
src/controllers/auth.controller.js
Shop Access
- Auth and Devices
src/services/auth.service.js - Shop Credentials
src/models/ShopAuth.js - Device Sessions
src/models/DeviceSession.js
Commerce Operations
- Products and Inventory
src/services/product.service.js - Customers and Suppliers
src/services/personService.js - Sales and Returns
src/services/sale.service.js - Purchases and Returns
src/services/purchase.service.js
Finance and Insights
- Customer Settlements
src/services/customerPayment.service.js - Supplier Settlements
src/services/supplierPayment.service.js - Cashbox and Expenses
src/services/cashbox.service.js - Reports
src/services/reports.service.js
Persistence and Support
- Shop Settings
src/services/settings.service.js - Product Image Uploads
src/services/upload.service.js - Activity Feed
src/services/activityLog.service.js - Audit Trail
src/services/auditLog.service.js - MongoDB
src/config/db.js
Other components
- Shop Client
- Cloudinary
Connections 33
- Shop Client → Express App: sends request
- Express App → API Routes: mounts API
src/app.js - API Routes → Auth Routes: mounts auth
src/routes/index.js - Auth Routes → Auth Controller: dispatches
src/routes/auth.route.js - Auth Controller → Auth and Devices: calls
src/controllers/auth.controller.js - Auth and Devices → Shop Credentials: reads and writes
src/services/auth.service.js - Auth and Devices → Device Sessions: manages sessions
src/services/auth.service.js - API Routes → Products and Inventory: routes inventory
src/routes/index.js - API Routes → Customers and Suppliers: routes people
src/routes/index.js - API Routes → Sales and Returns: routes sales
src/routes/index.js - API Routes → Purchases and Returns: routes purchases
src/routes/index.js - API Routes → Customer Settlements: routes payments
src/routes/index.js - API Routes → Supplier Settlements: routes settlements
src/routes/index.js - API Routes → Cashbox and Expenses: routes cashbox
src/routes/index.js - API Routes → Reports: routes reports
src/routes/index.js - API Routes → Shop Settings: routes settings
src/routes/index.js - API Routes → Product Image Uploads: routes uploads
src/routes/index.js - API Routes → Activity Feed: routes activity
src/routes/index.js - API Routes → Audit Trail: routes audit
src/routes/index.js - Products and Inventory → MongoDB: persists inventory
- Customers and Suppliers → MongoDB: persists people
src/services/personService.js - Sales and Returns → MongoDB: records transactions
- Purchases and Returns → MongoDB: records transactions
- Customer Settlements → MongoDB: records settlements
- Supplier Settlements → MongoDB: records settlements
- Cashbox and Expenses → MongoDB: stores cash activity
- Reports → MongoDB: aggregates records
src/services/reports.service.js - Product Image Uploads → Cloudinary: requests signature
- Activity Feed → MongoDB: records activity
src/services/activityLog.service.js - Audit Trail → MongoDB: records audit events
src/services/auditLog.service.js - Auth and Devices → Audit Trail: records auth events
src/services/auth.service.js - Sales and Returns → Audit Trail: records mutations
- Purchases and Returns → Audit Trail: records mutations