How williamszatt/s.g.p.c works
ComercioOS is a web-based SaaS for small-shop operations, with tenant-scoped accounts and workflows for sales, inventory, clients, and management results. Users enter through the web interface, authenticate, and reach role-sensitive operational pages; the API exposes authentication, client, inventory, sales, and dashboard routes backed by Prisma. The graph preserves the documented reporting and settings capabilities. Several page-to-API details and unsampled subsystems are known only from imports or documentation, so uncertain links are omitted or marked dashed.
Main entry points: App.tsx Page router · prisma.ts Prisma access · server.ts HTTP API · auth.ts Account routes
Components 24
Web application
- Page router
Front-end/src/App.tsx - Session context
Front-end/src/contexts/AppContext.tsx - API client
Front-end/src/lib/api.ts - Public home
Front-end/src/pages/Home.tsx - Authenticated shell
Front-end/src/components/AuthLayout.tsx
Identity and access
- Account pages
Front-end/src/pages/Register.tsx - Account routes
Back-end/src/routes/auth.ts - Token authorization
Back-end/src/middleware/auth.ts - Password reset
Back-end/src/services/password-reset.ts
Shop operations
- Client records
Front-end/src/pages/Clients.tsx - Point of sale
Front-end/src/pages/POSPage.tsx - Stock management
Front-end/src/pages/StockPage.tsx - Client routes
Back-end/src/routes/clients.ts - Inventory routes
Back-end/src/routes/inventory.ts - Sales routes
Back-end/src/routes/sales.ts
Management
- Dashboard
Front-end/src/pages/Dashboard.tsx - Reports
Front-end/src/pages/Reports.tsx - Settings
Front-end/src/pages/Settings.tsx - Notifications
Front-end/src/lib/notifications.ts - Dashboard routes
Back-end/src/routes/dashboard.ts
API and persistence
- HTTP API
Back-end/src/server.ts - Prisma access
Back-end/src/lib/prisma.ts - Tenant data store
Back-end/prisma/schema.prisma
Other components
- Shop user
Connections 30
- Shop user → Page router: uses
README.md - Page router → Session context: provides state
Front-end/src/App.tsx - Page router → Public home: routes to
Front-end/src/App.tsx - Page router → Account pages: routes to
Front-end/src/App.tsx - Page router → Dashboard: routes to
Front-end/src/App.tsx - Page router → Client records: routes to
Front-end/src/App.tsx - Page router → Stock management: routes to
Front-end/src/App.tsx - Page router → Point of sale: routes to
Front-end/src/App.tsx - Page router → Reports: routes to
Front-end/src/App.tsx - Page router → Settings: routes to
Front-end/src/App.tsx - Session context → API client: calls
Front-end/src/contexts/AppContext.tsx - Authenticated shell → Notifications: loads
Front-end/src/components/AuthLayout.tsx - API client → HTTP API: sends HTTP
- HTTP API → Account routes: mounts
Back-end/src/server.ts - HTTP API → Client routes: mounts
Back-end/src/server.ts - HTTP API → Inventory routes: mounts
Back-end/src/server.ts - HTTP API → Sales routes: mounts
Back-end/src/server.ts - HTTP API → Dashboard routes: mounts
Back-end/src/server.ts - Account routes → Token authorization: uses
Back-end/src/routes/auth.ts - Account routes → Password reset: uses
Back-end/src/routes/auth.ts - Token authorization → Prisma access: checks user
Back-end/src/middleware/auth.ts - Token authorization → Tenant data store: reads identity
- Account routes → Prisma access: queries and writes
Back-end/src/routes/auth.ts - Client routes → Prisma access: queries and writes
Back-end/src/routes/clients.ts - Inventory routes → Prisma access: uses data access
Back-end/src/routes/inventory.ts - Sales routes → Prisma access: uses data access
Back-end/src/routes/sales.ts - Dashboard routes → Prisma access: uses data access
Back-end/src/routes/dashboard.ts - Prisma access → Tenant data store: persists records
- Notifications → API client: requests stock and sales
Front-end/src/lib/notifications.ts - Client records → Authenticated shell: renders within
Front-end/src/pages/Clients.tsx