2026-12-03 00:16:47 +03:00
|
|
|
# Architecture
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
web (Next.js static export, nginx) -> api (Spring Boot, :8002/api-vocab) -> MySQL
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## API (`api/`)
|
|
|
|
|
`controller` -> `service` -> `repository` -> `entity`. Request and response records are in `dto`.
|
|
|
|
|
|
|
|
|
|
- **Word**: English word, Turkish translation, level, synonym, sentence, notes.
|
|
|
|
|
- **Quiz**: belongs to a user; has a level and a `quizType` (`TYPING` or `MULTIPLE_CHOICE`; empty means `TYPING`).
|
|
|
|
|
- **QAPair**: one question of a quiz. `choiceOptions` stores the 4 options of a multiple-choice question, one per line.
|
|
|
|
|
|
|
|
|
|
Hibernate (`ddl-auto=update`) adds new columns at startup.
|
|
|
|
|
|
|
|
|
|
## Web (`web/src/app/`)
|
|
|
|
|
- `redux/`: one slice per API area.
|
|
|
|
|
- `quiz/useQuizQuestion.js`: question flow (load, answer, hint, next) shared by `quiz/question` (typing) and `quiz/multiple-choice`.
|
|
|
|
|
- `quiz/quizPath.js`: selects the question page by quiz type.
|
|
|
|
|
- `util/AppTable.js`: shared table with search.
|