How wallyway/airlytycs works
1. This is a Next.js App Router application with a clear split between public marketing, client checkout, and protected back-office areas. The top-level app/ tree contains route groups for the protected console (app/(protected)/*), public auth pages, a landing page, and a client shopping flow.
2. The main user-facing surfaces are:
- app/landing and app/page.tsx for the public marketing entry point
- app/login, app/signup, and app/login-protected for authentication entry points
- app/cliente/* for the customer shopping/cart/order experience
- app/(protected)/* for internal operational views such as dashboard, products, inventory, sales, customers, suppliers, and movements
3. The protected area is organized as a single shell with app/(protected)/layout.tsx, which likely provides the shared authenticated UI chrome. Supporting layout pieces live in components/layout/ with Header and Sidebar, indicating a dashboard-style navigation boundary around the internal modules.
4. Business functionality is split by domain into feature components under components/:
- components/dashboard for KPI and chart visualizations
- components/clientes, components/productos, components/proveedores, components/inventario, components/movimientos, components/ventas for table- and chart-based operational views
- components/client for the storefront/cart/checkout flow
- components/auth for admin/client sign-in and sign-up forms
- components/landing for public promotional sections and pricing content
5. Data access is centralized in lib/queries/, with one module per business entity (clientes, inventario, movimientos, productos, proveedores, ventas). This suggests the UI does not talk directly to the database; instead, feature pages consume these query helpers as the main data boundary.
6. Supabase is the backend/data platform for the app. The repo includes separate browser and server clients (lib/supabase-browser.ts, lib/supabase.ts, and lib/supabase/server.ts) plus middleware support in lib/supabase/middleware.ts. That structure implies server-side session handling for protected routes and browser-side access where needed in client flows.
7. The API layer is small but important: app/api/client/signup/route.ts, app/api/client/checkout/route.ts, and app/api/admin/create/route.ts. These routes likely handle privileged mutations and workflow orchestration that the UI should not perform directly, such as account creation, checkout submission, and initial admin provisioning.
8. The client checkout flow is stateful and partially local. lib/clientCart.ts indicates a dedicated cart state/utility layer, while components/client/CartPageClient.tsx, CartPanel.tsx, CheckoutModal.tsx, and DeliveryAnimation.tsx form the interactive shopping experience before/after the API submission step.
9. Public and internal UI are built from a shared design system in components/ui/. The presence of components such as dialog, select, table, tabs, sonner, chart, and world-map indicates the app uses composable primitives for consistent dashboard, form, and visualization patterns rather than ad hoc styling per screen.
10. components.json, app/globals.css, postcss.config.mjs, and next.config.ts indicate a Tailwind/shadcn-style frontend stack. This affects architecture mainly by making UI composition the dominant pattern and by centralizing visual behavior in reusable primitives rather than page-specific CSS.
11. types/index.ts and lib/utils.ts act as shared cross-cutting helpers/types, reducing duplication across feature modules. These shared layers sit between the domain queries and the feature components.
12. proxy.ts and the Supabase middleware files point to route-level access control and session propagation as an important architectural boundary. In practice, the app’s request flow is: browser hits a route, middleware/proxy determines access, authenticated pages render through the protected layout, and data is fetched via query helpers or API routes backed by Supabase.
13. The repo also contains non-runtime infrastructure for development and consistency: .opencode/ agent and skill definitions, AGENTS.md, and skills-lock.json. These do not affect product runtime, but they do indicate the repository is set up with strong AI-assisted engineering workflows and project-specific conventions.
Main entry points: (protected)/layout.tsx Protected shell · app/layout.tsx Next app · productos.ts Queries · button.tsx UI primitives
Components 21
App surfaces
Route-level entry points and protected/internal areas.
- Next app · Root application shell and route composition.
app/layout.tsx - Landing · Marketing entry point and homepage routes.
app/page.tsx - Auth entry · Login and signup pages for admins and clients.
app/login/page.tsx - Client flow · Customer cart and order confirmation experience.
app/cliente/carrito/page.tsx - Protected shell · Shared authenticated UI chrome for internal modules.
app/(protected)/layout.tsx - Dashboard · Internal KPI and overview page.
app/(protected)/dashboard/page.tsx - Catalog · Protected product, inventory, supplier, customer, and movement screens.
app/(protected)/productos/page.tsx - Sales · Protected sales reporting and management screen.
app/(protected)/ventas/page.tsx - API routes · Privileged mutation endpoints for signup, checkout, and admin creation.
app/api/client/checkout/route.ts
Feature components
Domain UI components grouped by product area.
- Landing UI · Public promotional sections, pricing, navigation, and scrollytelling.
components/landing/PricingSection.tsx - Auth forms · Admin and client sign-in/sign-up cards and forms.
components/auth/AdminLoginCard.tsx - Storefront UI · Cart, checkout modal, product showcase, and delivery animation.
components/client/CartPageClient.tsx - Dashboard widgets · KPI cards and chart-driven dashboard visualizations.
components/dashboard/DashboardCharts.tsx - Domain tables · Customers, products, inventory, movements, sales, and supplier tables/charts.
components/productos/ProductosTable.tsx
Data layer
Query helpers, cart state, and Supabase clients.
- Queries · Entity-specific query helpers for the operational domains.
lib/queries/productos.ts - Supabase clients · Browser, server, and middleware Supabase access plus session propagation.
lib/supabase.ts - Cart state · Client-side cart and checkout state utilities.
lib/clientCart.ts
Shared UI
Reusable layout, primitives, and cross-cutting helpers.
- Nav shell · Shared header and sidebar used around protected areas.
components/layout/Header.tsx - UI primitives · Reusable shadcn-style controls, tables, dialogs, charts, and map components.
components/ui/button.tsx - Shared helpers · General utilities and shared TypeScript types.
lib/utils.ts
Ops
Developer workflow and repository conventions.
- Repo ops · Agent, skill, and project guidance files that shape repository conventions.
AGENTS.md
Connections 29
- Next app → Landing: routes · App router exposes the public landing entry.
- Next app → Auth entry: routes · App router exposes login and signup pages.
- Next app → Client flow: routes · App router exposes the customer shopping flow.
- Next app → Protected shell: routes · Protected section is mounted under the app router.
- Protected shell → Dashboard: wraps · Shared authenticated shell surrounds the dashboard.
- Protected shell → Catalog: wraps · Shared authenticated shell surrounds operational modules.
- Protected shell → Sales: wraps · Shared authenticated shell surrounds sales views.
- Protected shell → Nav shell: uses · Protected shell likely composes header and sidebar chrome.
- Landing → Landing UI: renders · Landing page is built from marketing feature components.
- Auth entry → Auth forms: renders · Auth pages render login and signup forms.
- Client flow → Storefront UI: renders · Client pages render storefront and checkout components.
- Dashboard → Dashboard widgets: renders · Dashboard page is composed from KPI and chart widgets.
- Catalog → Domain tables: renders · Operational pages use domain-specific tables and charts.
- Sales → Domain tables: renders · Sales page uses the shared operational domain views.
- Dashboard widgets → UI primitives: builds on · Analytics widgets rely on shared UI primitives.
- Domain tables → UI primitives: builds on · Domain tables and charts rely on shared UI primitives.
- Landing UI → UI primitives: builds on · Public marketing sections use the shared design system.
- Auth forms → UI primitives: builds on · Auth forms use shared form and feedback primitives.
- Storefront UI → Cart state: uses · Checkout UI is backed by dedicated cart state utilities.
- Storefront UI → API routes: submits to · Checkout flow hands off to API routes for privileged actions.
- API routes → Supabase clients: writes via · API handlers delegate mutations to Supabase.
- Queries → Supabase clients: reads via · Domain query helpers are the main read boundary to Supabase.
- Landing → Queries: consumes · Public-facing pages can consume shared data helpers where needed.
- Dashboard → Queries: consumes · Dashboard view reads operational data through query helpers.
- Catalog → Queries: consumes · Operational screens consume entity query modules.
- Auth entry → API routes: posts to · Signup and provisioning flows go through route handlers.
- Protected shell → Supabase clients: gated by · Session propagation and middleware protect internal routes.
- Shared helpers → Queries: supports · Utilities and shared types support the domain data layer.
- Repo ops → Next app: guides · Repository conventions shape the application structure.