# rodrigonunes2004/catercalcpro architecture

> Architecture diagram of the GitHub repository rodrigonunes2004/catercalcpro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rodrigonunes2004/catercalcpro
- Repository: https://github.com/rodrigonunes2004/catercalcpro

## Overview

CaterCalc Pro is a catering-management web application. Users enter through the React app, authenticate, and use recipe, menu, event, inventory, and prep-list workflows; the server exposes corresponding API routes backed by shared schemas and database storage. The README also documents shopping lists, cost analysis, analytics, and billing, so those capabilities remain visible even where their implementation was not sampled. Edges follow excerpts, the source index, or README statements; uncertain route-to-storage wiring is omitted.

Main entry points: [`src/App.tsx`](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/App.tsx) (Routes and providers), [`server/routes/index.ts`](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/index.ts) (Route registry), [`server/storage.ts`](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/storage.ts) (Database operations), [`server/routes/auth.ts`](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/auth.ts) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["Routes and providers<br/>[App.tsx]"]
  node_authui["Authentication state<br/>[AuthContext.tsx]"]
  node_ui["UI primitives"]
end

subgraph group_planning["Catering workflows"]
  node_recipeui["Recipe management<br/>[RecipeManager.tsx]"]
  node_menuui["Menu management<br/>[MenuManager.tsx]"]
  node_eventui["Event planning<br/>[EventsPage.tsx]"]
  node_inventoryui["Inventory management<br/>[InventoryPage.tsx]"]
  node_prepui["Prep and shopping lists"]
  node_analyticsui["Analytics<br/>[AnalyticsPage.tsx]"]
  node_billingui["Billing<br/>[BillingPage.tsx]"]
end

subgraph group_server["API and access"]
  node_api["Serverless API entry<br/>[index.ts]"]
  node_routes["Route registry<br/>[index.ts]"]
  node_authroutes["Authentication routes<br/>[auth.ts]"]
  node_recipeapi["Recipe and menu routes<br/>[recipes.ts]"]
  node_prepapi["Prep-list routes<br/>[prepLists.ts]"]
  node_billingapi["Billing routes<br/>[billing.ts]"]
  node_authlogic["Token and password logic<br/>[auth.ts]"]
end

subgraph group_data["Persistence and services"]
  node_pricing["Pricing engine<br/>[pricingEngine.ts]"]
  node_storage[("Database operations<br/>[storage.ts]")]
  node_schema["Shared data schema<br/>[schema.ts]"]
end

node_user(("Caterer"))

node_user -->|"uses"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"provides"| node_authui
node_app -->|"routes to"| node_recipeui
node_app -->|"routes to"| node_menuui
node_app -->|"routes to"| node_eventui
node_app -->|"routes to"| node_inventoryui
node_app -->|"routes to"| node_prepui
node_app -->|"routes to"| node_analyticsui
node_app -->|"routes to"| node_billingui
node_recipeui -->|"renders with"| node_ui
node_menuui -->|"renders with"| node_ui
node_api -->|"registers"| node_routes
node_routes -->|"registers"| node_authroutes
node_routes -->|"registers"| node_recipeapi
node_routes -->|"registers"| node_prepapi
node_routes -->|"registers"| node_billingapi
node_authroutes -->|"uses"| node_authlogic
node_authroutes -->|"uses auth storage"| node_storage
node_prepapi -.->|"uses"| node_storage
node_recipeapi -.->|"uses"| node_storage
node_pricing -->|"reads data"| node_storage
node_storage -->|"uses schema"| node_schema
node_user -->|"manages recipes"| node_recipeui
node_user -->|"plans events"| node_eventui
node_user -->|"tracks stock"| node_inventoryui
node_user -->|"generates lists"| node_prepui
node_user -->|"reviews performance"| node_analyticsui
node_user -.->|"manages plan"| node_billingui

