# meckss/foc architecture

> Architecture diagram of the GitHub repository meckss/foc, 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/meckss/foc
- Repository: https://github.com/meckss/foc

## Overview

FoC is documented as a campus errand platform with a closed credit economy: a student requests a pickup, another student fulfils and delivers it, and credits circulate within the platform. The repository names four service boundaries, but the sampled source only shows a starter frontend; service internals and inter-service wiring are not evidenced. The frontend page renders a button, and its layout wraps the page. Accordingly, the graph shows the documented product workflow separately from the known frontend behavior, without inventing service calls.

Main entry points: [`supplier-service`](https://github.com/meckss/foc/tree/main/supplier-service) (Store pickup), [`frontend-service/app/page.tsx`](https://github.com/meckss/foc/blob/main/frontend-service/app/page.tsx) (Starter home page), [`order-service`](https://github.com/meckss/foc/tree/main/order-service) (Errand request), [`frontend-service/app/layout.tsx`](https://github.com/meckss/foc/blob/main/frontend-service/app/layout.tsx) (Root layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_home["Starter home page<br/>[page.tsx]"]
  node_layout["Root layout<br/>[layout.tsx]"]
  node_button["Button component<br/>[button.tsx]"]
end

subgraph group_services["Service boundaries"]
  node_users["User service"]
  node_suppliers["Supplier service"]
  node_orders["Order service"]
  node_credits["Credit service"]
end

subgraph group_workflow["Errand workflow"]
  node_errand["Errand request"]
  node_pickup["Store pickup"]
  node_delivery["Campus delivery"]
  node_creditflow["Closed credit economy"]
end

node_requester(("Requesting student"))
node_fulfiller(("Fulfilling student"))

node_layout -->|"renders"| node_home
node_home -->|"renders"| node_button
node_requester -->|"requests"| node_errand
node_errand -->|"needs collection"| node_pickup
node_fulfiller -->|"fulfils"| node_pickup
node_pickup -->|"delivers"| node_delivery
node_creditflow -->|"credits circulate"| node_fulfiller

click node_home "https://github.com/meckss/foc/blob/main/frontend-service/app/page.tsx"
click node_layout "https://github.com/meckss/foc/blob/main/frontend-service/app/layout.tsx"
click node_button "https://github.com/meckss/foc/blob/main/frontend-service/components/ui/button.tsx"
click node_users "https://github.com/meckss/foc/tree/main/user-service"
click node_suppliers "https://github.com/meckss/foc/tree/main/supplier-service"
click node_orders "https://github.com/meckss/foc/tree/main/order-service"
click node_credits "https://github.com/meckss/foc/tree/main/credit-service"
click node_errand "https://github.com/meckss/foc/tree/main/order-service"
click node_pickup "https://github.com/meckss/foc/tree/main/supplier-service"
click node_delivery "https://github.com/meckss/foc/tree/main/order-service"
click node_creditflow "https://github.com/meckss/foc/tree/main/credit-service"

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_home,node_layout,node_button toneBlue
class node_users,node_suppliers,node_orders,node_credits toneAmber
class node_errand,node_pickup,node_delivery,node_creditflow,node_requester toneMint
class node_fulfiller toneIndigo
```

## Components

### Frontend

- [Starter home page](https://github.com/meckss/foc/blob/main/frontend-service/app/page.tsx): `frontend-service/app/page.tsx`
- [Root layout](https://github.com/meckss/foc/blob/main/frontend-service/app/layout.tsx): `frontend-service/app/layout.tsx`
- [Button component](https://github.com/meckss/foc/blob/main/frontend-service/components/ui/button.tsx): `frontend-service/components/ui/button.tsx`

### Service boundaries

- [User service](https://github.com/meckss/foc/tree/main/user-service): `user-service`
- [Supplier service](https://github.com/meckss/foc/tree/main/supplier-service): `supplier-service`
- [Order service](https://github.com/meckss/foc/tree/main/order-service): `order-service`
- [Credit service](https://github.com/meckss/foc/tree/main/credit-service): `credit-service`

### Errand workflow

- [Errand request](https://github.com/meckss/foc/tree/main/order-service): `order-service`
- [Store pickup](https://github.com/meckss/foc/tree/main/supplier-service): `supplier-service`
- [Campus delivery](https://github.com/meckss/foc/tree/main/order-service): `order-service`
- [Closed credit economy](https://github.com/meckss/foc/tree/main/credit-service): `credit-service`

### Other components

- **Requesting student**
- **Fulfilling student**

## Connections

- Root layout → Starter home page: renders
- Starter home page → Button component: renders
- Requesting student → Errand request: requests
- Errand request → Store pickup: needs collection
- Fulfilling student → Store pickup: fulfils
- Store pickup → Campus delivery: delivers
- Closed credit economy → Fulfilling student: credits circulate
