# thushara-bajimar/osco-2026 architecture

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

- Interactive diagram: https://gitdiagram.com/thushara-bajimar/osco-2026
- Repository: https://github.com/thushara-bajimar/osco-2026

## Overview

CoastalCrafts is a full-stack marketplace MVP for coastal Karnataka crafts. Buyers browse collections, search and filter listings, learn product and maker stories, then place demo orders or submit custom-order and artisan-support intents. Artisans use the studio to update profiles and listings and review orders. The backend is an Express API backed by seeded SQLite; payment and fulfilment are not integrated. The graph preserves documented capabilities, but some feature paths are linked only as described in the README because their implementation was not sampled.

Main entry points: [`backend/src/server.js`](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/server.js) (Express API), [`frontend/src/App.jsx`](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/App.jsx) (App routing), [`frontend/src/data/artisanApi.js`](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/data/artisanApi.js) (Frontend API client), [`backend/src/config/db.js`](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/config/db.js) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_marketplace["Marketplace discovery"]
  node_app["App routing<br/>[App.jsx]"]
  node_home["Home catalogue<br/>[HomePage.jsx]"]
  node_collections["Craft collections"]
  node_catalogue_data["Catalogue data<br/>[products.js]"]
  node_product_detail["Product and maker detail"]
end

subgraph group_buyer["Buyer engagement"]
  node_buyer_actions["Buyer actions<br/>[BuyerActions.jsx]"]
  node_checkout["Order checkout"]
  node_order_confirmation["Order confirmation"]
  node_order_storage[("Local order cache<br/>[orderStorage.js]")]
end

subgraph group_studio["Artisan studio"]
  node_studio_login["Artisan sign-in<br/>[ArtisanLogin.jsx]"]
  node_studio_dashboard["Studio dashboard"]
  node_studio_profile["Maker profile editor<br/>[ArtisanProfile.jsx]"]
  node_studio_listings["Listing management<br/>[ManageProducts.jsx]"]
  node_studio_orders["Order management<br/>[ArtisanOrders.jsx]"]
end

subgraph group_api["API services"]
  node_api_client["Frontend API client<br/>[artisanApi.js]"]
  node_server["Express API<br/>[server.js]"]
  node_craft_service["Craft endpoints<br/>[craftController.js]"]
  node_product_service["Product endpoints"]
  node_artisan_service["Artisan endpoints"]
  node_order_service["Order endpoints<br/>[orderController.js]"]
  node_community_service["Custom and support requests"]
end

subgraph group_persistence["SQLite persistence"]
  node_sqlite[("SQLite database<br/>[db.js]")]
  node_schema["Schema initialization<br/>[initDB.js]"]
  node_seeds["Demo records<br/>[seedDb.js]"]
end

node_buyer_actor(("Buyer"))
node_artisan_actor(("Artisan"))

node_buyer_actor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_collections
node_app -->|"routes to"| node_product_detail
node_home -->|"fallbacks to"| node_catalogue_data
node_home -->|"fetches listings"| node_api_client
node_collections -->|"loads catalogue"| node_api_client
node_product_detail -->|"renders"| node_buyer_actions
node_product_detail -->|"loads product"| node_api_client
node_buyer_actions -.->|"submits intent"| node_api_client
node_app -->|"routes to"| node_checkout
node_checkout -->|"places order"| node_api_client
node_checkout -->|"saves order"| node_order_storage
node_app -->|"routes to"| node_order_confirmation
node_order_confirmation -->|"reads order"| node_order_storage
node_artisan_actor -->|"signs in"| node_studio_login
node_app -->|"routes to"| node_studio_dashboard
node_studio_dashboard -->|"loads studio data"| node_api_client
node_studio_dashboard -->|"edits profile"| node_studio_profile
node_studio_dashboard -->|"manages listings"| node_studio_listings
node_studio_dashboard -->|"reviews orders"| node_studio_orders
node_studio_orders -->|"updates status"| node_api_client
node_api_client -->|"requests JSON"| node_server
node_server -->|"mounts routes"| node_craft_service
node_server -->|"mounts routes"| node_product_service
node_server -->|"mounts routes"| node_artisan_service
node_server -->|"mounts routes"| node_order_service
node_server -->|"mounts routes"| node_community_service
node_product_service -->|"reads and writes"| node_sqlite
node_artisan_service -->|"reads and writes"| node_sqlite
node_order_service -->|"records and updates"| node_sqlite
node_craft_service -->|"queries"| node_sqlite
node_community_service -->|"stores requests"| node_sqlite
node_server -->|"initializes"| node_schema
node_server -->|"seeds on startup"| node_seeds
node_schema -->|"creates schema"| node_sqlite
node_seeds -->|"inserts demo data"| node_sqlite

