# akhilll18/foyer-v1 architecture

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

- Interactive diagram: https://gitdiagram.com/akhilll18/foyer-v1
- Repository: https://github.com/akhilll18/foyer-v1

## Overview

1. **Project shape**
   - This is a **single-page React application** built with **TypeScript + Vite**.
   - The codebase is mostly frontend-only: routing, page composition, local state, and API calls for auth-related flows.

2. **App entry and composition**
   - `src/main.tsx` is the bootstrap point that mounts the app.
   - `src/App.tsx` is the top-level app shell, and `src/routes/AppRoutes.tsx` centralizes page routing.
   - The architecture is organized around **route-driven pages** rather than a deeply nested feature/module system.

3. **Routing and page boundaries**
   - `src/pages/` contains the main user-facing screens: Home, login/signup, account/profile, cart, orders, order tracking, favorites, policy/help pages, and menu-specific pages.
   - The route layer likely maps URL paths to these page components and separates public flows from authenticated/account flows.

4. **Reusable UI shell**
   - `src/components/` holds shared interface building blocks used across pages:
     - `Navbar`, `Footer`, `Layout`
     - `Cartbar`, `CategoryNavbar`
     - `MainCard`, `ProfileMenu`
   - These components form the common page chrome and reusable content patterns, keeping page files focused on screen logic.

5. **Menu/catalog domain**
   - The app appears to model a food ordering marketplace with multiple vendor types:
     - restaurant
     - cloud kitchen
     - home chef
   - Dedicated pages such as `RestaurantMenuPage.tsx`, `CloudKitchenMenuPage.tsx`, and `HomeChefMenuPage.tsx` suggest distinct catalog entry points, likely using different datasets and filters.

6. **Local data layer**
   - `src/data/` contains static/mock data sets:
     - `restaurantData.ts`, `restaurantMenuData.ts`
     - `cloudKitchenMenuData.ts`
     - `homeChefData.ts`, `homeChefMenuData.ts`
     - `kitchenData.ts`
   - These files act as the product/catalog source for rendering menus and listings, which suggests the app can function with local seed data even before backend integration.

7. **Authentication and account state**
   - `src/api/authApi.ts` and `src/api/axiosInstance.ts` indicate a dedicated API layer for backend communication, especially auth-related requests.
   - `src/store/slices/authSlice.ts` plus `src/store/index.ts` indicate centralized client state for authentication/session data.
   - The login/signup/account screens likely interact with both the API layer and the store to keep auth state consistent across the app.

8. **Forms and validation**
   - `src/utils/validationSchemas.ts` shows form validation is centralized rather than duplicated in each page.
   - This is likely used by login, signup, profile, address, or partner-application forms to keep client-side rules consistent.

9. **Styling and design system**
   - Styling is split between global CSS (`src/index.css`) and app/component-level CSS (`src/App.css`), with `src/theme.ts` suggesting a theme object or design tokens.
   - The structure implies a lightweight design system rather than a heavy UI framework abstraction.

10. **Functional areas beyond shopping**
   - The repository includes content and workflow pages for support and business operations:
     - FAQs, Contact Us, Privacy Policy, Terms & Conditions, Cancellation/Refund Policy
     - Partner With Us, Join As Delivery Partner
     - Track Order, Vieworders, Orders, Account Overview, Addresses
   - These indicate the app is not just a storefront; it also supports account management, order lifecycle visibility, and partner onboarding.

11. **Data flow summary**
   - User enters through routed pages → shared layout/components render the shell → pages pull from either static data modules or auth/API/store state → forms validate through shared schemas → API requests go through the axios instance → auth state is stored centrally and consumed by account/cart/order screens.

12. **Build, tooling, and delivery**
   - The repo uses the standard **Vite + React + TypeScript** toolchain with ESLint and TypeScript configs.
   - `.github/workflows/deploy.yml` indicates a CI/CD deployment pipeline for building and publishing the frontend bundle.

