How renan-bsf/crmsegredo works
Gestão Íntima is a private back office for a lingerie and intimate-wellness business. Its main workflow is for an authorized staff member to review the operation, record purchases and receive goods into batch-tracked stock, then register direct sales whose prices, costs, and stock effects are calculated server-side. The system also supports customer records, pricing simulations, partner-only financial reporting, and access/audit administration. The README documents capabilities beyond the sampled excerpts; those are included, but uncertain implementation-level wiring is omitted.
Main entry points: actions.ts Business actions · auth.ts Session authorization · db.ts Application database · queries.ts Operational queries
Components 26
Access and security
- Sign in
src/app/login/page.tsx - Auth and MFA
src/app/auth-actions.ts - Session authorization
src/lib/server/auth.ts - Session refresh
src/middleware.ts
Business operations
- Sales
src/app/(private)/vendas/page.tsx - Sale composer
src/components/sale-composer.tsx - Business actions
src/app/actions.ts - Customer records
src/app/(private)/clientes/page.tsx - Purchases and receipts
src/app/(private)/compras/page.tsx - Purchase entry
src/components/purchase-form.tsx - Purchase actions
src/app/purchase-actions.ts - Inventory
src/app/(private)/estoque/page.tsx - Stock rules
src/lib/stock.ts
Pricing
- Pricing calculator
src/app/(private)/calculadora/page.tsx - Pricing interface
src/components/pricing-calculator.tsx - Pricing actions
src/app/pricing-actions.ts - Pricing rules
src/lib/pricing.ts
Management and oversight
- Overview
src/app/(private)/page.tsx - Partner finances
src/app/(private)/financeiro/page.tsx - Access and audit
src/app/(private)/configuracoes/page.tsx
Server and persistence
- Purchase queries
src/lib/server/purchase-queries.ts - Operational queries
src/lib/server/queries.ts - Mutation support
src/lib/server/mutate.ts - Application database
src/lib/server/db.ts
Other components
- Staff member
- Supabase Auth
Connections 45
- Staff member → Sign in: signs in
- Sign in → Auth and MFA: submits credentials
- Auth and MFA → Supabase Auth: authenticates
- Auth and MFA → Application database: checks membership
- Staff member → Auth and MFA: sets up MFA
- Auth and MFA → Supabase Auth: enrolls or verifies
- Session refresh → Supabase Auth: refreshes claims
- Overview → Session authorization: requires session
- Overview → Operational queries: loads metrics
- Staff member → Sales: opens sales
- Sales → Session authorization: requires session
- Sales → Operational queries: loads sales
- Sale composer → Business actions: submits sale
- Business actions → Session authorization: checks permission
- Business actions → Mutation support: performs changes
- Business actions → Pricing rules: calculates amounts
- Business actions → Stock rules: applies stock rules
- Business actions → Application database: persists sale
- Customer records → Operational queries: loads customers
- Customer records → Business actions: submits changes
- Staff member → Purchases and receipts: records purchases
- Purchases and receipts → Purchase queries: loads records
- Purchase entry → Purchase actions: submits receipt
- Purchase actions → Session authorization: checks permission
- Purchase actions → Stock rules: receives stock
- Purchase actions → Application database: writes purchase
- Inventory → Operational queries: loads inventory
- Inventory → Business actions: submits stock changes
- Staff member → Pricing calculator: opens calculator
- Pricing calculator → Pricing interface: renders calculator
- Pricing interface → Pricing rules: simulates pricing
- Pricing interface → Pricing actions: saves or searches
- Pricing actions → Session authorization: checks permission
- Pricing actions → Application database: stores calculation
- Partner finances → Session authorization: requires partner role
- Partner finances → Operational queries: loads financials
- Partner finances → Business actions: records expenses
- Access and audit → Session authorization: requires admin role
- Access and audit → Application database: reads members and audit
- Access and audit → Business actions: updates access
- Operational queries → Application database: reads records
- Purchase queries → Application database: reads records
- Mutation support → Application database: writes records
- Session authorization → Supabase Auth: validates identity
- Session authorization → Application database: checks session and member