# metehancihangir/soru-cozum architecture

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

- Interactive diagram: https://gitdiagram.com/metehancihangir/soru-cozum
- Repository: https://github.com/metehancihangir/soru-cozum

## Overview

#### Purpose and Entry Points
This is an Arabic exam-question practice application (“soru-cozum”) with a React/Vite client and ASP.NET Core API. The browser entry is `Frontend/src/main.jsx`, which mounts `Frontend/src/App.jsx`; the API host entry is `Backend/ArapcaSoruApi/ArapcaSoruApi/Program.cs`.

#### Frontend Application Shell
`Frontend/src/App.jsx` owns top-level screen composition and application state. `Frontend/src/components/HomeScreen.jsx` presents the selection/start experience, while `Frontend/src/App.css` and `Frontend/src/index.css` provide the implemented UI styling. The static design handoff in `finaldesign/index.html` and `finaldesign/quiz.html` is a reference/prototype boundary, not the React runtime.

#### Quiz Rendering and Interaction
`Frontend/src/components/QuestionCard.jsx` renders individual questions and answer interactions. Its state/answer behavior is separated into `Frontend/src/components/questionCard.logic.js`, allowing the UI to remain focused on display. The principal flow is: selected exam scope → API question payload → question card → local answer/result state.

#### Frontend-to-API Boundary
`Frontend/src/services/questionService.js` is the client-side HTTP boundary. React components should obtain question data through this service rather than directly coupling to API URLs or payload details. The frontend is a Node/Vite development and build runtime, with public question-image assets under `Frontend/public/images/`.

#### API and Question Delivery
`Backend/ArapcaSoruApi/ArapcaSoruApi/Controllers/QuestionsController.cs` defines the HTTP interface for retrieving questions. `Backend/ArapcaSoruApi/ArapcaSoruApi/Program.cs` configures the ASP.NET Core request pipeline, dependency injection, and runtime services. This API is the authoritative application boundary between the UI and persisted question metadata.

#### Persistence Model and Initialization
Entity Framework Core persistence is centered on `Backend/ArapcaSoruApi/ArapcaSoruApi/Data/AppDbContext.cs`, with the question schema in `Backend/ArapcaSoruApi/ArapcaSoruApi/Models/Question.cs`. `Backend/ArapcaSoruApi/ArapcaSoruApi/Data/DataSeeder.cs` initializes catalogued question records; EF migrations in `Backend/ArapcaSoruApi/ArapcaSoruApi/Migrations/` track schema evolution, including image-based questions and explanations.

#### Content Assets and Domain Taxonomy
Exam content is organized by Arabic course level, exam type, and year: `sorular/arapça-2/`, `sorular/arapça-4/`, and mirrored browser-serving assets in `Frontend/public/images/arapca-2/` and `Frontend/public/images/arapca-4/`. This taxonomy is architecturally significant: question records must align with the course/exam/year hierarchy and resolve image paths consistently across seed data, API payloads, and frontend rendering.

#### Supporting Design and Delivery Artifacts
`finaldesign/` contains a standalone visual implementation and design assets; `medium-design-zip/` and `medium-opendesign/` contain design-system exports. Product intent and phased work are documented in `product-vision-arabic-quiz.md`, `roadmap-arabic-quiz.md`, and `docs/tasks-faz1.md` through `docs/tasks-faz6.md`. API verification is supported by `scripts/phase6-api-smoke.ps1`.

