# garze05/okidokicr architecture

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

- Interactive diagram: https://gitdiagram.com/garze05/okidokicr
- Repository: https://github.com/garze05/okidokicr

## Overview

OkiDokiCR is a public services-catalog website with an administrator interface backed by an Express API. Visitors browse and search the catalog, then view service details; the sampled detail hook fetches service data from the API. Administrators authenticate, manage services and tags, and upload media. The backend routes requests through authentication and controllers to Prisma-backed storage. The README names the website and its stack but documents few capabilities; several front-end pages and API handlers were not sampled, so their internal links are left out.

Main entry points: [`api/src/app.js`](https://github.com/garze05/okidokicr/blob/main/api/src/app.js) (API router), [`api/src/routes/serviceRoutes.js`](https://github.com/garze05/okidokicr/blob/main/api/src/routes/serviceRoutes.js) (Service routes), [`src/components/admin/services/EditService.jsx`](https://github.com/garze05/okidokicr/blob/main/src/components/admin/services/EditService.jsx) (Service editor), [`api/src/routes/tagRoutes.js`](https://github.com/garze05/okidokicr/blob/main/api/src/routes/tagRoutes.js) (Tag routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public catalog"]
  node_catalog["Catalog browsing<br/>[CatalogPage.jsx]"]
  node_search["Search and filters<br/>[SearchBar.jsx]"]
  node_catalog_grid["Catalog grid<br/>[CatalogGrid.jsx]"]
  node_service_detail["Service detail<br/>[ServiceDetail.jsx]"]
  node_service_hook["Service data hook<br/>[useService.js]"]
end

subgraph group_admin["Admin interface"]
  node_admin_login["Admin login<br/>[login.astro]"]
  node_auth_client["Client auth<br/>[auth.js]"]
  node_dashboard["Admin dashboard<br/>[Dashboard.jsx]"]
  node_service_editor["Service editor<br/>[EditService.jsx]"]
  node_media_upload["Media upload<br/>[FileUpload.jsx]"]
  node_video_input["Video input<br/>[VideoInput.jsx]"]
  node_tag_admin["Tag management<br/>[AddTag.jsx]"]
end

subgraph group_api["API services"]
  node_api_app["API router<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_auth_controller["Authentication<br/>[authController.js]"]
  node_service_routes["Service routes<br/>[serviceRoutes.js]"]
  node_service_controller["Service operations"]
  node_tag_routes["Tag routes<br/>[tagRoutes.js]"]
  node_tag_controller["Tag operations<br/>[tagController.js]"]
  node_upload_routes["Upload routes<br/>[uploadRoutes.js]"]
  node_upload_controller["Upload handler"]
  node_auth_middleware["JWT middleware<br/>[authMiddleware.js]"]
end

subgraph group_data["Persistence and media"]
  node_database[("Prisma database<br/>[db.js]")]
  node_cloudinary[("Cloudinary media")]
end

node_visitor(("Visitor"))
node_admin_user(("Administrator"))

node_visitor -->|"browses"| node_catalog
node_catalog -->|"uses"| node_search
node_catalog -->|"renders"| node_catalog_grid
node_catalog_grid -->|"uses"| node_search
node_service_detail -->|"loads data"| node_service_hook
node_service_hook -->|"fetches service"| node_service_routes
node_admin_user -->|"signs in"| node_admin_login
node_admin_login -.->|"uses"| node_auth_client
node_auth_client -->|"posts credentials"| node_api_app
node_dashboard -.->|"manages services"| node_service_editor
node_service_editor -->|"uses"| node_media_upload
node_service_editor -->|"uses"| node_video_input
node_service_editor -->|"updates service"| node_service_routes
node_tag_admin -.->|"manages tags"| node_tag_routes
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_service_routes
node_api_app -->|"mounts"| node_tag_routes
node_api_app -->|"mounts"| node_upload_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_service_routes -->|"dispatches"| node_service_controller
node_tag_routes -->|"dispatches"| node_tag_controller
node_upload_routes -->|"dispatches"| node_upload_controller
node_service_routes -->|"protects writes"| node_auth_middleware
node_tag_routes -->|"protects writes"| node_auth_middleware
node_upload_routes -->|"requires token"| node_auth_middleware
node_service_controller -->|"reads and writes"| node_database
node_tag_controller -->|"reads and writes"| node_database
node_media_upload -.->|"uploads media"| node_cloudinary

click node_catalog "https://github.com/garze05/okidokicr/blob/main/src/components/landing/catalog/CatalogPage.jsx"
click node_search "https://github.com/garze05/okidokicr/blob/main/src/components/landing/catalog/SearchBar.jsx"
click node_catalog_grid "https://github.com/garze05/okidokicr/blob/main/src/components/landing/catalog/CatalogGrid.jsx"
click node_service_detail "https://github.com/garze05/okidokicr/blob/main/src/components/landing/catalog/ServiceDetail.jsx"
click node_service_hook "https://github.com/garze05/okidokicr/blob/main/src/hooks/useService.js"
click node_admin_login "https://github.com/garze05/okidokicr/blob/main/src/pages/admin/login.astro"
click node_auth_client "https://github.com/garze05/okidokicr/blob/main/src/utils/auth.js"
click node_dashboard "https://github.com/garze05/okidokicr/blob/main/src/components/admin/Dashboard.jsx"
click node_service_editor "https://github.com/garze05/okidokicr/blob/main/src/components/admin/services/EditService.jsx"
click node_media_upload "https://github.com/garze05/okidokicr/blob/main/src/components/admin/shared/FileUpload.jsx"
click node_video_input "https://github.com/garze05/okidokicr/blob/main/src/components/admin/shared/VideoInput.jsx"
click node_tag_admin "https://github.com/garze05/okidokicr/blob/main/src/components/admin/tags/AddTag.jsx"
click node_api_app "https://github.com/garze05/okidokicr/blob/main/api/src/app.js"
click node_auth_routes "https://github.com/garze05/okidokicr/blob/main/api/src/routes/authRoutes.js"
click node_auth_controller "https://github.com/garze05/okidokicr/blob/main/api/src/controllers/authController.js"
click node_service_routes "https://github.com/garze05/okidokicr/blob/main/api/src/routes/serviceRoutes.js"
click node_service_controller "https://github.com/garze05/okidokicr/blob/main/api/src/controllers/serviceController.js"
click node_tag_routes "https://github.com/garze05/okidokicr/blob/main/api/src/routes/tagRoutes.js"
click node_tag_controller "https://github.com/garze05/okidokicr/blob/main/api/src/controllers/tagController.js"
click node_upload_routes "https://github.com/garze05/okidokicr/blob/main/api/src/routes/uploadRoutes.js"
click node_upload_controller "https://github.com/garze05/okidokicr/blob/main/api/src/controllers/uploadController.js"
click node_auth_middleware "https://github.com/garze05/okidokicr/blob/main/api/src/middlewares/authMiddleware.js"
click node_database "https://github.com/garze05/okidokicr/blob/main/api/src/lib/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_catalog,node_search,node_catalog_grid,node_service_detail,node_service_hook toneBlue
class node_admin_login,node_auth_client,node_dashboard,node_service_editor,node_media_upload,node_video_input,node_tag_admin toneAmber
class node_api_app,node_auth_routes,node_auth_controller,node_service_routes,node_service_controller,node_tag_routes,node_tag_controller,node_upload_routes,node_upload_controller,node_auth_middleware toneMint
class node_database,node_cloudinary toneRose
class node_visitor,node_admin_user toneIndigo
```

## Components

### Public catalog

- [Catalog browsing](https://github.com/garze05/okidokicr/blob/main/src/components/landing/catalog/CatalogPage.jsx): `src/components/landing/catalog/CatalogPage.jsx`
- [Search and filters](https://github.com/garze05/okidokicr/blob/main/src/components/landing/catalog/SearchBar.jsx): `src/components/landing/catalog/SearchBar.jsx`
- [Catalog grid](https://github.com/garze05/okidokicr/blob/main/src/components/landing/catalog/CatalogGrid.jsx): `src/components/landing/catalog/CatalogGrid.jsx`
- [Service detail](https://github.com/garze05/okidokicr/blob/main/src/components/landing/catalog/ServiceDetail.jsx): `src/components/landing/catalog/ServiceDetail.jsx`
- [Service data hook](https://github.com/garze05/okidokicr/blob/main/src/hooks/useService.js): `src/hooks/useService.js`

### Admin interface

- [Admin login](https://github.com/garze05/okidokicr/blob/main/src/pages/admin/login.astro): `src/pages/admin/login.astro`
- [Client auth](https://github.com/garze05/okidokicr/blob/main/src/utils/auth.js): `src/utils/auth.js`
- [Admin dashboard](https://github.com/garze05/okidokicr/blob/main/src/components/admin/Dashboard.jsx): `src/components/admin/Dashboard.jsx`
- [Service editor](https://github.com/garze05/okidokicr/blob/main/src/components/admin/services/EditService.jsx): `src/components/admin/services/EditService.jsx`
- [Media upload](https://github.com/garze05/okidokicr/blob/main/src/components/admin/shared/FileUpload.jsx): `src/components/admin/shared/FileUpload.jsx`
- [Video input](https://github.com/garze05/okidokicr/blob/main/src/components/admin/shared/VideoInput.jsx): `src/components/admin/shared/VideoInput.jsx`
- [Tag management](https://github.com/garze05/okidokicr/blob/main/src/components/admin/tags/AddTag.jsx): `src/components/admin/tags/AddTag.jsx`

### API services

- [API router](https://github.com/garze05/okidokicr/blob/main/api/src/app.js): `api/src/app.js`
- [Auth routes](https://github.com/garze05/okidokicr/blob/main/api/src/routes/authRoutes.js): `api/src/routes/authRoutes.js`
- [Authentication](https://github.com/garze05/okidokicr/blob/main/api/src/controllers/authController.js): `api/src/controllers/authController.js`
- [Service routes](https://github.com/garze05/okidokicr/blob/main/api/src/routes/serviceRoutes.js): `api/src/routes/serviceRoutes.js`
- [Service operations](https://github.com/garze05/okidokicr/blob/main/api/src/controllers/serviceController.js): `api/src/controllers/serviceController.js`
- [Tag routes](https://github.com/garze05/okidokicr/blob/main/api/src/routes/tagRoutes.js): `api/src/routes/tagRoutes.js`
- [Tag operations](https://github.com/garze05/okidokicr/blob/main/api/src/controllers/tagController.js): `api/src/controllers/tagController.js`
- [Upload routes](https://github.com/garze05/okidokicr/blob/main/api/src/routes/uploadRoutes.js): `api/src/routes/uploadRoutes.js`
- [Upload handler](https://github.com/garze05/okidokicr/blob/main/api/src/controllers/uploadController.js): `api/src/controllers/uploadController.js`
- [JWT middleware](https://github.com/garze05/okidokicr/blob/main/api/src/middlewares/authMiddleware.js): `api/src/middlewares/authMiddleware.js`

### Persistence and media

- [Prisma database](https://github.com/garze05/okidokicr/blob/main/api/src/lib/db.js): `api/src/lib/db.js`
- **Cloudinary media**

### Other components

- **Visitor**
- **Administrator**

## Connections

- Visitor → Catalog browsing: browses (evidence: `README.md`)
- Catalog browsing → Search and filters: uses (evidence: `src/components/landing/catalog/CatalogPage.jsx`)
- Catalog browsing → Catalog grid: renders (evidence: `src/components/landing/catalog/CatalogPage.jsx`)
- Catalog grid → Search and filters: uses (evidence: `src/components/landing/catalog/CatalogGrid.jsx`)
- Service detail → Service data hook: loads data (evidence: `src/components/landing/catalog/ServiceDetail.jsx`)
- Service data hook → Service routes: fetches service (evidence: `src/hooks/useService.js`)
- Administrator → Admin login: signs in (evidence: `README.md`)
- Admin login → Client auth: uses
- Client auth → API router: posts credentials (evidence: `src/utils/auth.js`)
- Admin dashboard → Service editor: manages services
- Service editor → Media upload: uses (evidence: `src/components/admin/services/EditService.jsx`)
- Service editor → Video input: uses (evidence: `src/components/admin/services/EditService.jsx`)
- Service editor → Service routes: updates service (evidence: `src/components/admin/services/EditService.jsx`)
- Tag management → Tag routes: manages tags
- API router → Auth routes: mounts (evidence: `api/src/app.js`)
- API router → Service routes: mounts (evidence: `api/src/app.js`)
- API router → Tag routes: mounts (evidence: `api/src/app.js`)
- API router → Upload routes: mounts (evidence: `api/src/app.js`)
- Auth routes → Authentication: dispatches (evidence: `api/src/routes/authRoutes.js`)
- Service routes → Service operations: dispatches (evidence: `api/src/routes/serviceRoutes.js`)
- Tag routes → Tag operations: dispatches (evidence: `api/src/routes/tagRoutes.js`)
- Upload routes → Upload handler: dispatches (evidence: `api/src/routes/uploadRoutes.js`)
- Service routes → JWT middleware: protects writes (evidence: `api/src/routes/serviceRoutes.js`)
- Tag routes → JWT middleware: protects writes (evidence: `api/src/routes/tagRoutes.js`)
- Upload routes → JWT middleware: requires token (evidence: `api/src/routes/uploadRoutes.js`)
- Service operations → Prisma database: reads and writes (evidence: `api/src/controllers/serviceController.js`)
- Tag operations → Prisma database: reads and writes (evidence: `api/src/controllers/tagController.js`)
- Media upload → Cloudinary media: uploads media
