docs: add full project documentation

- Architecture: overview, 7 ADR, tech stack
- Principles: code-style, git-workflow, security
- API contracts: auth, profile, tests, admin endpoints
- Database schema: tables, relationships, indexes
- LLM strategy: prompts, fallback, validation, Qwen 2.5 14B
- Onboarding: setup, Docker, .env template
- Progress: roadmap, changelog
- Agents: context, backend instructions

Made-with: Cursor
This commit is contained in:
Anton
2026-03-04 12:07:17 +03:00
commit 99cd8ae727
21 changed files with 3763 additions and 0 deletions

108
principles/git-workflow.md Normal file
View File

@@ -0,0 +1,108 @@
# Git workflow
## Ветки
```text
main стабильная ветка, всегда deployable
dev текущая разработка (merge из feature-веток)
feat/<name> новый функционал
fix/<name> исправление бага
refactor/<name> рефакторинг без изменения поведения
chore/<name> инфраструктура, зависимости, CI
docs/<name> документация
```
### Правила
- `main` защищён — прямые коммиты запрещены
- Все изменения через Pull Request из feature-ветки в `dev`
- Merge `dev``main` при готовности к релизу
- Feature-ветка живёт не дольше 3-5 дней
## Conventional commits
Формат: `type: description`
| Тип | Когда |
| ----- | ------- |
| `feat` | Новый функционал |
| `fix` | Исправление бага |
| `refactor` | Рефакторинг без изменения поведения |
| `chore` | Зависимости, CI, конфигурация |
| `docs` | Документация |
| `test` | Добавление/изменение тестов |
| `style` | Форматирование (без изменения логики) |
Примеры:
```text
feat: add LLM question generation endpoint
fix: correct test score calculation for multiple-choice
chore: update drizzle-orm to 0.35
docs: add LLM module description
refactor: extract subscription middleware
test: add auth service unit tests
```
## Husky + lint-staged
```bash
npm install -D husky lint-staged
npx husky init
```
```json
// package.json
{
"lint-staged": {
"*.{ts,js}": ["eslint --fix", "prettier --write"],
"*.{json,md}": ["prettier --write"]
}
}
```
```bash
# .husky/pre-commit
npx lint-staged
```
## Commitlint
```bash
npm install -D @commitlint/cli @commitlint/config-conventional
```
```ts
// commitlint.config.ts
export default {
extends: ['@commitlint/config-conventional'],
}
```
```bash
# .husky/commit-msg
npx --no -- commitlint --edit $1
```
## Pull Request
### Чеклист перед PR
- [ ] Линтер проходит без ошибок
- [ ] Тесты проходят
- [ ] Нет `console.log` (только logger)
- [ ] Нет `any` без обоснования
- [ ] Коммиты соответствуют conventional commits
### Описание PR
```text
## Что сделано
<краткое описание изменений>
## Как тестировать
<шаги для проверки>
## Связанные задачи
<ссылки на issues если есть>
```