Main entry points: [`Backend/ArapcaSoruApi/ArapcaSoruApi/Data/AppDbContext.cs`](https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Data/AppDbContext.cs) (Question persistence), [`Frontend/src/components/QuestionCard.jsx`](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/components/QuestionCard.jsx) (Question card), [`Frontend/src/App.jsx`](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/App.jsx) (Application shell), [`Frontend/src/services/questionService.js`](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/services/questionService.js) (Question service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React Client"]
  node_browser(("Browser<br/>runtime"))
  node_main["React entry<br/>Vite entry<br/>[main.jsx]"]
  node_app["Application shell<br/>React state<br/>[App.jsx]"]
  node_home["Start selection<br/>React component<br/>[HomeScreen.jsx]"]
  node_question_card["Question card<br/>React component<br/>[QuestionCard.jsx]"]
  node_question_logic["Answer state<br/>UI logic"]
  node_question_service{{"Question service<br/>HTTP client<br/>[questionService.js]"}}
  node_image_assets["Browser question images<br/>static assets"]
end

subgraph group_api["ASP.NET Core API"]
  node_program["API host<br/>ASP.NET Core host<br/>[Program.cs]"]
  node_questions_controller{{"Questions endpoint<br/>HTTP controller"}}
  node_db_context[("Question persistence<br/>EF Core context<br/>[AppDbContext.cs]")]
  node_question_model["Question schema<br/>EF entity<br/>[Question.cs]"]
  node_seeder["Catalog seeder<br/>data initialization<br/>[DataSeeder.cs]"]
  node_migrations["Schema migrations<br/>EF migrations"]
end

subgraph group_content["Question Content"]
  node_source_content["Arabic 2 catalog<br/>content hierarchy"]
  node_source_content_4["Arabic 4 catalog<br/>content hierarchy"]
end

node_prototype["Design prototype<br/>static reference"]

node_browser -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_app -->|"shows selection"| node_home
node_app -->|"renders quiz"| node_question_card
node_home -->|"selected scope"| node_question_service
node_question_service -->|"HTTP question request"| node_questions_controller
node_questions_controller -->|"queries"| node_db_context
node_db_context -->|"persists"| node_question_model
node_program -->|"hosts"| node_questions_controller
node_program -->|"configures DI"| node_db_context
node_question_service -->|"question payload"| node_question_card
node_question_card -->|"answer behavior"| node_question_logic
node_question_card -->|"renders image paths"| node_image_assets
node_seeder -->|"initializes records"| node_db_context
node_migrations -->|"evolves schema"| node_db_context
node_source_content -.->|"catalog taxonomy"| node_seeder
node_source_content_4 -.->|"catalog taxonomy"| node_seeder
node_source_content -.->|"mirrored assets"| node_image_assets
node_source_content_4 -.->|"mirrored assets"| node_image_assets

click node_main "https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/main.jsx"
click node_app "https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/App.jsx"
click node_home "https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/components/HomeScreen.jsx"
click node_question_card "https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/components/QuestionCard.jsx"
click node_question_logic "https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/components/questionCard.logic.js"
click node_question_service "https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/services/questionService.js"
click node_image_assets "https://github.com/metehancihangir/soru-cozum/tree/main/Frontend/public/images"
click node_program "https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Program.cs"
click node_questions_controller "https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Controllers/QuestionsController.cs"
click node_db_context "https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Data/AppDbContext.cs"
click node_question_model "https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Models/Question.cs"
click node_seeder "https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Data/DataSeeder.cs"
click node_migrations "https://github.com/metehancihangir/soru-cozum/tree/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Migrations"
click node_source_content "https://github.com/metehancihangir/soru-cozum/tree/main/sorular/arap%C3%A7a-2"
click node_source_content_4 "https://github.com/metehancihangir/soru-cozum/tree/main/sorular/arap%C3%A7a-4"
click node_prototype "https://github.com/metehancihangir/soru-cozum/tree/main/finaldesign"

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_browser,node_main,node_app,node_home,node_question_card,node_question_logic,node_question_service,node_image_assets toneBlue
class node_program,node_questions_controller,node_db_context,node_question_model,node_seeder,node_migrations toneAmber
class node_source_content,node_source_content_4 toneMint
class node_prototype toneNeutral
```

## Components

### React Client

- **Browser**: runtime
- [React entry](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/main.jsx): Vite entry · `Frontend/src/main.jsx`
- [Application shell](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/App.jsx): React state · Composes screens and owns top-level application state. · `Frontend/src/App.jsx`
- [Start selection](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/components/HomeScreen.jsx): React component · `Frontend/src/components/HomeScreen.jsx`
- [Question card](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/components/QuestionCard.jsx): React component · `Frontend/src/components/QuestionCard.jsx`
- [Answer state](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/components/questionCard.logic.js): UI logic · Keeps answer and result behavior outside rendering. · `Frontend/src/components/questionCard.logic.js`
- [Question service](https://github.com/metehancihangir/soru-cozum/blob/main/Frontend/src/services/questionService.js): HTTP client · Frontend boundary for question API payloads. · `Frontend/src/services/questionService.js`
- [Browser question images](https://github.com/metehancihangir/soru-cozum/tree/main/Frontend/public/images): static assets · `Frontend/public/images`

### ASP.NET Core API

- [API host](https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Program.cs): ASP.NET Core host · Configures request pipeline, DI, and runtime services. · `Backend/ArapcaSoruApi/ArapcaSoruApi/Program.cs`
- [Questions endpoint](https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Controllers/QuestionsController.cs): HTTP controller · Retrieves question payloads for the client. · `Backend/ArapcaSoruApi/ArapcaSoruApi/Controllers/QuestionsController.cs`
- [Question persistence](https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Data/AppDbContext.cs): EF Core context · `Backend/ArapcaSoruApi/ArapcaSoruApi/Data/AppDbContext.cs`
- [Question schema](https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Models/Question.cs): EF entity · `Backend/ArapcaSoruApi/ArapcaSoruApi/Models/Question.cs`
- [Catalog seeder](https://github.com/metehancihangir/soru-cozum/blob/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Data/DataSeeder.cs): data initialization · Initializes question records aligned to the content taxonomy. · `Backend/ArapcaSoruApi/ArapcaSoruApi/Data/DataSeeder.cs`
- [Schema migrations](https://github.com/metehancihangir/soru-cozum/tree/main/Backend/ArapcaSoruApi/ArapcaSoruApi/Migrations): EF migrations · Tracks schema evolution for images and explanations. · `Backend/ArapcaSoruApi/ArapcaSoruApi/Migrations`

### Question Content

- [Arabic 2 catalog](https://github.com/metehancihangir/soru-cozum/tree/main/sorular/arap%C3%A7a-2): content hierarchy · Course, exam type, and year organized question content. · `sorular/arapça-2`
- [Arabic 4 catalog](https://github.com/metehancihangir/soru-cozum/tree/main/sorular/arap%C3%A7a-4): content hierarchy · `sorular/arapça-4`

### Other components

- [Design prototype](https://github.com/metehancihangir/soru-cozum/tree/main/finaldesign): static reference · Standalone design handoff; not part of the React runtime. · `finaldesign`

## Connections

- Browser → React entry: loads
- React entry → Application shell: mounts
- Application shell → Start selection: shows selection
- Application shell → Question card: renders quiz
- Start selection → Question service: selected scope
- Question service → Questions endpoint: HTTP question request
- Questions endpoint → Question persistence: queries
- Question persistence → Question schema: persists
- API host → Questions endpoint: hosts
- API host → Question persistence: configures DI
- Question service → Question card: question payload
- Question card → Answer state: answer behavior
- Question card → Browser question images: renders image paths
- Catalog seeder → Question persistence: initializes records
- Schema migrations → Question persistence: evolves schema
- Arabic 2 catalog → Catalog seeder: catalog taxonomy
- Arabic 4 catalog → Catalog seeder: catalog taxonomy
- Arabic 2 catalog → Browser question images: mirrored assets
- Arabic 4 catalog → Browser question images: mirrored assets
