# myahyazahid/autojurnal architecture

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

- Interactive diagram: https://gitdiagram.com/myahyazahid/autojurnal
- Repository: https://github.com/myahyazahid/autojurnal

## Overview

AutoJurnal converts a journal’s DOCX template into an editable rule profile, then checks uploaded manuscripts against that profile and returns annotated DOCX files with a summary. Users manage profiles, run single or batch checks, and review history; admins also manage accounts and optional AI settings. The README documents the wider checking and account capabilities; sampled excerpts show the API’s checking call and upload cleanup, but not every internal dispatch or persistence detail, so uncertain links are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/main.py) (FastAPI endpoints), [`frontend/src/App.tsx`](https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/App.tsx) (App and routes), [`backend/app/engine/layanan.py`](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/layanan.py) (Check orchestration), [`frontend/src/lib/api.ts`](https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_frontend["App and routes<br/>[App.tsx]"]
  node_checkpage["Manuscript check<br/>[CekNaskah.tsx]"]
  node_results["Results display<br/>[HasilCek.tsx]"]
  node_journalpage["Journal profiles<br/>[Jurnal.tsx]"]
  node_history["History views<br/>[Riwayat.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["Application API"]
  node_main["FastAPI endpoints<br/>[main.py]"]
end

subgraph group_rules["Template and checking engine"]
  node_template_extract["Template extraction<br/>[ekstrak.py]"]
  node_docmodel["DOCX model<br/>[docmodel.py]"]
  node_classify["Paragraph classification<br/>[klasifikasi.py]"]
  node_profile["Rule profile schema<br/>[profil.py]"]
  node_check_service["Check orchestration<br/>[layanan.py]"]
  node_checker["Rule checks<br/>[periksa.py]"]
  node_references["Citation checks<br/>[referensi.py]"]
  node_annotation["Word annotations<br/>[anotasi.py]"]
end

subgraph group_identity["Accounts and integrations"]
  node_auth["Authentication and roles<br/>[auth.py]"]
  node_ai_extract["AI template reader<br/>[ekstrak_ai.py]"]
  node_ai_narrative["Narrative AI checks<br/>[naratif.py]"]
  node_ai_client["AI client<br/>[klien.py]"]
end

subgraph group_state["Persistent data"]
  node_database[("SQLite data<br/>[db.py]")]
  node_template_files[("Template files<br/>[main.py]")]
  node_result_files[("Annotated files<br/>[main.py]")]
end

node_user(("User / admin"))
node_provider{{"OpenAI-compatible AI"}}
node_google{{"Google OAuth"}}

node_user -->|"uses"| node_frontend
node_frontend -->|"routes to"| node_checkpage
node_frontend -->|"routes to"| node_journalpage
node_frontend -->|"routes to"| node_history
node_frontend -->|"calls"| node_api_client
node_checkpage -->|"submits checks"| node_api_client
node_checkpage -->|"displays results"| node_results
node_journalpage -->|"manages profiles"| node_api_client
node_history -->|"loads history"| node_api_client
node_api_client -->|"HTTP requests"| node_main
node_main -->|"authenticates"| node_auth
node_main -->|"reads and writes"| node_database
node_main -->|"reads and writes"| node_template_files
node_main -->|"writes and deletes"| node_result_files
node_main -->|"extracts profile"| node_template_extract
node_main -->|"checks manuscript"| node_check_service
node_template_extract -->|"models DOCX"| node_docmodel
node_template_extract -->|"classifies content"| node_classify
node_template_extract -->|"produces rules"| node_profile
node_check_service -->|"runs rule checks"| node_checker
node_check_service -->|"checks citations"| node_references
node_check_service -->|"adds Word comments"| node_annotation
node_main -.->|"optionally reads template"| node_ai_extract
node_check_service -.->|"optionally assesses content"| node_ai_narrative
node_ai_extract -->|"requests completion"| node_ai_client
node_ai_narrative -->|"requests completion"| node_ai_client
node_ai_client -.->|"sends prompts"| node_provider
node_auth -.->|"OAuth exchange"| node_google

click node_frontend "https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/App.tsx"
click node_checkpage "https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/pages/CekNaskah.tsx"
click node_results "https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/components/HasilCek.tsx"
click node_journalpage "https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/pages/Jurnal.tsx"
click node_history "https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/pages/Riwayat.tsx"
click node_api_client "https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/lib/api.ts"
click node_main "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/main.py"
click node_auth "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/auth.py"
click node_template_extract "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/ekstrak.py"
click node_docmodel "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/docmodel.py"
click node_classify "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/klasifikasi.py"
click node_profile "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/profil.py"
click node_check_service "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/layanan.py"
click node_checker "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/periksa.py"
click node_references "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/referensi.py"
click node_annotation "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/anotasi.py"
click node_ai_extract "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/ai/ekstrak_ai.py"
click node_ai_narrative "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/ai/naratif.py"
click node_ai_client "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/ai/klien.py"
click node_database "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/db.py"
click node_template_files "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/main.py"
click node_result_files "https://github.com/myahyazahid/autojurnal/blob/main/backend/app/main.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_frontend,node_checkpage,node_results,node_journalpage,node_history,node_api_client,node_user toneBlue
class node_main toneAmber
class node_template_extract,node_docmodel,node_classify,node_profile,node_check_service,node_checker,node_references,node_annotation toneMint
class node_auth,node_ai_extract,node_ai_narrative,node_ai_client toneRose
class node_database,node_template_files,node_result_files,node_provider,node_google toneIndigo
```

## Components

### Web interface

- [App and routes](https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Manuscript check](https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/pages/CekNaskah.tsx): `frontend/src/pages/CekNaskah.tsx`
- [Results display](https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/components/HasilCek.tsx): `frontend/src/components/HasilCek.tsx`
- [Journal profiles](https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/pages/Jurnal.tsx): `frontend/src/pages/Jurnal.tsx`
- [History views](https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/pages/Riwayat.tsx): `frontend/src/pages/Riwayat.tsx`
- [API client](https://github.com/myahyazahid/autojurnal/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### Application API

- [FastAPI endpoints](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/main.py): `backend/app/main.py`

### Template and checking engine

- [Template extraction](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/ekstrak.py): `backend/app/engine/ekstrak.py`
- [DOCX model](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/docmodel.py): `backend/app/engine/docmodel.py`
- [Paragraph classification](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/klasifikasi.py): `backend/app/engine/klasifikasi.py`
- [Rule profile schema](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/profil.py): `backend/app/engine/profil.py`
- [Check orchestration](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/layanan.py): `backend/app/engine/layanan.py`
- [Rule checks](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/periksa.py): `backend/app/engine/periksa.py`
- [Citation checks](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/referensi.py): `backend/app/engine/referensi.py`
- [Word annotations](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/engine/anotasi.py): `backend/app/engine/anotasi.py`

### Accounts and integrations

- [Authentication and roles](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [AI template reader](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/ai/ekstrak_ai.py): `backend/app/ai/ekstrak_ai.py`
- [Narrative AI checks](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/ai/naratif.py): `backend/app/ai/naratif.py`
- [AI client](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/ai/klien.py): `backend/app/ai/klien.py`

### Persistent data

- [SQLite data](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/db.py): `backend/app/db.py`
- [Template files](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/main.py): `backend/app/main.py`
- [Annotated files](https://github.com/myahyazahid/autojurnal/blob/main/backend/app/main.py): `backend/app/main.py`

### Other components

- **User / admin**
- **OpenAI-compatible AI**
- **Google OAuth**

## Connections

- User / admin → App and routes: uses
- App and routes → Manuscript check: routes to
- App and routes → Journal profiles: routes to
- App and routes → History views: routes to
- App and routes → API client: calls
- Manuscript check → API client: submits checks
- Manuscript check → Results display: displays results
- Journal profiles → API client: manages profiles
- History views → API client: loads history
- API client → FastAPI endpoints: HTTP requests
- FastAPI endpoints → Authentication and roles: authenticates
- FastAPI endpoints → SQLite data: reads and writes
- FastAPI endpoints → Template files: reads and writes
- FastAPI endpoints → Annotated files: writes and deletes
- FastAPI endpoints → Template extraction: extracts profile
- FastAPI endpoints → Check orchestration: checks manuscript
- Template extraction → DOCX model: models DOCX
- Template extraction → Paragraph classification: classifies content
- Template extraction → Rule profile schema: produces rules
- Check orchestration → Rule checks: runs rule checks
- Check orchestration → Citation checks: checks citations
- Check orchestration → Word annotations: adds Word comments
- FastAPI endpoints → AI template reader: optionally reads template
- Check orchestration → Narrative AI checks: optionally assesses content
- AI template reader → AI client: requests completion
- Narrative AI checks → AI client: requests completion
- AI client → OpenAI-compatible AI: sends prompts
- Authentication and roles → Google OAuth: OAuth exchange
