How akhilll18/foyer-v1 works
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: AppRoutes.tsx Routes · App.tsx App shell · Login.tsx Login / Signup · Layout.tsx Layout
Components 23
App shell
Bootstrap, routing, and top-level composition
Pages
Route-driven user screens
- Home · Primary landing screen
src/pages/Home.tsx - Login / Signup · Public authentication entry points
src/pages/Login.tsx - Account · Profile and account management screens
src/pages/MyAccount.tsx - Orders · Order history, tracking, and viewing flows
src/pages/Orders.tsx - Cart · Cart and checkout staging
src/pages/Cart.tsx - Menus · Vendor-specific menu entry points
src/pages/RestaurantMenuPage.tsx - Support · FAQs, contact, privacy, terms, and refunds
src/pages/FAQs.tsx - Partners · Partner and delivery onboarding screens
src/pages/PartnerWithUs.tsx
Shared UI
Reusable layout and navigation components
- Layout · Shared application frame
src/components/Layout.tsx - Navbar · Top-level navigation header
src/components/Navbar.tsx - Footer · Global footer
src/components/Footer.tsx - Page chrome · 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 · Backend calls for auth-related flows
src/api/authApi.ts - HTTP client · Shared axios instance and configuration
src/api/axiosInstance.ts - Auth store · Central authentication and session state
src/store/slices/authSlice.ts - Catalog data · Restaurant, kitchen, and home chef seed data
src/data/restaurantData.ts - Validation · Shared form validation rules
src/utils/validationSchemas.ts - Theme · Theme object and styling primitives
src/theme.ts - Global CSS · Application-wide and root styles
src/index.css
Tooling
Build and deployment setup
- Deploy workflow · GitHub Actions build and deployment pipeline
.github/workflows/deploy.yml
Connections 26
- 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