# hey-anant/terravilla architecture

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

- Interactive diagram: https://gitdiagram.com/hey-anant/terravilla
- Repository: https://github.com/hey-anant/terravilla

## Overview

TerraVilla is a broker-free land marketplace prototype. A user enters through the React app, authenticates, then discovers verified plots, reviews market insights, or manages a seller listing; profile flows cover identity and account details. The sampled frontend uses InsForge for authentication/profile operations and plot utilities for listing reads and writes, while the README describes mock persistence and simulated fees. A separate Express/MongoDB backend is present, but the excerpts do not establish that the frontend calls it; its route internals and utility wiring are therefore left unspecified.

Main entry points: [`src/App.jsx`](https://github.com/hey-anant/terravilla/blob/main/src/App.jsx) (App view router), [`src/context/AuthContext.jsx`](https://github.com/hey-anant/terravilla/blob/main/src/context/AuthContext.jsx) (Auth state and flows), [`src/utils/plotUtils.js`](https://github.com/hey-anant/terravilla/blob/main/src/utils/plotUtils.js) (Plot utilities), [`backend/server.js`](https://github.com/hey-anant/terravilla/blob/main/backend/server.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Marketplace UI"]
  node_app["App view router<br/>[App.jsx]"]
  node_home["Landing page<br/>[LandingPage.jsx]"]
end

subgraph group_identity["Identity and Profiles"]
  node_login["Login and signup<br/>[LoginForm.jsx]"]
  node_auth["Auth state and flows<br/>[AuthContext.jsx]"]
  node_insforge["InsForge service<br/>[insforge.js]"]
  node_userdb[("InsForge users")]
  node_profile["Profile and KYC<br/>[ProfilePage.jsx]"]
end

subgraph group_listing["Property Marketplace"]
  node_search["Property search<br/>[SearchPage.jsx]"]
  node_seller["Seller dashboard"]
  node_payment["Listing fee"]
  node_plots["Plot utilities<br/>[plotUtils.js]"]
  node_mockplots["Mock plot data<br/>[mockData.js]"]
  node_market["Market insights<br/>[MarketData.jsx]"]
end

subgraph group_server["Backend API"]
  node_backend["Express server<br/>[server.js]"]
  node_plotroutes["Plot API routes<br/>[plots.js]"]
  node_marketroutes["Market API routes<br/>[market.js]"]
  node_mongo[("MongoDB")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"shows signed-out"| node_login
node_app -->|"routes home"| node_home
node_app -->|"routes search"| node_search
node_app -->|"routes seller"| node_seller
node_app -->|"routes market"| node_market
node_app -->|"routes profile"| node_profile
node_login -->|"calls auth flows"| node_auth
node_auth -->|"calls auth API"| node_insforge
node_auth -->|"reads and writes"| node_userdb
node_profile -->|"calls profile flows"| node_auth
node_search -->|"fetches plots"| node_plots
node_seller -->|"reads and adds"| node_plots
node_market -->|"fetches listings"| node_plots
node_plots -.->|"uses mock data"| node_mockplots
node_seller -.->|"opens fee flow"| node_payment
node_backend -->|"mounts routes"| node_plotroutes
node_backend -->|"mounts routes"| node_marketroutes
node_backend -->|"connects"| node_mongo

click node_app "https://github.com/hey-anant/terravilla/blob/main/src/App.jsx"
click node_login "https://github.com/hey-anant/terravilla/blob/main/src/components/Auth/LoginForm.jsx"
click node_auth "https://github.com/hey-anant/terravilla/blob/main/src/context/AuthContext.jsx"
click node_insforge "https://github.com/hey-anant/terravilla/blob/main/src/lib/insforge.js"
click node_profile "https://github.com/hey-anant/terravilla/blob/main/src/components/Profile/ProfilePage.jsx"
click node_home "https://github.com/hey-anant/terravilla/blob/main/src/components/Home/LandingPage.jsx"
click node_search "https://github.com/hey-anant/terravilla/blob/main/src/components/Search/SearchPage.jsx"
click node_seller "https://github.com/hey-anant/terravilla/blob/main/src/components/Seller/SellerDashboard.jsx"
click node_payment "https://github.com/hey-anant/terravilla/blob/main/src/components/Payment/ListingFeePayment.jsx"
click node_plots "https://github.com/hey-anant/terravilla/blob/main/src/utils/plotUtils.js"
click node_mockplots "https://github.com/hey-anant/terravilla/blob/main/src/data/mockData.js"
click node_market "https://github.com/hey-anant/terravilla/blob/main/src/components/Market/MarketData.jsx"
click node_backend "https://github.com/hey-anant/terravilla/blob/main/backend/server.js"
click node_plotroutes "https://github.com/hey-anant/terravilla/blob/main/backend/routes/plots.js"
click node_marketroutes "https://github.com/hey-anant/terravilla/blob/main/backend/routes/market.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_app,node_home,node_user toneBlue
class node_login,node_auth,node_insforge,node_userdb,node_profile toneAmber
class node_search,node_seller,node_payment,node_plots,node_mockplots,node_market toneMint
class node_backend,node_plotroutes,node_marketroutes,node_mongo toneRose
```

## Components

### Marketplace UI

- [App view router](https://github.com/hey-anant/terravilla/blob/main/src/App.jsx): `src/App.jsx`
- [Landing page](https://github.com/hey-anant/terravilla/blob/main/src/components/Home/LandingPage.jsx): `src/components/Home/LandingPage.jsx`

### Identity and Profiles

- [Login and signup](https://github.com/hey-anant/terravilla/blob/main/src/components/Auth/LoginForm.jsx): `src/components/Auth/LoginForm.jsx`
- [Auth state and flows](https://github.com/hey-anant/terravilla/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [InsForge service](https://github.com/hey-anant/terravilla/blob/main/src/lib/insforge.js): `src/lib/insforge.js`
- **InsForge users**
- [Profile and KYC](https://github.com/hey-anant/terravilla/blob/main/src/components/Profile/ProfilePage.jsx): `src/components/Profile/ProfilePage.jsx`

### Property Marketplace

- [Property search](https://github.com/hey-anant/terravilla/blob/main/src/components/Search/SearchPage.jsx): `src/components/Search/SearchPage.jsx`
- [Seller dashboard](https://github.com/hey-anant/terravilla/blob/main/src/components/Seller/SellerDashboard.jsx): `src/components/Seller/SellerDashboard.jsx`
- [Listing fee](https://github.com/hey-anant/terravilla/blob/main/src/components/Payment/ListingFeePayment.jsx): `src/components/Payment/ListingFeePayment.jsx`
- [Plot utilities](https://github.com/hey-anant/terravilla/blob/main/src/utils/plotUtils.js): `src/utils/plotUtils.js`
- [Mock plot data](https://github.com/hey-anant/terravilla/blob/main/src/data/mockData.js): `src/data/mockData.js`
- [Market insights](https://github.com/hey-anant/terravilla/blob/main/src/components/Market/MarketData.jsx): `src/components/Market/MarketData.jsx`

### Backend API

- [Express server](https://github.com/hey-anant/terravilla/blob/main/backend/server.js): `backend/server.js`
- [Plot API routes](https://github.com/hey-anant/terravilla/blob/main/backend/routes/plots.js): `backend/routes/plots.js`
- [Market API routes](https://github.com/hey-anant/terravilla/blob/main/backend/routes/market.js): `backend/routes/market.js`
- **MongoDB**

### Other components

- **User**

## Connections

- User → App view router: uses
- App view router → Login and signup: shows signed-out
- App view router → Landing page: routes home
- App view router → Property search: routes search
- App view router → Seller dashboard: routes seller
- App view router → Market insights: routes market
- App view router → Profile and KYC: routes profile
- Login and signup → Auth state and flows: calls auth flows
- Auth state and flows → InsForge service: calls auth API
- Auth state and flows → InsForge users: reads and writes
- Profile and KYC → Auth state and flows: calls profile flows
- Property search → Plot utilities: fetches plots
- Seller dashboard → Plot utilities: reads and adds
- Market insights → Plot utilities: fetches listings
- Plot utilities → Mock plot data: uses mock data
- Seller dashboard → Listing fee: opens fee flow
- Express server → Plot API routes: mounts routes
- Express server → Market API routes: mounts routes
- Express server → MongoDB: connects