click node_app "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/HomePage.jsx"
click node_collections "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/CraftCategoryPage.jsx"
click node_catalogue_data "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/data/products.js"
click node_product_detail "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/ProductRoutePlaceholder.jsx"
click node_buyer_actions "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/components/BuyerActions.jsx"
click node_checkout "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/OrderCheckoutPage.jsx"
click node_order_confirmation "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/OrderConfirmationPage.jsx"
click node_order_storage "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/data/orderStorage.js"
click node_studio_login "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/ArtisanLogin.jsx"
click node_studio_dashboard "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/ArtisanDashboard.jsx"
click node_studio_profile "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/components/ArtisanProfile.jsx"
click node_studio_listings "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/ManageProducts.jsx"
click node_studio_orders "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/components/ArtisanOrders.jsx"
click node_api_client "https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/data/artisanApi.js"
click node_server "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/server.js"
click node_craft_service "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/craftController.js"
click node_product_service "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/productController.js"
click node_artisan_service "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/artisanController.js"
click node_order_service "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/orderController.js"
click node_community_service "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/communityController.js"
click node_sqlite "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/config/db.js"
click node_schema "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/config/initDB.js"
click node_seeds "https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/config/seedDb.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_collections,node_catalogue_data,node_product_detail toneBlue
class node_buyer_actions,node_checkout,node_order_confirmation,node_order_storage toneAmber
class node_studio_login,node_studio_dashboard,node_studio_profile,node_studio_listings,node_studio_orders toneMint
class node_api_client,node_server,node_craft_service,node_product_service,node_artisan_service,node_order_service,node_community_service toneRose
class node_sqlite,node_schema,node_seeds,node_buyer_actor,node_artisan_actor toneIndigo
```

## Components

### Marketplace discovery

- [App routing](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home catalogue](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/HomePage.jsx): `frontend/src/pages/HomePage.jsx`
- [Craft collections](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/CraftCategoryPage.jsx): `frontend/src/pages/CraftCategoryPage.jsx`
- [Catalogue data](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/data/products.js): `frontend/src/data/products.js`
- [Product and maker detail](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/ProductRoutePlaceholder.jsx): `frontend/src/pages/ProductRoutePlaceholder.jsx`

### Buyer engagement

- [Buyer actions](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/components/BuyerActions.jsx): `frontend/src/components/BuyerActions.jsx`
- [Order checkout](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/OrderCheckoutPage.jsx): `frontend/src/pages/OrderCheckoutPage.jsx`
- [Order confirmation](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/OrderConfirmationPage.jsx): `frontend/src/pages/OrderConfirmationPage.jsx`
- [Local order cache](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/data/orderStorage.js): `frontend/src/data/orderStorage.js`

### Artisan studio

- [Artisan sign-in](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/ArtisanLogin.jsx): `frontend/src/pages/ArtisanLogin.jsx`
- [Studio dashboard](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/ArtisanDashboard.jsx): `frontend/src/pages/ArtisanDashboard.jsx`
- [Maker profile editor](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/components/ArtisanProfile.jsx): `frontend/src/components/ArtisanProfile.jsx`
- [Listing management](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/pages/ManageProducts.jsx): `frontend/src/pages/ManageProducts.jsx`
- [Order management](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/components/ArtisanOrders.jsx): `frontend/src/components/ArtisanOrders.jsx`

### API services

- [Frontend API client](https://github.com/thushara-bajimar/osco-2026/blob/main/frontend/src/data/artisanApi.js): `frontend/src/data/artisanApi.js`
- [Express API](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/server.js): `backend/src/server.js`
- [Craft endpoints](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/craftController.js): `backend/src/controllers/craftController.js`
- [Product endpoints](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/productController.js): `backend/src/controllers/productController.js`
- [Artisan endpoints](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/artisanController.js): `backend/src/controllers/artisanController.js`
- [Order endpoints](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/orderController.js): `backend/src/controllers/orderController.js`
- [Custom and support requests](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/controllers/communityController.js): `backend/src/controllers/communityController.js`

### SQLite persistence

- [SQLite database](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [Schema initialization](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/config/initDB.js): `backend/src/config/initDB.js`
- [Demo records](https://github.com/thushara-bajimar/osco-2026/blob/main/backend/src/config/seedDb.js): `backend/src/config/seedDb.js`

### Other components

- **Buyer**
- **Artisan**

## Connections

- Buyer → App routing: opens (evidence: `README.md`)
- App routing → Home catalogue: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Craft collections: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Product and maker detail: routes to (evidence: `frontend/src/App.jsx`)
- Home catalogue → Catalogue data: fallbacks to (evidence: `frontend/src/pages/HomePage.jsx`)
- Home catalogue → Frontend API client: fetches listings (evidence: `README.md`)
- Craft collections → Frontend API client: loads catalogue (evidence: `frontend/src/pages/CraftCategoryPage.jsx`)
- Product and maker detail → Buyer actions: renders (evidence: `frontend/src/pages/ProductRoutePlaceholder.jsx`)
- Product and maker detail → Frontend API client: loads product (evidence: `frontend/src/pages/ProductRoutePlaceholder.jsx`)
- Buyer actions → Frontend API client: submits intent
- App routing → Order checkout: routes to (evidence: `frontend/src/App.jsx`)
- Order checkout → Frontend API client: places order (evidence: `frontend/src/pages/OrderCheckoutPage.jsx`)
- Order checkout → Local order cache: saves order (evidence: `frontend/src/pages/OrderCheckoutPage.jsx`)
- App routing → Order confirmation: routes to (evidence: `frontend/src/App.jsx`)
- Order confirmation → Local order cache: reads order (evidence: `frontend/src/pages/OrderConfirmationPage.jsx`)
- Artisan → Artisan sign-in: signs in (evidence: `README.md`)
- App routing → Studio dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Studio dashboard → Frontend API client: loads studio data (evidence: `frontend/src/App.jsx`)
- Studio dashboard → Maker profile editor: edits profile (evidence: `README.md`)
- Studio dashboard → Listing management: manages listings (evidence: `README.md`)
- Studio dashboard → Order management: reviews orders (evidence: `frontend/src/pages/ArtisanDashboard.jsx`)
- Order management → Frontend API client: updates status (evidence: `frontend/src/components/ArtisanOrders.jsx`)
- Frontend API client → Express API: requests JSON (evidence: `README.md`)
- Express API → Craft endpoints: mounts routes (evidence: `backend/src/server.js`)
- Express API → Product endpoints: mounts routes (evidence: `backend/src/server.js`)
- Express API → Artisan endpoints: mounts routes (evidence: `backend/src/server.js`)
- Express API → Order endpoints: mounts routes (evidence: `backend/src/server.js`)
- Express API → Custom and support requests: mounts routes (evidence: `backend/src/server.js`)
- Product endpoints → SQLite database: reads and writes (evidence: `backend/src/controllers/productController.js`)
- Artisan endpoints → SQLite database: reads and writes (evidence: `backend/src/controllers/artisanController.js`)
- Order endpoints → SQLite database: records and updates (evidence: `backend/src/controllers/orderController.js`)
- Craft endpoints → SQLite database: queries (evidence: `backend/src/controllers/craftController.js`)
- Custom and support requests → SQLite database: stores requests (evidence: `README.md`)
- Express API → Schema initialization: initializes (evidence: `backend/src/server.js`)
- Express API → Demo records: seeds on startup (evidence: `backend/src/server.js`)
- Schema initialization → SQLite database: creates schema (evidence: `backend/src/config/initDB.js`)
- Demo records → SQLite database: inserts demo data (evidence: `backend/src/config/seedDb.js`)
