# khoipm23/jcap architecture

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

- Interactive diagram: https://gitdiagram.com/khoipm23/jcap
- Repository: https://github.com/khoipm23/jcap

## Overview

JCAP is a Japanese conversation-learning web platform. A learner enters through the web app, uses learning and practice features, and receives progress or assessment results; the tree shows distinct placement, roleplay, shadowing, learning-content, exploration, and account/credit areas. Backend controllers expose these areas, services implement domain behavior, and EF Core persists shared learner and content state. The excerpts show shadowing orchestration and review data flow; other feature links are limited where source evidence was not supplied.

Main entry points: [`Services/Implementations/ShadowingSessionReviewService.cs`](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ShadowingSessionReviewService.cs) (Session AI review), [`Controllers/ShadowingController.cs`](https://github.com/khoipm23/jcap/blob/main/Controllers/ShadowingController.cs) (Shadowing API), [`Data/AppDbContext.cs`](https://github.com/khoipm23/jcap/blob/main/Data/AppDbContext.cs) (Application database), [`jcap-web/src/App.tsx`](https://github.com/khoipm23/jcap/blob/main/jcap-web/src/App.tsx) (Learner experience)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Learner web app"]
  node_webapp["Learner experience<br/>[App.tsx]"]
  node_webservices["Web API clients"]
end

subgraph group_api["HTTP API"]
  node_placementapi["Placement API"]
  node_roleplayapi["Roleplay API"]
  node_shadowapi["Shadowing API"]
  node_learningapi["Learning APIs"]
  node_exploreapi["Explore API"]
end

subgraph group_learning["Learning services"]
  node_learning["Learning content"]
  node_explore["Japan exploration<br/>[ExploreService.cs]"]
end

subgraph group_practice["Practice and assessment"]
  node_placement["Placement assessment"]
  node_roleplay["AI roleplay sessions"]
  node_shadowing["Shadowing practice"]
  node_shadowreview["Session AI review"]
  node_shadowinsights["Session insights"]
end

subgraph group_platform["Accounts and persistence"]
  node_accounts["Identity and credits<br/>[AuthController.cs]"]
  node_credits["Credit management<br/>[CreditService.cs]"]
  node_database[("Application database<br/>[AppDbContext.cs]")]
  node_ai["AI client<br/>[IAiClient.cs]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_webapp
node_webapp -.->|"requests data"| node_webservices
node_shadowapi -->|"delegates practice"| node_shadowing
node_shadowapi -->|"builds summaries"| node_shadowinsights
node_shadowapi -->|"requests review"| node_shadowreview
node_shadowreview -->|"reads session data"| node_database
node_shadowreview -->|"builds summary"| node_shadowinsights
node_shadowreview -->|"generates review"| node_ai
node_placementapi -.->|"runs assessment"| node_placement
node_roleplayapi -.->|"runs sessions"| node_roleplay
node_learningapi -.->|"serves learning"| node_learning
node_exploreapi -.->|"serves exploration"| node_explore
node_accounts -.->|"persists identity"| node_database
node_credits -.->|"stores transactions"| node_database

click node_webapp "https://github.com/khoipm23/jcap/blob/main/jcap-web/src/App.tsx"
click node_webservices "https://github.com/khoipm23/jcap/tree/main/jcap-web/src/services"
click node_placementapi "https://github.com/khoipm23/jcap/blob/main/Controllers/PlacementTestController.cs"
click node_roleplayapi "https://github.com/khoipm23/jcap/blob/main/Controllers/RoleplayController.cs"
click node_shadowapi "https://github.com/khoipm23/jcap/blob/main/Controllers/ShadowingController.cs"
click node_learningapi "https://github.com/khoipm23/jcap/blob/main/Controllers/LearnerLearningController.cs"
click node_exploreapi "https://github.com/khoipm23/jcap/blob/main/Controllers/ExploreController.cs"
click node_placement "https://github.com/khoipm23/jcap/blob/main/Services/Implementations/PlacementAssessmentEngine.cs"
click node_roleplay "https://github.com/khoipm23/jcap/blob/main/Services/Implementations/RoleplaySessionService.cs"
click node_shadowing "https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ShadowingService.cs"
click node_shadowreview "https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ShadowingSessionReviewService.cs"
click node_shadowinsights "https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ShadowingSessionInsightsService.cs"
click node_learning "https://github.com/khoipm23/jcap/blob/main/Services/Implementations/LearnerLearningService.cs"
click node_explore "https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ExploreService.cs"
click node_accounts "https://github.com/khoipm23/jcap/blob/main/Controllers/AuthController.cs"
click node_credits "https://github.com/khoipm23/jcap/blob/main/Services/Implementations/CreditService.cs"
click node_database "https://github.com/khoipm23/jcap/blob/main/Data/AppDbContext.cs"
click node_ai "https://github.com/khoipm23/jcap/blob/main/Services/Interfaces/IAiClient.cs"

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_webservices toneBlue
class node_placementapi,node_roleplayapi,node_shadowapi,node_learningapi,node_exploreapi toneAmber
class node_learning,node_explore toneMint
class node_placement,node_roleplay,node_shadowing,node_shadowreview,node_shadowinsights toneRose
class node_accounts,node_credits,node_database,node_ai,node_learner toneIndigo
```

## Components

### Learner web app

- [Learner experience](https://github.com/khoipm23/jcap/blob/main/jcap-web/src/App.tsx): `jcap-web/src/App.tsx`
- [Web API clients](https://github.com/khoipm23/jcap/tree/main/jcap-web/src/services): `jcap-web/src/services`

### HTTP API

- [Placement API](https://github.com/khoipm23/jcap/blob/main/Controllers/PlacementTestController.cs): `Controllers/PlacementTestController.cs`
- [Roleplay API](https://github.com/khoipm23/jcap/blob/main/Controllers/RoleplayController.cs): `Controllers/RoleplayController.cs`
- [Shadowing API](https://github.com/khoipm23/jcap/blob/main/Controllers/ShadowingController.cs): `Controllers/ShadowingController.cs`
- [Learning APIs](https://github.com/khoipm23/jcap/blob/main/Controllers/LearnerLearningController.cs): `Controllers/LearnerLearningController.cs`
- [Explore API](https://github.com/khoipm23/jcap/blob/main/Controllers/ExploreController.cs): `Controllers/ExploreController.cs`

### Learning services

- [Learning content](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/LearnerLearningService.cs): `Services/Implementations/LearnerLearningService.cs`
- [Japan exploration](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ExploreService.cs): `Services/Implementations/ExploreService.cs`

### Practice and assessment

- [Placement assessment](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/PlacementAssessmentEngine.cs): `Services/Implementations/PlacementAssessmentEngine.cs`
- [AI roleplay sessions](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/RoleplaySessionService.cs): `Services/Implementations/RoleplaySessionService.cs`
- [Shadowing practice](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ShadowingService.cs): `Services/Implementations/ShadowingService.cs`
- [Session AI review](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ShadowingSessionReviewService.cs): `Services/Implementations/ShadowingSessionReviewService.cs`
- [Session insights](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/ShadowingSessionInsightsService.cs): `Services/Implementations/ShadowingSessionInsightsService.cs`

### Accounts and persistence

- [Identity and credits](https://github.com/khoipm23/jcap/blob/main/Controllers/AuthController.cs): `Controllers/AuthController.cs`
- [Credit management](https://github.com/khoipm23/jcap/blob/main/Services/Implementations/CreditService.cs): `Services/Implementations/CreditService.cs`
- [Application database](https://github.com/khoipm23/jcap/blob/main/Data/AppDbContext.cs): `Data/AppDbContext.cs`
- [AI client](https://github.com/khoipm23/jcap/blob/main/Services/Interfaces/IAiClient.cs): `Services/Interfaces/IAiClient.cs`

### Other components

- **Learner**

## Connections

- Learner → Learner experience: uses (evidence: `README.md`)
- Learner experience → Web API clients: requests data
- Shadowing API → Shadowing practice: delegates practice (evidence: `Controllers/ShadowingController.cs`)
- Shadowing API → Session insights: builds summaries (evidence: `Controllers/ShadowingController.cs`)
- Shadowing API → Session AI review: requests review (evidence: `Controllers/ShadowingController.cs`)
- Session AI review → Application database: reads session data (evidence: `Services/Implementations/ShadowingSessionReviewService.cs`)
- Session AI review → Session insights: builds summary (evidence: `Services/Implementations/ShadowingSessionReviewService.cs`)
- Session AI review → AI client: generates review (evidence: `Services/Implementations/ShadowingSessionReviewService.cs`)
- Placement API → Placement assessment: runs assessment
- Roleplay API → AI roleplay sessions: runs sessions
- Learning APIs → Learning content: serves learning
- Explore API → Japan exploration: serves exploration
- Identity and credits → Application database: persists identity
- Credit management → Application database: stores transactions
