How samgorax/sleepos works
SleepOS is a mattress and sleep-commerce platform with customer retail, AI guidance, B2B procurement, tender analysis, and administration capabilities. Its principal customer workflow is product discovery followed by account, order, and post-purchase services; the README also documents distinct AI, procurement, tender, and admin branches. The backend exposes those domains through a FastAPI router, while a separately hosted AI service accepts workflow requests. Frontend-to-backend wiring is not established by the excerpts, so no such edge is asserted; several domain implementations are represented at their service paths based on the tree and README.
Main entry points: router.py API routing · orders.py Orders API · auth.py Authentication API · products.py Product API
Components 34
Customer experience
- Retail and sleep pages
frontend/src/components - B2B workspace
frontend/src/components/b2b/b2b-solutions-page.tsx - Tender solutions
frontend/src/app/(marketing)/tender-solutions/page.tsx - Customer dashboard
frontend/src/components/customer/customer-dashboard-page.tsx - Admin dashboard
frontend/src/components/admin/admin-dashboard-page.tsx
Platform API
- API routing
backend/app/api/router.py - Authentication API
backend/app/api/v1/endpoints/auth.py - Product API
backend/app/api/v1/endpoints/products.py - Engagement API
backend/app/api/v1/endpoints/engagement.py - Orders API
backend/app/api/v1/endpoints/orders.py - B2B API
backend/app/api/v1/endpoints/b2b.py - Tender API
backend/app/api/v1/endpoints/tenders.py - Warranty API
backend/app/api/v1/endpoints/warranties.py - Admin API
backend/app/api/v1/endpoints/admin.py - Content API
backend/app/api/v1/endpoints/content.py - Identity and tokens
backend/app/services/auth/auth_service.py - Catalog service
backend/app/services/product_service.py - Engagement service
backend/app/services/engagement_service.py - Order service
backend/app/services/order_service.py - B2B procurement
backend/app/services/b2b_service.py - Tender analysis
backend/app/services/tender_service.py - Warranty lifecycle
backend/app/services/warranty_service.py - Admin operations
backend/app/services/admin_service.py - Content service
backend/app/services/content_service.py - AI API
backend/app/api/v1/endpoints/ai.py
AI workflows
- AI orchestrator
backend/app/services/ai/client.py - AI workflow API
ai-services/app/main.py - Workflow registry
ai-services/app/workflows/registry.py - Mock provider
ai-services/app/providers/mock.py
External services
- Payment service
backend/app/services/payments/razorpay_service.py - Razorpay
Other components
- Customer
- Procurement user
- Admin
Connections 29
- Customer → Retail and sleep pages: browses
README.md - Customer → Customer dashboard: uses
README.md - Procurement user → B2B workspace: uses
README.md - Procurement user → Tender solutions: reviews tenders
README.md - Admin → Admin dashboard: manages
README.md - API routing → Authentication API: routes
backend/app/api/router.py - API routing → Product API: routes
backend/app/api/router.py - API routing → Engagement API: routes
backend/app/api/router.py - API routing → Orders API: routes
backend/app/api/router.py - API routing → B2B API: routes
backend/app/api/router.py - API routing → Tender API: routes
backend/app/api/router.py - API routing → Warranty API: routes
backend/app/api/router.py - API routing → Admin API: routes
backend/app/api/router.py - API routing → Content API: routes
backend/app/api/router.py - Authentication API → Identity and tokens: delegates to
backend/app/api/v1/endpoints/auth.py - Product API → Catalog service: delegates to
backend/app/api/v1/endpoints/products.py - Engagement API → Engagement service: delegates to
backend/app/api/v1/endpoints/engagement.py - Orders API → Order service: delegates to
backend/app/api/v1/endpoints/orders.py - Orders API → Payment service: creates payments
backend/app/api/v1/endpoints/orders.py - Payment service → Razorpay: creates orders
backend/app/services/payments/razorpay_service.py - B2B API → B2B procurement: delegates to
backend/app/api/v1/endpoints/b2b.py - Tender API → Tender analysis: delegates to
backend/app/api/v1/endpoints/tenders.py - Warranty API → Warranty lifecycle: delegates to
backend/app/api/v1/endpoints/warranties.py - Admin API → Admin operations: delegates to
backend/app/api/v1/endpoints/admin.py - Content API → Content service: delegates to
backend/app/api/v1/endpoints/content.py - AI API → AI orchestrator: calls
backend/app/api/v1/endpoints/ai.py - AI orchestrator → AI workflow API: posts workflow
backend/app/services/ai/client.py - AI workflow API → Workflow registry: dispatches
ai-services/app/main.py - Workflow registry → Mock provider: runs
ai-services/app/workflows/registry.py