How dev-wyp/lwal-kuu works
Lwal Kuu is a multi-tenant wholesale and shop-management SaaS, with a separate marketing workspace and platform-admin experience. The main shop workflow spans catalog and supplier purchasing, stock management, POS invoicing, customer payments and credit ledgers, then reporting. React routes expose these workflows; organization/auth contexts scope users, while Supabase provides the application backend. README-documented capabilities are included even where their implementation was not sampled. Edges are limited to route references, indexed imports, sampled calls, or README statements; unsampled links are omitted.
Main entry points: index.tsx Application routes · OrgContext.tsx Organization context · supabase.ts Supabase client · SalesPage.tsx POS and invoices
Components 27
Shop Operations
- Shop dashboard
src/modules/dashboard/DashboardPage.tsx - Product catalog
src/modules/products/ProductsPage.tsx - Purchases and receiving
src/modules/purchases/PurchasesPage.tsx - Supplier accounts
src/modules/suppliers/SuppliersPage.tsx - Stock ledger
src/modules/inventory/InventoryPage.tsx - POS and invoices
src/modules/sales/SalesPage.tsx - Customer ledgers
src/modules/customers/CustomersPage.tsx - Customer payments
src/modules/payments/PaymentsPage.tsx - Expense tracking
src/modules/expenses/ExpensesPage.tsx - Business reports
src/modules/reports/ReportsPage.tsx
Tenant and SaaS
- Application routes
src/routes/index.tsx - Authentication
src/context/AuthContext.tsx - Organization context
src/context/OrgContext.tsx - Shop onboarding
src/modules/onboarding/OnboardingPage.tsx - Plan entitlements
src/modules/subscription/useEntitlements.ts - Platform administration
src/modules/platform/PlatformAdminPage.tsx
Marketing Workspace
- Marketing workspace
src/modules/marketing/hooks/useMarketingWorkspace.ts - Campaigns and content
src/modules/marketing/pages - Marketing AI
supabase/functions/marketing-ai/index.ts - Social account OAuth
supabase/functions/marketing-oauth/index.ts - Publishing jobs
supabase/functions/marketing-jobs/index.ts - Publish worker
supabase/functions/_shared/publish-worker.ts - Social provider adapters
supabase/functions/_shared/providers.ts
Platform Services
- Supabase client
src/lib/supabase.ts - Supabase backend
- Social platforms
Other components
- Shop user
Connections 36
- Shop user → Application routes: opens app
src/routes/index.tsx - Application routes → Authentication: provides auth
src/App.tsx - Application routes → Organization context: provides organization
src/App.tsx - Application routes → Shop onboarding: routes onboarding
src/routes/index.tsx - Application routes → Shop dashboard: routes dashboard
src/routes/index.tsx - Application routes → Product catalog: routes catalog
src/routes/index.tsx - Application routes → Purchases and receiving: routes purchasing
src/routes/index.tsx - Application routes → Stock ledger: routes inventory
src/routes/index.tsx - Application routes → POS and invoices: routes POS
src/routes/index.tsx - Application routes → Customer ledgers: routes customers
src/routes/index.tsx - Application routes → Supplier accounts: routes suppliers
src/routes/index.tsx - Application routes → Customer payments: routes payments
src/routes/index.tsx - Application routes → Expense tracking: routes expenses
src/routes/index.tsx - Application routes → Business reports: routes reports
src/routes/index.tsx - Application routes → Platform administration: routes administration
src/routes/index.tsx - Authentication → Supabase client: queries auth
src/context/AuthContext.tsx - Organization context → Authentication: reads identity
src/context/OrgContext.tsx - Organization context → Supabase client: loads membership
src/context/OrgContext.tsx - Plan entitlements → Organization context: reads organization
src/modules/subscription/useEntitlements.ts - Plan entitlements → Supabase client: queries limits
src/modules/subscription/useEntitlements.ts - POS and invoices → Customer ledgers: records credit sales
README.md - Purchases and receiving → Stock ledger: increments stock
README.md - POS and invoices → Stock ledger: records movements
README.md - Customer payments → Customer ledgers: allocates receipts
README.md - POS and invoices → Business reports: feeds sales metrics
README.md - Application routes → Campaigns and content: routes marketing
src/routes/index.tsx - Campaigns and content → Marketing workspace: loads workspace
src/modules/marketing/hooks/useMarketingWorkspace.ts - Marketing workspace → Organization context: scopes workspace
src/modules/marketing/hooks/useMarketingWorkspace.ts - Marketing workspace → Supabase client: loads workspace data
src/modules/marketing/hooks/useMarketingWorkspace.ts - Campaigns and content → Marketing AI: requests AI features
- Campaigns and content → Social account OAuth: connects accounts
- Publishing jobs → Publish worker: dispatches jobs
supabase/functions/marketing-jobs/index.ts - Publish worker → Social provider adapters: selects adapter
supabase/functions/_shared/publish-worker.ts - Publish worker → Supabase backend: claims and updates jobs
supabase/functions/_shared/publish-worker.ts - Publish worker → Social platforms: publishes content
supabase/functions/_shared/publish-worker.ts - Supabase client → Supabase backend: reads and writes
src/lib/supabase.ts