Main entry points: [`src/routes/AppRoutes.tsx`](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/routes/AppRoutes.tsx) (Routes), [`src/App.tsx`](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/App.tsx) (App shell), [`src/pages/Login.tsx`](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Login.tsx) (Login / Signup), [`src/components/Layout.tsx`](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Layout.tsx) (Layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_shell["App shell"]
  node_node_main(("main<br/>bootstrap<br/>[main.tsx]"))
  node_node_app["App shell<br/>react shell<br/>[App.tsx]"]
  node_node_routes["Routes<br/>route map<br/>[AppRoutes.tsx]"]
end

subgraph group_grp_pages["Pages"]
  node_node_home["Home<br/>landing page<br/>[Home.tsx]"]
  node_node_auth["Login / Signup<br/>auth pages<br/>[Login.tsx]"]
  node_node_account["Account<br/>[MyAccount.tsx]"]
  node_node_orders["Orders<br/>order pages<br/>[Orders.tsx]"]
  node_node_cart["Cart<br/>checkout page<br/>[Cart.tsx]"]
  node_node_menu["Menus<br/>catalog pages"]
  node_node_support["Support<br/>help/legal pages<br/>[FAQs.tsx]"]
  node_node_growth["Partners<br/>onboarding pages<br/>[PartnerWithUs.tsx]"]
end

subgraph group_grp_ui["Shared UI"]
  node_node_layout["Layout<br/>page frame<br/>[Layout.tsx]"]
  node_node_navbar["Navbar<br/>navigation<br/>[Navbar.tsx]"]
  node_node_footer["Footer<br/>navigation<br/>[Footer.tsx]"]
  node_node_chrome["Page chrome<br/>ui shell<br/>[Cartbar.tsx]"]
end

subgraph group_grp_data["Data and state"]
  node_node_authapi["Auth API<br/>api client<br/>[authApi.ts]"]
  node_node_http["HTTP client<br/>axios setup<br/>[axiosInstance.ts]"]
  node_node_authstore[("Auth store<br/>state slice<br/>[authSlice.ts]")]
  node_node_catalog[("Catalog data<br/>static data<br/>[restaurantData.ts]")]
  node_node_validation["Validation<br/>schemas"]
  node_node_theme["Theme<br/>design tokens<br/>[theme.ts]"]
  node_node_css["Global CSS<br/>styles<br/>[index.css]"]
end

subgraph group_grp_delivery["Tooling"]
  node_node_deploy["Deploy workflow<br/>ci/cd<br/>[deploy.yml]"]
end

node_node_main -->|"mounts"| node_node_app
node_node_app -->|"uses"| node_node_routes
node_node_app -->|"wraps"| node_node_layout
node_node_layout -->|"contains"| node_node_navbar
node_node_layout -->|"contains"| node_node_footer
node_node_layout -->|"composes"| node_node_chrome
node_node_routes -->|"renders"| node_node_home
node_node_routes -->|"renders"| node_node_auth
node_node_routes -->|"renders"| node_node_account
node_node_routes -->|"renders"| node_node_orders
node_node_routes -->|"renders"| node_node_cart
node_node_routes -->|"renders"| node_node_menu
node_node_routes -->|"renders"| node_node_support
node_node_routes -->|"renders"| node_node_growth
node_node_home -->|"reads"| node_node_catalog
node_node_menu -->|"reads"| node_node_catalog
node_node_auth -->|"calls"| node_node_authapi
node_node_authapi -->|"uses"| node_node_http
node_node_auth -->|"updates"| node_node_authstore
node_node_account -->|"reads"| node_node_authstore
node_node_auth -->|"validates"| node_node_validation
node_node_account -->|"validates"| node_node_validation
node_node_catalog -->|"feeds"| node_node_chrome
node_node_app -->|"styles with"| node_node_theme
node_node_app -->|"styles with"| node_node_css
node_node_deploy -->|"builds"| node_node_main

click node_node_main "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/main.tsx"
click node_node_app "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/App.tsx"
click node_node_routes "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/routes/AppRoutes.tsx"
click node_node_layout "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Layout.tsx"
click node_node_navbar "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Navbar.tsx"
click node_node_footer "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Footer.tsx"
click node_node_chrome "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Cartbar.tsx"
click node_node_home "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Home.tsx"
click node_node_auth "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Login.tsx"
click node_node_account "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/MyAccount.tsx"
click node_node_orders "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Orders.tsx"
click node_node_cart "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Cart.tsx"
click node_node_menu "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/RestaurantMenuPage.tsx"
click node_node_support "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/FAQs.tsx"
click node_node_growth "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/PartnerWithUs.tsx"
click node_node_authapi "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/api/authApi.ts"
click node_node_http "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/api/axiosInstance.ts"
click node_node_authstore "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/store/slices/authSlice.ts"
click node_node_catalog "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/data/restaurantData.ts"
click node_node_validation "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/utils/validationSchemas.ts"
click node_node_theme "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/theme.ts"
click node_node_css "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/index.css"
click node_node_deploy "https://github.com/akhilll18/foyer-v1/blob/foyer-v1/.github/workflows/deploy.yml"

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_node_main,node_node_app,node_node_routes toneBlue
class node_node_home,node_node_auth,node_node_account,node_node_orders,node_node_cart,node_node_menu,node_node_support,node_node_growth toneAmber
class node_node_layout,node_node_navbar,node_node_footer,node_node_chrome toneMint
class node_node_authapi,node_node_http,node_node_authstore,node_node_catalog,node_node_validation,node_node_theme,node_node_css toneRose
class node_node_deploy toneIndigo
```

## Components

### App shell

Bootstrap, routing, and top-level composition

- [main](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/main.tsx): bootstrap · Vite entry that mounts the app · `src/main.tsx`
- [App shell](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/App.tsx): react shell · Top-level app composition · `src/App.tsx`
- [Routes](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/routes/AppRoutes.tsx): route map · Central route definitions · `src/routes/AppRoutes.tsx`

### Pages

Route-driven user screens

- [Home](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Home.tsx): landing page · Primary landing screen · `src/pages/Home.tsx`
- [Login / Signup](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Login.tsx): auth pages · Public authentication entry points · `src/pages/Login.tsx`
- [Account](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/MyAccount.tsx): account pages · Profile and account management screens · `src/pages/MyAccount.tsx`
- [Orders](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Orders.tsx): order pages · Order history, tracking, and viewing flows · `src/pages/Orders.tsx`
- [Cart](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/Cart.tsx): checkout page · Cart and checkout staging · `src/pages/Cart.tsx`
- [Menus](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/RestaurantMenuPage.tsx): catalog pages · Vendor-specific menu entry points · `src/pages/RestaurantMenuPage.tsx`
- [Support](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/FAQs.tsx): help/legal pages · FAQs, contact, privacy, terms, and refunds · `src/pages/FAQs.tsx`
- [Partners](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/pages/PartnerWithUs.tsx): onboarding pages · Partner and delivery onboarding screens · `src/pages/PartnerWithUs.tsx`

### Shared UI

Reusable layout and navigation components

- [Layout](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Layout.tsx): page frame · Shared application frame · `src/components/Layout.tsx`
- [Navbar](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Navbar.tsx): navigation · Top-level navigation header · `src/components/Navbar.tsx`
- [Footer](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Footer.tsx): navigation · Global footer · `src/components/Footer.tsx`
- [Page chrome](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/components/Cartbar.tsx): ui shell · Cart bar, category nav, profile menu, and cards · `src/components/Cartbar.tsx`

### Data and state

API, auth state, catalog data, validation, and theming

- [Auth API](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/api/authApi.ts): api client · Backend calls for auth-related flows · `src/api/authApi.ts`
- [HTTP client](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/api/axiosInstance.ts): axios setup · Shared axios instance and configuration · `src/api/axiosInstance.ts`
- [Auth store](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/store/slices/authSlice.ts): state slice · Central authentication and session state · `src/store/slices/authSlice.ts`
- [Catalog data](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/data/restaurantData.ts): static data · Restaurant, kitchen, and home chef seed data · `src/data/restaurantData.ts`
- [Validation](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/utils/validationSchemas.ts): schemas · Shared form validation rules · `src/utils/validationSchemas.ts`
- [Theme](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/theme.ts): design tokens · Theme object and styling primitives · `src/theme.ts`
- [Global CSS](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/src/index.css): styles · Application-wide and root styles · `src/index.css`

### Tooling

Build and deployment setup

- [Deploy workflow](https://github.com/akhilll18/foyer-v1/blob/foyer-v1/.github/workflows/deploy.yml): ci/cd · GitHub Actions build and deployment pipeline · `.github/workflows/deploy.yml`

## Connections

- main → App shell: mounts · Bootstraps the top-level app shell
- App shell → Routes: uses · Delegates screen selection to the route map
- App shell → Layout: wraps · Uses the shared page frame around routed screens
- Layout → Navbar: contains · Provides the navigation header
- Layout → Footer: contains · Provides the global footer
- Layout → Page chrome: composes · Hosts reusable chrome and utility UI
- Routes → Home: renders · Maps route paths to the landing page
- Routes → Login / Signup: renders · Maps authentication routes
- Routes → Account: renders · Maps account and profile routes
- Routes → Orders: renders · Maps order history and tracking routes
- Routes → Cart: renders · Maps cart and checkout routes
- Routes → Menus: renders · Maps vendor menu routes
- Routes → Support: renders · Maps support and legal pages
- Routes → Partners: renders · Maps partner onboarding pages
- Home → Catalog data: reads · Shows featured listings from local seed data
- Menus → Catalog data: reads · Renders menus from static catalog datasets
- Login / Signup → Auth API: calls · Submits auth requests through the API layer
- Auth API → HTTP client: uses · Builds on the shared HTTP client
- Login / Signup → Auth store: updates · Persists login state in the central store
- Account → Auth store: reads · Consumes session and profile state
- Login / Signup → Validation: validates · Uses shared form rules
- Account → Validation: validates · Uses shared form rules for account forms
- Catalog data → Page chrome: feeds · Supplies data for card and nav-driven listings
- App shell → Theme: styles with · Applies shared theming
- App shell → Global CSS: styles with · Loads global styles
- Deploy workflow → main: builds · Packages the frontend entry for deployment
