# uchih-a/landiq architecture

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

- Interactive diagram: https://gitdiagram.com/uchih-a/landiq
- Repository: https://github.com/uchih-a/landiq

## Overview

LandIQ Kenya is a land-valuation product: users authenticate, submit a location and land attributes, and receive an ML-based estimate; authenticated users can revisit prediction history. Public market views add county statistics, spatial distributions, proximity and score analysis, and investment rankings. The graph follows the visible frontend entry points and API structure, plus README-documented capabilities. Some service internals and page-to-component wiring were not sampled, so uncertain calls are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/uchih-a/landiq/blob/main/frontend/src/App.tsx) (Application router), [`backend/app/api/v1/router.py`](https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/router.py) (API v1 router), [`backend/app/api/v1/endpoints/predict.py`](https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/endpoints/predict.py) (Prediction endpoints), [`frontend/src/lib/api.ts`](https://github.com/uchih-a/landiq/blob/main/frontend/src/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_webapp["Application router<br/>[App.tsx]"]
  node_estimate["Estimate page<br/>[EstimatePage.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_authui["Sign-in modal<br/>[AuthModal.tsx]"]
  node_predictionhook["Prediction hooks<br/>[usePrediction.ts]"]
  node_markethooks["Market data hooks<br/>[useMarketData.ts]"]
  node_marketviews["Market visualizations"]
  node_apiclient["API client<br/>[api.ts]"]
end

subgraph group_api["API layer"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_router["API v1 router<br/>[router.py]"]
  node_authendpoint["Auth endpoints<br/>[auth.py]"]
  node_predictendpoint["Prediction endpoints<br/>[predict.py]"]
  node_marketendpoint["Market endpoints<br/>[market.py]"]
end

subgraph group_domain["Valuation and market"]
  node_inference["Prediction pipeline<br/>[inference.py]"]
  node_model["MLP model registry<br/>[inference.py]"]
  node_predictionrecords["Prediction history<br/>[prediction.py]"]
  node_marketservice["Market analysis<br/>[market.py]"]
end

subgraph group_identity["Identity and persistence"]
  node_authservice["Auth service<br/>[auth.py]"]
  node_users["User records<br/>[user.py]"]
  node_database[("PostgreSQL<br/>[session.py]")]
end

node_visitor(("User"))
node_nominatim["Nominatim"]

node_visitor -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_estimate
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"opens"| node_authui
node_estimate -->|"submits"| node_predictionhook
node_dashboard -->|"loads history"| node_predictionhook
node_dashboard -->|"loads market data"| node_markethooks
node_markethooks -->|"feeds"| node_marketviews
node_predictionhook -->|"calls"| node_apiclient
node_markethooks -->|"calls"| node_apiclient
node_authui -->|"authenticates via"| node_apiclient
node_apiclient -->|"requests"| node_backend
node_backend -->|"mounts"| node_router
node_router -->|"dispatches"| node_authendpoint
node_router -->|"dispatches"| node_predictendpoint
node_router -->|"dispatches"| node_marketendpoint
node_authendpoint -->|"calls"| node_authservice
node_authservice -->|"reads/writes"| node_users
node_authendpoint -->|"uses session"| node_database
node_predictendpoint -->|"runs valuation"| node_inference
node_inference -.->|"geocodes"| node_nominatim
node_inference -->|"predicts with"| node_model
node_predictendpoint -->|"records history"| node_predictionrecords
node_predictendpoint -->|"uses session"| node_database
node_marketendpoint -->|"calls"| node_marketservice
node_marketendpoint -->|"uses session"| node_database

click node_webapp "https://github.com/uchih-a/landiq/blob/main/frontend/src/App.tsx"
click node_estimate "https://github.com/uchih-a/landiq/blob/main/frontend/src/pages/EstimatePage.tsx"
click node_dashboard "https://github.com/uchih-a/landiq/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_authui "https://github.com/uchih-a/landiq/blob/main/frontend/src/components/modals/AuthModal.tsx"
click node_predictionhook "https://github.com/uchih-a/landiq/blob/main/frontend/src/hooks/usePrediction.ts"
click node_markethooks "https://github.com/uchih-a/landiq/blob/main/frontend/src/hooks/useMarketData.ts"
click node_marketviews "https://github.com/uchih-a/landiq/tree/main/frontend/src/components/charts"
click node_apiclient "https://github.com/uchih-a/landiq/blob/main/frontend/src/lib/api.ts"
click node_backend "https://github.com/uchih-a/landiq/blob/main/backend/app/main.py"
click node_router "https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/router.py"
click node_authendpoint "https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/endpoints/auth.py"
click node_predictendpoint "https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/endpoints/predict.py"
click node_marketendpoint "https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/endpoints/market.py"
click node_authservice "https://github.com/uchih-a/landiq/blob/main/backend/app/services/auth.py"
click node_users "https://github.com/uchih-a/landiq/blob/main/backend/app/models/user.py"
click node_database "https://github.com/uchih-a/landiq/blob/main/backend/app/db/session.py"
click node_inference "https://github.com/uchih-a/landiq/blob/main/backend/app/services/inference.py"
click node_model "https://github.com/uchih-a/landiq/blob/main/backend/app/services/inference.py"
click node_predictionrecords "https://github.com/uchih-a/landiq/blob/main/backend/app/models/prediction.py"
click node_marketservice "https://github.com/uchih-a/landiq/blob/main/backend/app/services/market.py"

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_webapp,node_estimate,node_dashboard,node_authui,node_predictionhook,node_markethooks,node_marketviews,node_apiclient,node_visitor toneBlue
class node_backend,node_router,node_authendpoint,node_predictendpoint,node_marketendpoint toneAmber
class node_inference,node_model,node_predictionrecords,node_marketservice toneMint
class node_authservice,node_users,node_database toneRose
class node_nominatim toneIndigo
```

## Components

### Web application

- [Application router](https://github.com/uchih-a/landiq/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Estimate page](https://github.com/uchih-a/landiq/blob/main/frontend/src/pages/EstimatePage.tsx): `frontend/src/pages/EstimatePage.tsx`
- [Dashboard](https://github.com/uchih-a/landiq/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Sign-in modal](https://github.com/uchih-a/landiq/blob/main/frontend/src/components/modals/AuthModal.tsx): `frontend/src/components/modals/AuthModal.tsx`
- [Prediction hooks](https://github.com/uchih-a/landiq/blob/main/frontend/src/hooks/usePrediction.ts): `frontend/src/hooks/usePrediction.ts`
- [Market data hooks](https://github.com/uchih-a/landiq/blob/main/frontend/src/hooks/useMarketData.ts): `frontend/src/hooks/useMarketData.ts`
- [Market visualizations](https://github.com/uchih-a/landiq/tree/main/frontend/src/components/charts): `frontend/src/components/charts`
- [API client](https://github.com/uchih-a/landiq/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API layer

- [FastAPI application](https://github.com/uchih-a/landiq/blob/main/backend/app/main.py): `backend/app/main.py`
- [API v1 router](https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Auth endpoints](https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/endpoints/auth.py): `backend/app/api/v1/endpoints/auth.py`
- [Prediction endpoints](https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/endpoints/predict.py): `backend/app/api/v1/endpoints/predict.py`
- [Market endpoints](https://github.com/uchih-a/landiq/blob/main/backend/app/api/v1/endpoints/market.py): `backend/app/api/v1/endpoints/market.py`

### Valuation and market

- [Prediction pipeline](https://github.com/uchih-a/landiq/blob/main/backend/app/services/inference.py): `backend/app/services/inference.py`
- [MLP model registry](https://github.com/uchih-a/landiq/blob/main/backend/app/services/inference.py): `backend/app/services/inference.py`
- [Prediction history](https://github.com/uchih-a/landiq/blob/main/backend/app/models/prediction.py): `backend/app/models/prediction.py`
- [Market analysis](https://github.com/uchih-a/landiq/blob/main/backend/app/services/market.py): `backend/app/services/market.py`

### Identity and persistence

- [Auth service](https://github.com/uchih-a/landiq/blob/main/backend/app/services/auth.py): `backend/app/services/auth.py`
- [User records](https://github.com/uchih-a/landiq/blob/main/backend/app/models/user.py): `backend/app/models/user.py`
- [PostgreSQL](https://github.com/uchih-a/landiq/blob/main/backend/app/db/session.py): `backend/app/db/session.py`

### Other components

- **User**
- **Nominatim**

## Connections

- User → Application router: uses
- Application router → Estimate page: routes to
- Application router → Dashboard: routes to
- Application router → Sign-in modal: opens
- Estimate page → Prediction hooks: submits
- Dashboard → Prediction hooks: loads history
- Dashboard → Market data hooks: loads market data
- Market data hooks → Market visualizations: feeds
- Prediction hooks → API client: calls
- Market data hooks → API client: calls
- Sign-in modal → API client: authenticates via
- API client → FastAPI application: requests
- FastAPI application → API v1 router: mounts
- API v1 router → Auth endpoints: dispatches
- API v1 router → Prediction endpoints: dispatches
- API v1 router → Market endpoints: dispatches
- Auth endpoints → Auth service: calls
- Auth service → User records: reads/writes
- Auth endpoints → PostgreSQL: uses session
- Prediction endpoints → Prediction pipeline: runs valuation
- Prediction pipeline → Nominatim: geocodes
- Prediction pipeline → MLP model registry: predicts with
- Prediction endpoints → Prediction history: records history
- Prediction endpoints → PostgreSQL: uses session
- Market endpoints → Market analysis: calls
- Market endpoints → PostgreSQL: uses session
