How gasdcoder07/pacifico-pi works
Pacífico POS is a web point-of-sale and business administration system. The principal workflow is staff authentication followed by product selection and cart-based checkout; the README also describes sales reporting, inventory, user, branch, and dashboard capabilities. The sampled code confirms login/session handling and selected API reads, but does not show the full checkout or most page-to-service wiring, so uncertain connections are omitted.
Main entry points: db.ts PostgreSQL data · supabase.ts Supabase auth · ProductCatalog.tsx Product catalog · useAuth.ts Auth session hook
Components 24
Authentication
- Login page
app/(auth)/login/page.tsx - Login form
features/auth/components/LoginForm.tsx - Auth session hook
features/auth/hooks/useAuth.ts - Auth service
features/auth/services/auth.service.ts - Login endpoint
app/api/auth/login/route.ts - Registration endpoints
app/api/auth/register/admin/route.ts
Point of Sale
- Sell page
app/(dashboard)/sell/page.tsx - Product catalog
features/sell/components/ProductCatalog.tsx - Product search
features/sell/components/ProductSearch.tsx - Cart panel
features/sell/components/CartPanel.tsx - Cart state
features/sell/store/cart-store.ts - Product service
features/sell/services/product.service.ts - Sales history
app/sales/page.tsx
Business Administration
- Dashboard
app/(dashboard)/dashboard/page.tsx - Inventory management
app/(dashboard)/inventory/page.tsx - Inventory endpoints
app/api/inventory/route.ts - User management
app/(dashboard)/users/page.tsx - User endpoints
app/api/usuarios/route.ts - Branch management
app/(dashboard)/branches/page.tsx - Branch endpoints
app/api/sucursales/route.ts
Backend and Data
- API client
shared/lib/axios.ts - PostgreSQL data
shared/lib/db.ts - Supabase auth
shared/lib/supabase.ts
Other components
- Staff member
Connections 28
- Staff member → Login page: opens
- Login page → Login form: renders
- Login form → Auth session hook: submits credentials
- Auth session hook → Auth service: calls login
- Auth service → API client: sends request
- API client → Login endpoint: posts credentials
- Login endpoint → Supabase auth: authenticates
- Login endpoint → PostgreSQL data: reads profile
- Auth session hook → Sell page: redirects after login
- Staff member → Sell page: uses POS
- Sell page → Product catalog: renders
- Product catalog → Product search: offers search
- Product catalog → Product service: loads products
- Product catalog → Cart state: adds selections
- Cart panel → Cart state: reads cart
- Staff member → Sales history: checks sales
- Staff member → Dashboard: views summary
- Staff member → Inventory management: manages stock
- Inventory endpoints → Supabase auth: validates token
- Inventory endpoints → PostgreSQL data: reads inventory
- Staff member → User management: manages users
- User endpoints → Supabase auth: validates token
- User endpoints → PostgreSQL data: reads profiles
- Staff member → Branch management: manages branches
- Branch endpoints → Supabase auth: validates token
- Branch endpoints → PostgreSQL data: reads branches
- Registration endpoints → Supabase auth: creates account
- Registration endpoints → PostgreSQL data: updates profile