# nardoroman/chambalocal architecture

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

- Interactive diagram: https://gitdiagram.com/nardoroman/chambalocal
- Repository: https://github.com/nardoroman/chambalocal

## Overview

ChambaLocal is a local-services marketplace connecting workers and contractors. Users register or sign in with a role; contractors can publish jobs, workers can apply, and visitors can browse nearby jobs through the map experience. The sampled backend shows JWT-based identity and job handling backed by MongoDB models. The frontend also includes a dashboard and map explorer, but their data flows are not visible in the excerpts; those links are therefore omitted rather than inferred.

Main entry points: [`frontend/src/router/index.js`](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/router/index.js) (Page routing), [`frontend/src/store/auth.store.js`](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/store/auth.store.js) (Session state), [`frontend/src/App.vue`](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/App.vue) (Vue application shell), [`backend/src/routes/auth.routes.js`](https://github.com/nardoroman/chambalocal/blob/main/backend/src/routes/auth.routes.js) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Vue application shell<br/>[App.vue]"]
  node_navigation["Navigation<br/>[Navbar.vue]"]
  node_router["Page routing<br/>[index.js]"]
  node_home["Marketplace landing<br/>[Home.vue]"]
  node_login["Sign-in page<br/>[Login.vue]"]
  node_register["Registration page<br/>[Register.vue]"]
  node_dashboard["User dashboard<br/>[Dashboard.vue]"]
  node_map["Map explorer<br/>[MapExplorer.vue]"]
end

subgraph group_identity["Identity and access"]
  node_authstore["Session state<br/>[auth.store.js]"]
  node_api["HTTP client<br/>[api.js]"]
  node_authroutes["Auth routes<br/>[auth.routes.js]"]
  node_authcontroller["Auth operations<br/>[auth.controller.js]"]
  node_authmiddleware["JWT protection<br/>[auth.middleware.js]"]
end

subgraph group_marketplace["Job marketplace"]
  node_jobroutes["Job routes<br/>[job.routes.js]"]
  node_jobcontroller["Job operations<br/>[job.controller.js]"]
  node_server["API server entry<br/>[index.js]"]
end

subgraph group_persistence["Data models"]
  node_user[("User records<br/>[User.js]")]
  node_job[("Job records<br/>[Job.js]")]
  node_review[("Review records<br/>[Review.js]")]
  node_databaseconfig["Database connection<br/>[db.js]"]
end

node_people(("Workers and contractors"))

node_people -.->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"loads session"| node_authstore
node_app -->|"renders routes"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_register
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_map
node_router -->|"checks session"| node_authstore
node_navigation -->|"reads session"| node_authstore
node_login -.->|"submits credentials"| node_authstore
node_register -.->|"submits registration"| node_authstore
node_authstore -->|"sends requests"| node_api
node_api -.->|"calls auth API"| node_authroutes
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_jobroutes
node_server -->|"initializes connection"| node_databaseconfig
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"protects profile"| node_authmiddleware
node_authcontroller -->|"reads and writes"| node_user
node_authmiddleware -->|"loads identity"| node_user
node_jobroutes -->|"dispatches"| node_jobcontroller
node_jobroutes -->|"protects actions"| node_authmiddleware
node_jobcontroller -->|"reads and writes"| node_job

click node_app "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/App.vue"
click node_navigation "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/components/Navbar.vue"
click node_router "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/router/index.js"
click node_home "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/Home.vue"
click node_login "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/Login.vue"
click node_register "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/Register.vue"
click node_dashboard "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/Dashboard.vue"
click node_map "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/MapExplorer.vue"
click node_authstore "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/store/auth.store.js"
click node_api "https://github.com/nardoroman/chambalocal/blob/main/frontend/src/utils/api.js"
click node_authroutes "https://github.com/nardoroman/chambalocal/blob/main/backend/src/routes/auth.routes.js"
click node_authcontroller "https://github.com/nardoroman/chambalocal/blob/main/backend/src/controllers/auth.controller.js"
click node_authmiddleware "https://github.com/nardoroman/chambalocal/blob/main/backend/src/middlewares/auth.middleware.js"
click node_jobroutes "https://github.com/nardoroman/chambalocal/blob/main/backend/src/routes/job.routes.js"
click node_jobcontroller "https://github.com/nardoroman/chambalocal/blob/main/backend/src/controllers/job.controller.js"
click node_server "https://github.com/nardoroman/chambalocal/blob/main/backend/src/index.js"
click node_user "https://github.com/nardoroman/chambalocal/blob/main/backend/src/models/User.js"
click node_job "https://github.com/nardoroman/chambalocal/blob/main/backend/src/models/Job.js"
click node_review "https://github.com/nardoroman/chambalocal/blob/main/backend/src/models/Review.js"
click node_databaseconfig "https://github.com/nardoroman/chambalocal/blob/main/backend/src/config/db.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_navigation,node_router,node_home,node_login,node_register,node_dashboard,node_map toneBlue
class node_authstore,node_api,node_authroutes,node_authcontroller,node_authmiddleware toneAmber
class node_jobroutes,node_jobcontroller,node_server toneMint
class node_user,node_job,node_review,node_databaseconfig,node_people toneRose
```

## Components

### Web client

- [Vue application shell](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Navigation](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/components/Navbar.vue): `frontend/src/components/Navbar.vue`
- [Page routing](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/router/index.js): `frontend/src/router/index.js`
- [Marketplace landing](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/Home.vue): `frontend/src/views/Home.vue`
- [Sign-in page](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/Login.vue): `frontend/src/views/Login.vue`
- [Registration page](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/Register.vue): `frontend/src/views/Register.vue`
- [User dashboard](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/Dashboard.vue): `frontend/src/views/Dashboard.vue`
- [Map explorer](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/views/MapExplorer.vue): `frontend/src/views/MapExplorer.vue`

### Identity and access

- [Session state](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/store/auth.store.js): `frontend/src/store/auth.store.js`
- [HTTP client](https://github.com/nardoroman/chambalocal/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`
- [Auth routes](https://github.com/nardoroman/chambalocal/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Auth operations](https://github.com/nardoroman/chambalocal/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [JWT protection](https://github.com/nardoroman/chambalocal/blob/main/backend/src/middlewares/auth.middleware.js): `backend/src/middlewares/auth.middleware.js`

### Job marketplace

- [Job routes](https://github.com/nardoroman/chambalocal/blob/main/backend/src/routes/job.routes.js): `backend/src/routes/job.routes.js`
- [Job operations](https://github.com/nardoroman/chambalocal/blob/main/backend/src/controllers/job.controller.js): `backend/src/controllers/job.controller.js`
- [API server entry](https://github.com/nardoroman/chambalocal/blob/main/backend/src/index.js): `backend/src/index.js`

### Data models

- [User records](https://github.com/nardoroman/chambalocal/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Job records](https://github.com/nardoroman/chambalocal/blob/main/backend/src/models/Job.js): `backend/src/models/Job.js`
- [Review records](https://github.com/nardoroman/chambalocal/blob/main/backend/src/models/Review.js): `backend/src/models/Review.js`
- [Database connection](https://github.com/nardoroman/chambalocal/blob/main/backend/src/config/db.js): `backend/src/config/db.js`

### Other components

- **Workers and contractors**

## Connections

- Workers and contractors → Vue application shell: uses
- Vue application shell → Navigation: renders (evidence: `frontend/src/App.vue`)
- Vue application shell → Session state: loads session (evidence: `frontend/src/App.vue`)
- Vue application shell → Page routing: renders routes (evidence: `frontend/src/main.js`)
- Page routing → Marketplace landing: routes to (evidence: `frontend/src/router/index.js`)
- Page routing → Sign-in page: routes to (evidence: `frontend/src/router/index.js`)
- Page routing → Registration page: routes to (evidence: `frontend/src/router/index.js`)
- Page routing → User dashboard: routes to (evidence: `frontend/src/router/index.js`)
- Page routing → Map explorer: routes to (evidence: `frontend/src/router/index.js`)
- Page routing → Session state: checks session (evidence: `frontend/src/router/index.js`)
- Navigation → Session state: reads session (evidence: `frontend/src/components/Navbar.vue`)
- Sign-in page → Session state: submits credentials (evidence: `frontend/src/views/Login.vue`)
- Registration page → Session state: submits registration (evidence: `frontend/src/views/Register.vue`)
- Session state → HTTP client: sends requests (evidence: `frontend/src/store/auth.store.js`)
- HTTP client → Auth routes: calls auth API
- API server entry → Auth routes: mounts routes (evidence: `backend/src/index.js`)
- API server entry → Job routes: mounts routes (evidence: `backend/src/index.js`)
- API server entry → Database connection: initializes connection (evidence: `backend/src/index.js`)
- Auth routes → Auth operations: dispatches (evidence: `backend/src/routes/auth.routes.js`)
- Auth routes → JWT protection: protects profile (evidence: `backend/src/routes/auth.routes.js`)
- Auth operations → User records: reads and writes (evidence: `backend/src/controllers/auth.controller.js`)
- JWT protection → User records: loads identity (evidence: `backend/src/middlewares/auth.middleware.js`)
- Job routes → Job operations: dispatches (evidence: `backend/src/routes/job.routes.js`)
- Job routes → JWT protection: protects actions (evidence: `backend/src/routes/job.routes.js`)
- Job operations → Job records: reads and writes (evidence: `backend/src/controllers/job.controller.js`)
