# grrlkk/feak architecture

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

- Interactive diagram: https://gitdiagram.com/grrlkk/feak
- Repository: https://github.com/grrlkk/feak

## Overview

FEAK is a Korean writing-assessment and evidence-grounded feedback application. A user submits an essay through the web interface; the backend analyzes linguistic cohesion and essay scores, stores and serves analysis results, and presents diagnostic evidence. The documented feedback path selects salient feature gaps for weak rubrics and uses them to constrain generated revision advice. The README also describes the analyzer’s semantic-and-feature scoring design. Some domain relationships below are documented capabilities rather than inspected runtime calls; unsampled implementation details are not inferred.

Main entry points: [`backend/apps/cohesion/process.py`](https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/process.py) (Cohesion processing), [`backend/main.py`](https://github.com/grrlkk/feak/blob/master/backend/main.py) (FastAPI app), [`frontend/src/App.js`](https://github.com/grrlkk/feak/blob/master/frontend/src/App.js) (Web app), [`backend/apps/routers.py`](https://github.com/grrlkk/feak/blob/master/backend/apps/routers.py) (Analysis routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Web app<br/>[App.js]"]
  node_essay_input["Essay input<br/>[TextInput.jsx]"]
  node_analysis_view["Analysis results"]
  node_analysis_format["Feature display<br/>[AnalysisFormat.jsx]"]
  node_morpheme_view["Morpheme display<br/>[SentenceFormat.jsx]"]
  node_feedback_view["Feedback view<br/>[Feedback.jsx]"]
end

subgraph group_api["API and persistence"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_api_routes["Analysis routes<br/>[routers.py]"]
  node_feedback_api["Feedback API<br/>[api.py]"]
  node_mongo[("MongoDB")]
end

subgraph group_analysis["Essay analysis"]
  node_cohesion["Cohesion processing<br/>[process.py]"]
  node_text_prep["Text preprocessing<br/>[textpreprocess.py]"]
  node_cohesion_features["Cohesion features<br/>[counter.py]"]
  node_essay_scoring["Essay scoring<br/>[essay_scoring.py]"]
  node_morph_analysis["Morphology analysis<br/>[bareun.py]"]
end

subgraph group_feedback["Evidence feedback"]
  node_diagnosis["Feature diagnosis<br/>[selector.py]"]
end

subgraph group_models["Language models"]
  node_sentence_model["Sentence embeddings"]
  node_morpheme_model["Morpheme translation<br/>[inference.py]"]
end

node_writer(("Essay writer"))

node_writer -->|"submits essay"| node_essay_input
node_app -->|"renders"| node_essay_input
node_app -->|"routes to"| node_analysis_view
node_app -->|"routes to"| node_feedback_view
node_analysis_view -->|"renders"| node_analysis_format
node_analysis_format -->|"renders"| node_morpheme_view
node_api_app -->|"registers"| node_api_routes
node_api_app -->|"registers"| node_feedback_api
node_api_app -->|"initializes models"| node_cohesion
node_api_routes -->|"processes essay"| node_cohesion
node_api_routes -->|"reads and writes"| node_mongo
node_api_app -->|"connects"| node_mongo
node_cohesion -->|"uses preprocessing"| node_text_prep
node_cohesion -->|"calculates features"| node_cohesion_features
node_cohesion -->|"scores essay"| node_essay_scoring
node_cohesion -->|"uses morphology"| node_morph_analysis
node_cohesion -.->|"encodes sentences"| node_sentence_model
node_morpheme_view -.->|"presents analysis"| node_morpheme_model
node_diagnosis -.->|"selects evidence"| node_cohesion_features
node_diagnosis -.->|"uses weak rubrics"| node_essay_scoring
node_feedback_api -.->|"prepares evidence"| node_diagnosis
node_feedback_view -.->|"requests feedback"| node_feedback_api
node_writer -.->|"reviews advice"| node_feedback_view

click node_app "https://github.com/grrlkk/feak/blob/master/frontend/src/App.js"
click node_essay_input "https://github.com/grrlkk/feak/blob/master/frontend/src/components/TextInput.jsx"
click node_analysis_view "https://github.com/grrlkk/feak/blob/master/frontend/src/pages/cohesion/ResultsCohesion.jsx"
click node_analysis_format "https://github.com/grrlkk/feak/blob/master/frontend/src/pages/cohesion/AnalysisFormat.jsx"
click node_morpheme_view "https://github.com/grrlkk/feak/blob/master/frontend/src/pages/morpheme/SentenceFormat.jsx"
click node_feedback_view "https://github.com/grrlkk/feak/blob/master/frontend/src/pages/Feedback.jsx"
click node_api_app "https://github.com/grrlkk/feak/blob/master/backend/main.py"
click node_api_routes "https://github.com/grrlkk/feak/blob/master/backend/apps/routers.py"
click node_feedback_api "https://github.com/grrlkk/feak/blob/master/backend/apps/feedback/api.py"
click node_cohesion "https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/process.py"
click node_text_prep "https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/textpreprocess.py"
click node_cohesion_features "https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/counter.py"
click node_essay_scoring "https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/essay_scoring/essay_scoring.py"
click node_morph_analysis "https://github.com/grrlkk/feak/blob/master/backend/apps/morph/bareun.py"
click node_diagnosis "https://github.com/grrlkk/feak/blob/master/backend/apps/feedback/selector.py"
click node_sentence_model "https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/sentence_transformers/SentenceTransformer.py"
click node_morpheme_model "https://github.com/grrlkk/feak/blob/master/backend/apps/morpheme/inference.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_app,node_essay_input,node_analysis_view,node_analysis_format,node_morpheme_view,node_feedback_view toneBlue
class node_api_app,node_api_routes,node_feedback_api,node_mongo toneAmber
class node_cohesion,node_text_prep,node_cohesion_features,node_essay_scoring,node_morph_analysis toneMint
class node_diagnosis toneRose
class node_sentence_model,node_morpheme_model,node_writer toneIndigo
```

## Components

### Web experience

- [Web app](https://github.com/grrlkk/feak/blob/master/frontend/src/App.js): `frontend/src/App.js`
- [Essay input](https://github.com/grrlkk/feak/blob/master/frontend/src/components/TextInput.jsx): `frontend/src/components/TextInput.jsx`
- [Analysis results](https://github.com/grrlkk/feak/blob/master/frontend/src/pages/cohesion/ResultsCohesion.jsx): `frontend/src/pages/cohesion/ResultsCohesion.jsx`
- [Feature display](https://github.com/grrlkk/feak/blob/master/frontend/src/pages/cohesion/AnalysisFormat.jsx): `frontend/src/pages/cohesion/AnalysisFormat.jsx`
- [Morpheme display](https://github.com/grrlkk/feak/blob/master/frontend/src/pages/morpheme/SentenceFormat.jsx): `frontend/src/pages/morpheme/SentenceFormat.jsx`
- [Feedback view](https://github.com/grrlkk/feak/blob/master/frontend/src/pages/Feedback.jsx): `frontend/src/pages/Feedback.jsx`

### API and persistence

- [FastAPI app](https://github.com/grrlkk/feak/blob/master/backend/main.py): `backend/main.py`
- [Analysis routes](https://github.com/grrlkk/feak/blob/master/backend/apps/routers.py): `backend/apps/routers.py`
- [Feedback API](https://github.com/grrlkk/feak/blob/master/backend/apps/feedback/api.py): `backend/apps/feedback/api.py`
- **MongoDB**

### Essay analysis

- [Cohesion processing](https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/process.py): `backend/apps/cohesion/process.py`
- [Text preprocessing](https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/textpreprocess.py): `backend/apps/cohesion/textpreprocess.py`
- [Cohesion features](https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/counter.py): `backend/apps/cohesion/counter.py`
- [Essay scoring](https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/essay_scoring/essay_scoring.py): `backend/apps/cohesion/essay_scoring/essay_scoring.py`
- [Morphology analysis](https://github.com/grrlkk/feak/blob/master/backend/apps/morph/bareun.py): `backend/apps/morph/bareun.py`

### Evidence feedback

- [Feature diagnosis](https://github.com/grrlkk/feak/blob/master/backend/apps/feedback/selector.py): `backend/apps/feedback/selector.py`

### Language models

- [Sentence embeddings](https://github.com/grrlkk/feak/blob/master/backend/apps/cohesion/sentence_transformers/SentenceTransformer.py): `backend/apps/cohesion/sentence_transformers/SentenceTransformer.py`
- [Morpheme translation](https://github.com/grrlkk/feak/blob/master/backend/apps/morpheme/inference.py): `backend/apps/morpheme/inference.py`

### Other components

- **Essay writer**

## Connections

- Essay writer → Essay input: submits essay
- Web app → Essay input: renders (evidence: `frontend/src/App.js`)
- Web app → Analysis results: routes to (evidence: `frontend/src/App.js`)
- Web app → Feedback view: routes to (evidence: `frontend/src/App.js`)
- Analysis results → Feature display: renders (evidence: `frontend/src/pages/cohesion/ResultsCohesion.jsx`)
- Feature display → Morpheme display: renders (evidence: `frontend/src/pages/cohesion/AnalysisFormat.jsx`)
- FastAPI app → Analysis routes: registers (evidence: `backend/main.py`)
- FastAPI app → Feedback API: registers (evidence: `backend/main.py`)
- FastAPI app → Cohesion processing: initializes models (evidence: `backend/main.py`)
- Analysis routes → Cohesion processing: processes essay (evidence: `backend/apps/routers.py`)
- Analysis routes → MongoDB: reads and writes (evidence: `backend/apps/routers.py`)
- FastAPI app → MongoDB: connects (evidence: `backend/main.py`)
- Cohesion processing → Text preprocessing: uses preprocessing (evidence: `backend/apps/cohesion/process.py`)
- Cohesion processing → Cohesion features: calculates features (evidence: `backend/apps/cohesion/process.py`)
- Cohesion processing → Essay scoring: scores essay (evidence: `backend/apps/cohesion/process.py`)
- Cohesion processing → Morphology analysis: uses morphology (evidence: `backend/apps/cohesion/process.py`)
- Cohesion processing → Sentence embeddings: encodes sentences
- Morpheme display → Morpheme translation: presents analysis
- Feature diagnosis → Cohesion features: selects evidence (evidence: `README.md`)
- Feature diagnosis → Essay scoring: uses weak rubrics (evidence: `README.md`)
- Feedback API → Feature diagnosis: prepares evidence (evidence: `README.md`)
- Feedback view → Feedback API: requests feedback (evidence: `README.md`)
- Essay writer → Feedback view: reviews advice (evidence: `README.md`)
