# owasp/crapi architecture

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

- Interactive diagram: https://gitdiagram.com/owasp/crapi
- Repository: https://github.com/owasp/crapi

## Overview

crAPI is a deliberately vulnerable, microservices-based vehicle-owner application for API security education. Its user journey spans account access, vehicle and profile management, workshop service requests and reports, shopping, and community features; a chatbot/MCP service adds conversational access to application context. The map includes those documented product areas and the gateway, but several service-to-service and web-to-backend links cannot be verified from the sampled excerpts, so they are omitted or marked dashed with no evidence path.

Main entry points: [`services/workshop/crapi/urls.py`](https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/urls.py) (Workshop API), [`services/gateway-service/main.go`](https://github.com/owasp/crapi/blob/develop/services/gateway-service/main.go) (API gateway), [`services/identity/src/main/java/com/crapi/controller/AuthController.java`](https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/controller/AuthController.java) (Authentication API), [`services/community/api/router/routes.go`](https://github.com/owasp/crapi/blob/develop/services/community/api/router/routes.go) (Community API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web application<br/>[index.tsx]"]
  node_webactions["User actions<br/>[userActions.ts]"]
  node_serviceview["Service report view<br/>[serviceReport.tsx]"]
  node_requestview["Mechanic request view"]
end

subgraph group_identity["Identity and vehicles"]
  node_auth["Authentication API"]
  node_userservice["User services<br/>[UserService.java]"]
  node_userrecord[("User records<br/>[User.java]")]
  node_profileapi["Profile API"]
  node_profileservice["Profile services"]
  node_vehicleapi["Vehicle API"]
end

subgraph group_workshop["Workshop services"]
  node_workshopapi["Workshop API<br/>[urls.py]"]
  node_mechanic[("Mechanic requests<br/>[models.py]")]
  node_shop[("Shop and orders<br/>[models.py]")]
  node_workshopuser[("Workshop users<br/>[models.py]")]
end

subgraph group_community["Community"]
  node_communityapi["Community API<br/>[routes.go]"]
  node_posts["Posts and coupons<br/>[post_controller.go]"]
end

subgraph group_assistant["Chat assistant"]
  node_chatapi["Chat API<br/>[chat_api.py]"]
  node_sessions[("Chat sessions<br/>[session_service.py]")]
  node_mcp["MCP tools<br/>[server.py]"]
end

node_owner(("Vehicle owner"))
node_gateway["API gateway<br/>[main.go]"]

node_owner -->|"uses"| node_webapp
node_webapp -.->|"requests API"| node_gateway
node_gateway -.->|"routes to"| node_auth
node_gateway -.->|"routes to"| node_workshopapi
node_gateway -.->|"routes to"| node_communityapi
node_webapp -.->|"dispatches"| node_webactions
node_webactions -->|"loads data"| node_serviceview
node_serviceview -.->|"related report UI"| node_requestview
node_auth -->|"calls"| node_userservice
node_userservice -->|"uses"| node_userrecord
node_profileapi -->|"uses"| node_profileservice
node_owner -->|"signs up"| node_auth
node_owner -.->|"manages vehicle"| node_vehicleapi
node_workshopapi -.->|"serves requests"| node_mechanic
node_workshopapi -.->|"serves orders"| node_shop
node_workshopapi -.->|"uses records"| node_workshopuser
node_owner -.->|"uses community"| node_communityapi
node_communityapi -->|"routes requests"| node_posts
node_mcp -->|"requests API key"| node_auth
node_mcp -->|"fetches posts"| node_communityapi
node_chatapi -.->|"uses sessions"| node_sessions

click node_webapp "https://github.com/owasp/crapi/blob/develop/services/web/src/index.tsx"
click node_webactions "https://github.com/owasp/crapi/blob/develop/services/web/src/actions/userActions.ts"
click node_serviceview "https://github.com/owasp/crapi/blob/develop/services/web/src/containers/serviceReport/serviceReport.tsx"
click node_requestview "https://github.com/owasp/crapi/blob/develop/services/web/src/components/mechanicServiceRequest/mechanicServiceRequest.tsx"
click node_gateway "https://github.com/owasp/crapi/blob/develop/services/gateway-service/main.go"
click node_auth "https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/controller/AuthController.java"
click node_userservice "https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/service/UserService.java"
click node_userrecord "https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/entity/User.java"
click node_profileapi "https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/controller/ProfileController.java"
click node_profileservice "https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/service/ProfileService.java"
click node_vehicleapi "https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/service/VehicleService.java"
click node_workshopapi "https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/urls.py"
click node_mechanic "https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/mechanic/models.py"
click node_shop "https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/shop/models.py"
click node_workshopuser "https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/user/models.py"
click node_communityapi "https://github.com/owasp/crapi/blob/develop/services/community/api/router/routes.go"
click node_posts "https://github.com/owasp/crapi/blob/develop/services/community/api/controllers/post_controller.go"
click node_chatapi "https://github.com/owasp/crapi/blob/develop/services/chatbot/src/chatbot/chat_api.py"
click node_sessions "https://github.com/owasp/crapi/blob/develop/services/chatbot/src/chatbot/session_service.py"
click node_mcp "https://github.com/owasp/crapi/blob/develop/services/chatbot/src/mcpserver/server.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_webactions,node_serviceview,node_requestview toneBlue
class node_auth,node_userservice,node_userrecord,node_profileapi,node_profileservice,node_vehicleapi toneAmber
class node_workshopapi,node_mechanic,node_shop,node_workshopuser,node_gateway toneMint
class node_communityapi,node_posts toneRose
class node_chatapi,node_sessions,node_mcp,node_owner toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/owasp/crapi/blob/develop/services/web/src/index.tsx): `services/web/src/index.tsx`
- [User actions](https://github.com/owasp/crapi/blob/develop/services/web/src/actions/userActions.ts): `services/web/src/actions/userActions.ts`
- [Service report view](https://github.com/owasp/crapi/blob/develop/services/web/src/containers/serviceReport/serviceReport.tsx): `services/web/src/containers/serviceReport/serviceReport.tsx`
- [Mechanic request view](https://github.com/owasp/crapi/blob/develop/services/web/src/components/mechanicServiceRequest/mechanicServiceRequest.tsx): `services/web/src/components/mechanicServiceRequest/mechanicServiceRequest.tsx`

### Identity and vehicles

- [Authentication API](https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/controller/AuthController.java): `services/identity/src/main/java/com/crapi/controller/AuthController.java`
- [User services](https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/service/UserService.java): `services/identity/src/main/java/com/crapi/service/UserService.java`
- [User records](https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/entity/User.java): `services/identity/src/main/java/com/crapi/entity/User.java`
- [Profile API](https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/controller/ProfileController.java): `services/identity/src/main/java/com/crapi/controller/ProfileController.java`
- [Profile services](https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/service/ProfileService.java): `services/identity/src/main/java/com/crapi/service/ProfileService.java`
- [Vehicle API](https://github.com/owasp/crapi/blob/develop/services/identity/src/main/java/com/crapi/service/VehicleService.java): `services/identity/src/main/java/com/crapi/service/VehicleService.java`

### Workshop services

- [Workshop API](https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/urls.py): `services/workshop/crapi/urls.py`
- [Mechanic requests](https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/mechanic/models.py): `services/workshop/crapi/mechanic/models.py`
- [Shop and orders](https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/shop/models.py): `services/workshop/crapi/shop/models.py`
- [Workshop users](https://github.com/owasp/crapi/blob/develop/services/workshop/crapi/user/models.py): `services/workshop/crapi/user/models.py`

### Community

- [Community API](https://github.com/owasp/crapi/blob/develop/services/community/api/router/routes.go): `services/community/api/router/routes.go`
- [Posts and coupons](https://github.com/owasp/crapi/blob/develop/services/community/api/controllers/post_controller.go): `services/community/api/controllers/post_controller.go`

### Chat assistant

- [Chat API](https://github.com/owasp/crapi/blob/develop/services/chatbot/src/chatbot/chat_api.py): `services/chatbot/src/chatbot/chat_api.py`
- [Chat sessions](https://github.com/owasp/crapi/blob/develop/services/chatbot/src/chatbot/session_service.py): `services/chatbot/src/chatbot/session_service.py`
- [MCP tools](https://github.com/owasp/crapi/blob/develop/services/chatbot/src/mcpserver/server.py): `services/chatbot/src/mcpserver/server.py`

### Other components

- **Vehicle owner**
- [API gateway](https://github.com/owasp/crapi/blob/develop/services/gateway-service/main.go): `services/gateway-service/main.go`

## Connections

- Vehicle owner → Web application: uses (evidence: `README.md`)
- Web application → API gateway: requests API
- API gateway → Authentication API: routes to
- API gateway → Workshop API: routes to
- API gateway → Community API: routes to
- Web application → User actions: dispatches
- User actions → Service report view: loads data (evidence: `services/web/src/containers/serviceReport/serviceReport.tsx`)
- Service report view → Mechanic request view: related report UI
- Authentication API → User services: calls (evidence: `services/identity/src/main/java/com/crapi/controller/AuthController.java`)
- User services → User records: uses (evidence: `services/identity/src/main/java/com/crapi/service/UserService.java`)
- Profile API → Profile services: uses (evidence: `services/identity/src/main/java/com/crapi/controller/ProfileController.java`)
- Vehicle owner → Authentication API: signs up (evidence: `README.md`)
- Vehicle owner → Vehicle API: manages vehicle
- Workshop API → Mechanic requests: serves requests
- Workshop API → Shop and orders: serves orders
- Workshop API → Workshop users: uses records
- Vehicle owner → Community API: uses community
- Community API → Posts and coupons: routes requests (evidence: `services/community/api/router/routes.go`)
- MCP tools → Authentication API: requests API key (evidence: `services/chatbot/src/mcpserver/server.py`)
- MCP tools → Community API: fetches posts (evidence: `services/chatbot/src/mcpserver/server.py`)
- Chat API → Chat sessions: uses sessions