click node_entry "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/main.tsx"
click node_app "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/App.tsx"
click node_authui "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/contexts/AuthContext.tsx"
click node_recipeui "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/components/RecipeManager.tsx"
click node_menuui "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/components/MenuManager.tsx"
click node_eventui "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/pages/EventsPage.tsx"
click node_inventoryui "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/pages/InventoryPage.tsx"
click node_prepui "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/components/PrepListGenerator.tsx"
click node_analyticsui "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/pages/AnalyticsPage.tsx"
click node_billingui "https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/pages/BillingPage.tsx"
click node_ui "https://github.com/rodrigonunes2004/catercalcpro/tree/master/src/components/ui"
click node_api "https://github.com/rodrigonunes2004/catercalcpro/blob/master/api/index.ts"
click node_routes "https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/index.ts"
click node_authroutes "https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/auth.ts"
click node_recipeapi "https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/recipes.ts"
click node_prepapi "https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/prepLists.ts"
click node_billingapi "https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/billing.ts"
click node_pricing "https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/services/pricingEngine.ts"
click node_storage "https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/storage.ts"
click node_schema "https://github.com/rodrigonunes2004/catercalcpro/blob/master/shared/schema.ts"
click node_authlogic "https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/lib/auth.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_app,node_authui,node_ui toneBlue
class node_recipeui,node_menuui,node_eventui,node_inventoryui,node_prepui,node_analyticsui,node_billingui toneAmber
class node_api,node_routes,node_authroutes,node_recipeapi,node_prepapi,node_billingapi,node_authlogic toneMint
class node_pricing,node_storage,node_schema toneRose
class node_user toneIndigo
```

## Components

### Web application

- [React entry](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/main.tsx): `src/main.tsx`
- [Routes and providers](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/App.tsx): `src/App.tsx`
- [Authentication state](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [UI primitives](https://github.com/rodrigonunes2004/catercalcpro/tree/master/src/components/ui): `src/components/ui`

### Catering workflows

- [Recipe management](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/components/RecipeManager.tsx): `src/components/RecipeManager.tsx`
- [Menu management](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/components/MenuManager.tsx): `src/components/MenuManager.tsx`
- [Event planning](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/pages/EventsPage.tsx): `src/pages/EventsPage.tsx`
- [Inventory management](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/pages/InventoryPage.tsx): `src/pages/InventoryPage.tsx`
- [Prep and shopping lists](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/components/PrepListGenerator.tsx): `src/components/PrepListGenerator.tsx`
- [Analytics](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/pages/AnalyticsPage.tsx): `src/pages/AnalyticsPage.tsx`
- [Billing](https://github.com/rodrigonunes2004/catercalcpro/blob/master/src/pages/BillingPage.tsx): `src/pages/BillingPage.tsx`

### API and access

- [Serverless API entry](https://github.com/rodrigonunes2004/catercalcpro/blob/master/api/index.ts): `api/index.ts`
- [Route registry](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/index.ts): `server/routes/index.ts`
- [Authentication routes](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/auth.ts): `server/routes/auth.ts`
- [Recipe and menu routes](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/recipes.ts): `server/routes/recipes.ts`
- [Prep-list routes](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/prepLists.ts): `server/routes/prepLists.ts`
- [Billing routes](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/routes/billing.ts): `server/routes/billing.ts`
- [Token and password logic](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/lib/auth.ts): `server/lib/auth.ts`

### Persistence and services

- [Pricing engine](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/services/pricingEngine.ts): `server/services/pricingEngine.ts`
- [Database operations](https://github.com/rodrigonunes2004/catercalcpro/blob/master/server/storage.ts): `server/storage.ts`
- [Shared data schema](https://github.com/rodrigonunes2004/catercalcpro/blob/master/shared/schema.ts): `shared/schema.ts`

### Other components

- **Caterer**

## Connections

- Caterer → React entry: uses (evidence: `README.md`)
- React entry → Routes and providers: renders (evidence: `src/main.tsx`)
- Routes and providers → Authentication state: provides (evidence: `src/App.tsx`)
- Routes and providers → Recipe management: routes to (evidence: `src/App.tsx`)
- Routes and providers → Menu management: routes to (evidence: `src/App.tsx`)
- Routes and providers → Event planning: routes to (evidence: `src/App.tsx`)
- Routes and providers → Inventory management: routes to (evidence: `src/App.tsx`)
- Routes and providers → Prep and shopping lists: routes to (evidence: `src/App.tsx`)
- Routes and providers → Analytics: routes to (evidence: `src/App.tsx`)
- Routes and providers → Billing: routes to (evidence: `src/App.tsx`)
- Recipe management → UI primitives: renders with (evidence: `src/components/RecipeManager.tsx`)
- Menu management → UI primitives: renders with (evidence: `src/components/MenuManager.tsx`)
- Serverless API entry → Route registry: registers (evidence: `api/index.ts`)
- Route registry → Authentication routes: registers (evidence: `server/routes/index.ts`)
- Route registry → Recipe and menu routes: registers (evidence: `server/routes/index.ts`)
- Route registry → Prep-list routes: registers (evidence: `server/routes/index.ts`)
- Route registry → Billing routes: registers (evidence: `server/routes/index.ts`)
- Authentication routes → Token and password logic: uses (evidence: `server/routes/auth.ts`)
- Authentication routes → Database operations: uses auth storage
- Prep-list routes → Database operations: uses
- Recipe and menu routes → Database operations: uses
- Pricing engine → Database operations: reads data (evidence: `server/services/pricingEngine.ts`)
- Database operations → Shared data schema: uses schema (evidence: `server/storage.ts`)
- Caterer → Recipe management: manages recipes (evidence: `README.md`)
- Caterer → Event planning: plans events (evidence: `README.md`)
- Caterer → Inventory management: tracks stock (evidence: `README.md`)
- Caterer → Prep and shopping lists: generates lists (evidence: `README.md`)
- Caterer → Analytics: reviews performance (evidence: `README.md`)
- Caterer → Billing: manages plan
