# khasan013/dbms_frontend- architecture

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

- Interactive diagram: https://gitdiagram.com/khasan013/dbms_frontend-
- Repository: https://github.com/khasan013/dbms_frontend-

## Overview

Campus Crate is a campus community app for browsing and publishing lost-and-found, marketplace, housing, and food posts, with search, accounts, vendor, and admin areas. Users enter through the routed app; domain pages fetch data through a shared API client, while post forms publish content and listings are presented as cards. The sampled code confirms key search, housing, post-creation, and header interactions. Other product areas are represented from the source index and route tree; their internal behavior was not sampled, so uncertain links are omitted.

Main entry points: [`src/routeTree.gen.js`](https://github.com/khasan013/dbms_frontend-/blob/main/src/routeTree.gen.js) (Route registry), [`src/services/api.js`](https://github.com/khasan013/dbms_frontend-/blob/main/src/services/api.js) (API client), [`src/pages/user/HomePage.jsx`](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/HomePage.jsx) (Home feed), [`src/pages/user/SearchPage.jsx`](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/SearchPage.jsx) (Unified search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App routing"]
  node_router["App router<br/>[router.jsx]"]
  node_routes["Route registry<br/>[routeTree.gen.js]"]
  node_shell["App layout<br/>[AppLayout.jsx]"]
  node_header["Site header<br/>[site-header.jsx]"]
end

subgraph group_community["Community listings"]
  node_home["Home feed<br/>[HomePage.jsx]"]
  node_search["Unified search<br/>[SearchPage.jsx]"]
  node_housing["Housing listings<br/>[ToLetPage.jsx]"]
  node_food["Food directory<br/>[FoodPage.jsx]"]
  node_listing["Listing details"]
  node_otherlistings["Other listing areas"]
  node_createpost["Create post"]
  node_listingcard["Listing card<br/>[listing-card.jsx]"]
end

subgraph group_accounts["Accounts and operations"]
  node_accounts["Account pages"]
  node_admin["Admin console<br/>[AdminPage.jsx]"]
  node_vendor["Vendor dashboard"]
  node_authguard["Auth guard<br/>[require-auth.jsx]"]
end

subgraph group_platform["Shared platform"]
  node_api["API client<br/>[api.js]"]
  node_polling["Refresh polling<br/>[use-polling.js]"]
  node_session[("Browser session")]
end

node_visitor(("Campus user"))
node_backend["Campus backend"]

node_visitor -.->|"opens app"| node_router
node_router -->|"loads routes"| node_routes
node_routes -.->|"roots routes"| node_shell
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_search
node_routes -->|"routes to"| node_listing
node_routes -.->|"routes to"| node_accounts
node_routes -.->|"routes to"| node_admin
node_routes -->|"routes to"| node_vendor
node_shell -->|"renders"| node_header
node_header -->|"requests data"| node_api
node_header -->|"opens form"| node_createpost
node_home -->|"loads listings"| node_api
node_home -->|"refreshes with"| node_polling
node_home -->|"renders"| node_listingcard
node_search -->|"fetches categories"| node_api
node_search -->|"refreshes with"| node_polling
node_search -->|"renders"| node_listingcard
node_housing -->|"loads and publishes"| node_api
node_createpost -->|"uploads and publishes"| node_api
node_api -->|"sends requests"| node_backend
node_api -->|"reads and writes"| node_session

click node_router "https://github.com/khasan013/dbms_frontend-/blob/main/src/router.jsx"
click node_routes "https://github.com/khasan013/dbms_frontend-/blob/main/src/routeTree.gen.js"
click node_shell "https://github.com/khasan013/dbms_frontend-/blob/main/src/layouts/AppLayout.jsx"
click node_header "https://github.com/khasan013/dbms_frontend-/blob/main/src/components/site-header.jsx"
click node_home "https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/HomePage.jsx"
click node_search "https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/SearchPage.jsx"
click node_housing "https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/ToLetPage.jsx"
click node_food "https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/FoodPage.jsx"
click node_listing "https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/ListingDetailsPage.jsx"
click node_otherlistings "https://github.com/khasan013/dbms_frontend-/tree/main/src/pages/user"
click node_createpost "https://github.com/khasan013/dbms_frontend-/blob/main/src/components/create-post-dialog.jsx"
click node_listingcard "https://github.com/khasan013/dbms_frontend-/blob/main/src/components/listing-card.jsx"
click node_accounts "https://github.com/khasan013/dbms_frontend-/tree/main/src/pages/user"
click node_admin "https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/admin/AdminPage.jsx"
click node_vendor "https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/VendorDashboardPage.jsx"
click node_authguard "https://github.com/khasan013/dbms_frontend-/blob/main/src/components/require-auth.jsx"
click node_api "https://github.com/khasan013/dbms_frontend-/blob/main/src/services/api.js"
click node_polling "https://github.com/khasan013/dbms_frontend-/blob/main/src/utils/use-polling.js"

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_routes,node_shell,node_header,node_visitor toneBlue
class node_home,node_search,node_housing,node_food,node_listing,node_otherlistings,node_createpost,node_listingcard toneAmber
class node_accounts,node_admin,node_vendor,node_authguard toneMint
class node_api,node_polling,node_session toneRose
class node_backend toneIndigo
```

## Components

### App routing

- [App router](https://github.com/khasan013/dbms_frontend-/blob/main/src/router.jsx): `src/router.jsx`
- [Route registry](https://github.com/khasan013/dbms_frontend-/blob/main/src/routeTree.gen.js): `src/routeTree.gen.js`
- [App layout](https://github.com/khasan013/dbms_frontend-/blob/main/src/layouts/AppLayout.jsx): `src/layouts/AppLayout.jsx`
- [Site header](https://github.com/khasan013/dbms_frontend-/blob/main/src/components/site-header.jsx): `src/components/site-header.jsx`

### Community listings

- [Home feed](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/HomePage.jsx): `src/pages/user/HomePage.jsx`
- [Unified search](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/SearchPage.jsx): `src/pages/user/SearchPage.jsx`
- [Housing listings](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/ToLetPage.jsx): `src/pages/user/ToLetPage.jsx`
- [Food directory](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/FoodPage.jsx): `src/pages/user/FoodPage.jsx`
- [Listing details](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/ListingDetailsPage.jsx): `src/pages/user/ListingDetailsPage.jsx`
- [Other listing areas](https://github.com/khasan013/dbms_frontend-/tree/main/src/pages/user): `src/pages/user`
- [Create post](https://github.com/khasan013/dbms_frontend-/blob/main/src/components/create-post-dialog.jsx): `src/components/create-post-dialog.jsx`
- [Listing card](https://github.com/khasan013/dbms_frontend-/blob/main/src/components/listing-card.jsx): `src/components/listing-card.jsx`

### Accounts and operations

- [Account pages](https://github.com/khasan013/dbms_frontend-/tree/main/src/pages/user): `src/pages/user`
- [Admin console](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/admin/AdminPage.jsx): `src/pages/admin/AdminPage.jsx`
- [Vendor dashboard](https://github.com/khasan013/dbms_frontend-/blob/main/src/pages/user/VendorDashboardPage.jsx): `src/pages/user/VendorDashboardPage.jsx`
- [Auth guard](https://github.com/khasan013/dbms_frontend-/blob/main/src/components/require-auth.jsx): `src/components/require-auth.jsx`

### Shared platform

- [API client](https://github.com/khasan013/dbms_frontend-/blob/main/src/services/api.js): `src/services/api.js`
- [Refresh polling](https://github.com/khasan013/dbms_frontend-/blob/main/src/utils/use-polling.js): `src/utils/use-polling.js`
- **Browser session**

### Other components

- **Campus user**
- **Campus backend**

## Connections

- Campus user → App router: opens app
- App router → Route registry: loads routes (evidence: `src/router.jsx`)
- Route registry → App layout: roots routes
- Route registry → Home feed: routes to
- Route registry → Unified search: routes to
- Route registry → Listing details: routes to
- Route registry → Account pages: routes to
- Route registry → Admin console: routes to
- Route registry → Vendor dashboard: routes to
- App layout → Site header: renders (evidence: `src/layouts/AppLayout.jsx`)
- Site header → API client: requests data (evidence: `src/components/site-header.jsx`)
- Site header → Create post: opens form (evidence: `src/components/site-header.jsx`)
- Home feed → API client: loads listings (evidence: `src/pages/user/HomePage.jsx`)
- Home feed → Refresh polling: refreshes with (evidence: `src/pages/user/HomePage.jsx`)
- Home feed → Listing card: renders (evidence: `src/pages/user/HomePage.jsx`)
- Unified search → API client: fetches categories (evidence: `src/pages/user/SearchPage.jsx`)
- Unified search → Refresh polling: refreshes with (evidence: `src/pages/user/SearchPage.jsx`)
- Unified search → Listing card: renders (evidence: `src/pages/user/SearchPage.jsx`)
- Housing listings → API client: loads and publishes (evidence: `src/pages/user/ToLetPage.jsx`)
- Create post → API client: uploads and publishes (evidence: `src/components/create-post-dialog.jsx`)
- API client → Campus backend: sends requests (evidence: `src/services/api.js`)
- API client → Browser session: reads and writes (evidence: `src/services/api.js`)
