# abhay-gupta-199/swiggy-clone architecture

> Architecture diagram of the GitHub repository abhay-gupta-199/swiggy-clone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhay-gupta-199/swiggy-clone
- Repository: https://github.com/abhay-gupta-199/swiggy-clone

## Overview

This is a small Swiggy-style restaurant browsing frontend. A visitor enters through the routed React app, browses restaurant listings fetched from Swiggy, filters them by name or rating, and can open a restaurant route. The header also exposes offer, help, sign-in, and cart routes; several of those screens are present but their implementations were not sampled. Edges reflect the shown router configuration and component calls; unsampled screen behavior is not inferred.

Main entry points: [`src/main.jsx`](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/main.jsx) (Route setup), [`src/components/Header.jsx`](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Header.jsx) (Navigation header), [`src/components/Body.jsx`](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Body.jsx) (Restaurant listing), [`src/App.jsx`](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/App.jsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App and routing"]
  node_router["Route setup<br/>[main.jsx]"]
  node_app["App shell<br/>[App.jsx]"]
  node_header["Navigation header<br/>[Header.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_discovery["Restaurant discovery"]
  node_body["Restaurant listing<br/>[Body.jsx]"]
  node_api["Restaurant fetch<br/>[Apicalling.jsx]"]
  node_swiggy["Swiggy API"]
  node_search["Name search<br/>[Search.jsx]"]
  node_card["Restaurant card<br/>[RestaurantCard.jsx]"]
end

subgraph group_screens["Other screens"]
  node_details["Restaurant details"]
  node_offer["Offers screen<br/>[Offer.jsx]"]
  node_help["Help screen<br/>[Help.jsx]"]
  node_signin["Sign-in screen<br/>[Signin.jsx]"]
  node_cart["Cart screen<br/>[Cart.jsx]"]
  node_error["Error screen<br/>[Error.jsx]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_router
node_router -->|"routes to"| node_app
node_router -->|"routes to"| node_body
node_router -->|"routes to"| node_offer
node_router -->|"routes to"| node_help
node_router -->|"routes to"| node_signin
node_router -->|"routes to"| node_cart
node_router -->|"routes to"| node_details
node_router -->|"handles errors"| node_error
node_app -->|"renders"| node_header
node_app -->|"renders"| node_footer
node_header -->|"links to"| node_offer
node_header -->|"links to"| node_help
node_header -->|"links to"| node_signin
node_header -->|"links to"| node_cart
node_body -->|"fetches via"| node_api
node_api -->|"requests data"| node_swiggy
node_body -->|"renders"| node_search
node_body -->|"renders"| node_card
node_card -->|"links to"| node_details

click node_router "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/main.jsx"
click node_app "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/App.jsx"
click node_header "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Header.jsx"
click node_footer "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Footer.jsx"
click node_body "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Body.jsx"
click node_api "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Apicalling.jsx"
click node_search "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Search.jsx"
click node_card "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/RestaurantCard.jsx"
click node_details "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/RestaurantDetails.jsx"
click node_offer "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Offer.jsx"
click node_help "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Help.jsx"
click node_signin "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Signin.jsx"
click node_cart "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Cart.jsx"
click node_error "https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Error.jsx"

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_router,node_app,node_header,node_footer toneBlue
class node_body,node_api,node_swiggy,node_search,node_card toneAmber
class node_details,node_offer,node_help,node_signin,node_cart,node_error toneMint
class node_visitor toneIndigo
```

## Components

### App and routing

- [Route setup](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/main.jsx): `src/main.jsx`
- [App shell](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation header](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Header.jsx): `src/components/Header.jsx`
- [Footer](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Restaurant discovery

- [Restaurant listing](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Body.jsx): `src/components/Body.jsx`
- [Restaurant fetch](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Apicalling.jsx): `src/components/Apicalling.jsx`
- **Swiggy API**
- [Name search](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Search.jsx): `src/components/Search.jsx`
- [Restaurant card](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/RestaurantCard.jsx): `src/components/RestaurantCard.jsx`

### Other screens

- [Restaurant details](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/RestaurantDetails.jsx): `src/components/RestaurantDetails.jsx`
- [Offers screen](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Offer.jsx): `src/components/Offer.jsx`
- [Help screen](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Help.jsx): `src/components/Help.jsx`
- [Sign-in screen](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Signin.jsx): `src/components/Signin.jsx`
- [Cart screen](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Cart.jsx): `src/components/Cart.jsx`
- [Error screen](https://github.com/abhay-gupta-199/swiggy-clone/blob/main/src/components/Error.jsx): `src/components/Error.jsx`

### Other components

- **Visitor**

## Connections

- Visitor → Route setup: opens (evidence: `src/main.jsx`)
- Route setup → App shell: routes to (evidence: `src/main.jsx`)
- Route setup → Restaurant listing: routes to (evidence: `src/main.jsx`)
- Route setup → Offers screen: routes to (evidence: `src/main.jsx`)
- Route setup → Help screen: routes to (evidence: `src/main.jsx`)
- Route setup → Sign-in screen: routes to (evidence: `src/main.jsx`)
- Route setup → Cart screen: routes to (evidence: `src/main.jsx`)
- Route setup → Restaurant details: routes to (evidence: `src/main.jsx`)
- Route setup → Error screen: handles errors (evidence: `src/main.jsx`)
- App shell → Navigation header: renders (evidence: `src/App.jsx`)
- App shell → Footer: renders (evidence: `src/App.jsx`)
- Navigation header → Offers screen: links to (evidence: `src/components/Header.jsx`)
- Navigation header → Help screen: links to (evidence: `src/components/Header.jsx`)
- Navigation header → Sign-in screen: links to (evidence: `src/components/Header.jsx`)
- Navigation header → Cart screen: links to (evidence: `src/components/Header.jsx`)
- Restaurant listing → Restaurant fetch: fetches via (evidence: `src/components/Body.jsx`)
- Restaurant fetch → Swiggy API: requests data (evidence: `src/components/Apicalling.jsx`)
- Restaurant listing → Name search: renders (evidence: `src/components/Body.jsx`)
- Restaurant listing → Restaurant card: renders (evidence: `src/components/Body.jsx`)
- Restaurant card → Restaurant details: links to (evidence: `src/components/RestaurantCard.jsx`)
