docs: fix historical files to new structure and update
All checks were successful
CI / ci (pull_request) Successful in 3m20s
CI / ci (push) Successful in 3m1s

This commit is contained in:
Sergey Krylov 2026-06-18 22:04:09 +03:00
parent dca8418843
commit 5b9d7f3a27
12 changed files with 42 additions and 49 deletions

View File

@ -54,5 +54,8 @@ apps/
frontend/ — React SPA with Vite frontend/ — React SPA with Vite
docs/ — Docusaurus documentation site docs/ — Docusaurus documentation site
docs/ docs/
superpowers/specs/ — accepted SDD specifications features/ — SDD feature specifications and implementation plans
epics/ — product epics
inbox.md — captured ideas and follow-ups
roadmap.md — planned epics and features
``` ```

View File

@ -1183,4 +1183,4 @@ Let me plan this properly in the implementation.<end▁of▁thinking>
<DSMLtool_calls> <DSMLtool_calls>
<DSMLinvoke name="todowrite"> <DSMLinvoke name="todowrite">
<DSMLparameter name="todos" string="false">[{"priority":"high","content":"Save implementation plan to docs/superpowers/plans/","status":"completed"},{"priority":"high","content":"Install backend dependencies (Prisma, JWT, bcrypt, cookie-parser)","status":"in_progress"},{"priority":"high","content":"Set up Prisma schema + PrismaService + PrismaModule","status":"pending"},{"priority":"high","content":"Build AuthService (register, login, refresh, logout) with TDD","status":"pending"},{"priority":"high","content":"Build Auth guards, decorators, DTOs, controller","status":"pending"},{"priority":"high","content":"Integrate AuthModule into app.module, main.ts, configuration","status":"pending"},{"priority":"high","content":"Frontend: refactor client.ts + add auth types","status":"pending"},{"priority":"high","content":"Frontend: AuthContext + useAuth hook","status":"pending"},{"priority":"high","content":"Frontend: Login, Register, Profile pages + ProtectedRoute","status":"pending"},{"priority":"high","content":"Frontend: Layout + routing changes","status":"pending"},{"priority":"high","content":"Documentation (backend auth.md, database.md, ADR, api.md, architecture.md)","status":"pending"},{"priority":"high","content":"Verification: run tests, lint, build","status":"pending"}] <DSMLparameter name="todos" string="false">[{"priority":"high","content":"Save implementation plan to docs/features/auth-system/plan.md","status":"completed"},{"priority":"high","content":"Install backend dependencies (Prisma, JWT, bcrypt, cookie-parser)","status":"in_progress"},{"priority":"high","content":"Set up Prisma schema + PrismaService + PrismaModule","status":"pending"},{"priority":"high","content":"Build AuthService (register, login, refresh, logout) with TDD","status":"pending"},{"priority":"high","content":"Build Auth guards, decorators, DTOs, controller","status":"pending"},{"priority":"high","content":"Integrate AuthModule into app.module, main.ts, configuration","status":"pending"},{"priority":"high","content":"Frontend: refactor client.ts + add auth types","status":"pending"},{"priority":"high","content":"Frontend: AuthContext + useAuth hook","status":"pending"},{"priority":"high","content":"Frontend: Login, Register, Profile pages + ProtectedRoute","status":"pending"},{"priority":"high","content":"Frontend: Layout + routing changes","status":"pending"},{"priority":"high","content":"Documentation (backend auth.md, database.md, ADR, api.md, architecture.md)","status":"pending"},{"priority":"high","content":"Verification: run tests, lint, build","status":"pending"}]

View File

@ -19,7 +19,7 @@
- `docker/Dockerfile.*`, `docker/nginx.conf` → инфраструктура - `docker/Dockerfile.*`, `docker/nginx.conf` → инфраструктура
- `docker-compose.yml` → сервисы, порты - `docker-compose.yml` → сервисы, порты
- `.gitea/workflows/ci.yml` → CI pipeline - `.gitea/workflows/ci.yml` → CI pipeline
- `docs/architecture/adr/*` → копия существующих ADR - `apps/docs/docs/adr/*` → опубликованные ADR проекта
- `.prettierrc`, `tsconfig.base.json` → конфиги - `.prettierrc`, `tsconfig.base.json` → конфиги
## Pages ## Pages

View File

@ -128,9 +128,10 @@ moex-vibe/
│ └── nginx.conf │ └── nginx.conf
├── docker-compose.yml ├── docker-compose.yml
└── docs/ └── docs/
├── architecture/adr/ ├── epics/
├── openapi/openapi.yaml ├── features/
└── superpowers/specs/2026-06-13-moex-vibe-design.md ├── inbox.md
└── roadmap.md
``` ```
--- ---
@ -3280,18 +3281,18 @@ git commit -m "feat: add StockPage and BondPage with charts and details"
- [ ] **Verify OpenAPI spec** — start backend, check Swagger UI at `/api/docs`. Ensure all endpoints, schemas, and examples are present. - [ ] **Verify OpenAPI spec** — start backend, check Swagger UI at `/api/docs`. Ensure all endpoints, schemas, and examples are present.
- [ ] **Sync `docs/openapi/openapi.yaml`** with the generated spec if any changes were made during development. - [ ] **Sync backend Swagger JSON (`/api/docs-json`) and regenerate `apps/frontend/src/api/types.ts`** if any contract changes were made during development.
- [ ] **Commit** - [ ] **Commit**
```bash ```bash
git add docs/openapi/openapi.yaml git add apps/frontend/src/api/types.ts
git commit -m "docs: finalize OpenAPI specification" git commit -m "docs: finalize OpenAPI specification"
``` ```
### Task 6.2: ADR documentation ### Task 6.2: ADR documentation
- [ ] **Ensure all ADR files exist** in `docs/architecture/adr/` (created during design phase, adjust if needed). - [ ] **Ensure all ADR files exist** in `apps/docs/docs/adr/` (created during design phase, adjust if needed).
- [ ] **Add architecture overview diagram** (ASCII sequence diagram or Mermaid): - [ ] **Add architecture overview diagram** (ASCII sequence diagram or Mermaid):
@ -3399,7 +3400,7 @@ server {
services: services:
backend: backend:
build: build:
context: ../../superpowers/plans context: .
dockerfile: docker/Dockerfile.backend dockerfile: docker/Dockerfile.backend
ports: ports:
- "3000:3000" - "3000:3000"
@ -3410,7 +3411,7 @@ services:
frontend: frontend:
build: build:
context: ../../superpowers/plans context: .
dockerfile: docker/Dockerfile.frontend dockerfile: docker/Dockerfile.frontend
ports: ports:
- "80:80" - "80:80"

View File

@ -260,14 +260,14 @@ moex-vibe/
│ │ └── main.tsx │ │ └── main.tsx
│ └── package.json │ └── package.json
├── docs/ ├── docs/
│ ├── superpowers/specs/ │ ├── epics/
│ ├── architecture/ │ ├── features/
│ ├── adr/ ├── inbox.md
│ ├── diagrams/ └── roadmap.md
│ │ └── domain-model.md ├── apps/
├── openapi/ └── docs/
│ └── openapi.yaml └── docs/
└── website/ (Docusaurus — post-MVP) └── adr/
├── package.json ├── package.json
├── tsconfig.base.json ├── tsconfig.base.json
└── .gitignore └── .gitignore

View File

@ -368,7 +368,7 @@ model Position {
## 10. OpenAPI Specification ## 10. OpenAPI Specification
Дополнения к существующему `docs/openapi/openapi.yaml`: Дополнения к текущему backend OpenAPI-контракту по `/api/docs-json`:
- Обновить схему `PositionResponse` — добавить `buyPrice`, `buyDate` - Обновить схему `PositionResponse` — добавить `buyPrice`, `buyDate`
- Создать схему `PortfolioAnalytics` со всеми полями - Создать схему `PortfolioAnalytics` со всеми полями

View File

@ -359,7 +359,7 @@ npm run format
- [ ] **Step 1: Write ADR or performance note in docs** - [ ] **Step 1: Write ADR or performance note in docs**
Add to `docs/superpowers/adr/2026-06-14-portfolio-enricher-optimization.md` documenting: Add to `apps/docs/docs/adr/` as a new ADR documenting:
- Problem: 298 API calls → 29s - Problem: 298 API calls → 29s
- Changes made: merged bond calls, removed redundant securityDescription, batch by market - Changes made: merged bond calls, removed redundant securityDescription, batch by market
- Result: 2 API calls → ~0.3s (97% reduction) - Result: 2 API calls → ~0.3s (97% reduction)

View File

@ -392,7 +392,7 @@ Phase 1 не требует событийной шины. События док
## 10. OpenAPI Specification ## 10. OpenAPI Specification
Дополнение к существующему `docs/openapi/openapi.yaml` — новые эндпоинты и схемы для Portfolio и Position. Дополнение к текущему backend OpenAPI-контракту по `/api/docs-json` — новые эндпоинты и схемы для Portfolio и Position.
--- ---

View File

@ -4,7 +4,7 @@
**Goal:** Сделать стандартные проверки MoexVibe детерминированными, синхронизировать OpenAPI-артефакты и обновить документацию под фактическое состояние репозитория. **Goal:** Сделать стандартные проверки MoexVibe детерминированными, синхронизировать OpenAPI-артефакты и обновить документацию под фактическое состояние репозитория.
**Architecture:** Разделяем offline unit tests и opt-in live MOEX integration tests. Машинный API-контракт берём из NestJS Swagger JSON, затем синхронизируем `docs/openapi/openapi.yaml` и `apps/frontend/src/api/types.ts`. README, AGENTS и Docusaurus остаются onboarding-документацией и описывают текущий код, а не исторические планы. **Architecture:** Разделяем offline unit tests и opt-in live MOEX integration tests. Машинный API-контракт берём из NestJS Swagger JSON по `/api/docs-json`, затем синхронизируем `apps/frontend/src/api/types.ts`. README, AGENTS и Docusaurus остаются onboarding-документацией и описывают текущий код, а не исторические планы.
**Tech Stack:** npm workspaces, NestJS 10, Vitest 1 для backend, Vitest 4 для frontend, Docusaurus 3, Swagger/OpenAPI, openapi-typescript. **Tech Stack:** npm workspaces, NestJS 10, Vitest 1 для backend, Vitest 4 для frontend, Docusaurus 3, Swagger/OpenAPI, openapi-typescript.
@ -15,7 +15,7 @@
### Создать ### Создать
- `apps/backend/src/modules/moex-client/moex-client.service.integration.spec.ts` — opt-in live MOEX smoke tests. - `apps/backend/src/modules/moex-client/moex-client.service.integration.spec.ts` — opt-in live MOEX smoke tests.
- `apps/backend/src/openapi-artifacts.spec.ts` — offline проверка, что checked-in OpenAPI artifacts содержат актуальные paths. - `apps/backend/src/openapi-artifacts.spec.ts` — offline проверка, что generated frontend OpenAPI types содержат актуальные paths.
### Изменить ### Изменить
@ -27,7 +27,6 @@
- `apps/backend/src/modules/bonds/bonds.service.spec.ts` — заменить live MOEX calls на mocked dependencies. - `apps/backend/src/modules/bonds/bonds.service.spec.ts` — заменить live MOEX calls на mocked dependencies.
- `apps/backend/src/modules/securities/screener.service.spec.ts` — убрать неиспользуемый `moexClient` или начать явно проверять его вызовы. - `apps/backend/src/modules/securities/screener.service.spec.ts` — убрать неиспользуемый `moexClient` или начать явно проверять его вызовы.
- `apps/frontend/src/api/types.ts` — перегенерировать из текущего Swagger JSON. - `apps/frontend/src/api/types.ts` — перегенерировать из текущего Swagger JSON.
- `docs/openapi/openapi.yaml` — обновить snapshot из текущего Swagger JSON.
- `README.md` — актуализировать scripts, tests и docs workspace. - `README.md` — актуализировать scripts, tests и docs workspace.
- `AGENTS.md` — актуализировать workspace, команды, frontend tests, Husky и CI. - `AGENTS.md` — актуализировать workspace, команды, frontend tests, Husky и CI.
- `apps/docs/docs/intro.md` — сделать Docusaurus docs home на `/`. - `apps/docs/docs/intro.md` — сделать Docusaurus docs home на `/`.
@ -955,9 +954,8 @@ git commit -m "test: make backend service specs deterministic"
- Create: `apps/backend/src/openapi-artifacts.spec.ts` - Create: `apps/backend/src/openapi-artifacts.spec.ts`
- Modify later in Task 4: `apps/frontend/src/api/types.ts` - Modify later in Task 4: `apps/frontend/src/api/types.ts`
- Modify later in Task 4: `docs/openapi/openapi.yaml`
- [ ] **Step 1: Написать failing test для checked-in OpenAPI artifacts** - [ ] **Step 1: Написать failing test для generated frontend OpenAPI types**
Создать `apps/backend/src/openapi-artifacts.spec.ts`: Создать `apps/backend/src/openapi-artifacts.spec.ts`:
@ -968,7 +966,6 @@ import { join, resolve } from 'node:path';
describe('checked-in OpenAPI artifacts', () => { describe('checked-in OpenAPI artifacts', () => {
const rootDir = resolve(process.cwd(), '../..'); const rootDir = resolve(process.cwd(), '../..');
const frontendTypes = readFileSync(join(rootDir, 'apps/frontend/src/api/types.ts'), 'utf8'); const frontendTypes = readFileSync(join(rootDir, 'apps/frontend/src/api/types.ts'), 'utf8');
const openapiYaml = readFileSync(join(rootDir, 'docs/openapi/openapi.yaml'), 'utf8');
const requiredPaths = [ const requiredPaths = [
'/api/v1/auth/register', '/api/v1/auth/register',
@ -989,12 +986,6 @@ describe('checked-in OpenAPI artifacts', () => {
expect(frontendTypes).toContain(`'${path}'`); expect(frontendTypes).toContain(`'${path}'`);
} }
}); });
it('static OpenAPI YAML snapshot includes current protected domains', () => {
for (const path of requiredPaths) {
expect(openapiYaml).toContain(`${path}:`);
}
});
}); });
``` ```
@ -1017,12 +1008,11 @@ git commit -m "test: cover checked-in openapi artifacts"
--- ---
## Task 4: Синхронизировать Swagger JSON, frontend types и static OpenAPI YAML ## Task 4: Синхронизировать Swagger JSON и frontend types
**Files:** **Files:**
- Modify: `apps/frontend/src/api/types.ts` - Modify: `apps/frontend/src/api/types.ts`
- Modify: `docs/openapi/openapi.yaml`
- Optional Modify: backend controller DTO metadata if `src/openapi-artifacts.spec.ts` still fails after regeneration. - Optional Modify: backend controller DTO metadata if `src/openapi-artifacts.spec.ts` still fails after regeneration.
- [ ] **Step 1: Запустить backend для codegen** - [ ] **Step 1: Запустить backend для codegen**
@ -1076,16 +1066,15 @@ npm run codegen -w apps/frontend
Expected: `apps/frontend/src/api/types.ts` changes and includes auth, screener and portfolio paths. Expected: `apps/frontend/src/api/types.ts` changes and includes auth, screener and portfolio paths.
- [ ] **Step 5: Перегенерировать static YAML snapshot** - [ ] **Step 5: Повторно проверить live Swagger JSON после codegen**
Run: Run:
```bash ```bash
node -e "fetch('http://localhost:3000/api/docs-json').then(r => r.json()).then(j => require('node:fs').writeFileSync('/tmp/moex-vibe-openapi.json', JSON.stringify(j, null, 2)))" node -e "fetch('http://localhost:3000/api/docs-json').then(r => r.json()).then(j => { const paths = Object.keys(j.paths); for (const p of ['/api/v1/auth/register','/api/v1/securities/screener','/api/v1/portfolios']) { if (!paths.includes(p)) throw new Error('Missing path ' + p); } console.log('Swagger paths still OK'); })"
node -e "const fs = require('node:fs'); const yaml = require('js-yaml'); const json = JSON.parse(fs.readFileSync('/tmp/moex-vibe-openapi.json', 'utf8')); fs.writeFileSync('docs/openapi/openapi.yaml', yaml.dump(json, { lineWidth: 120, noRefs: true }));"
``` ```
Expected: `docs/openapi/openapi.yaml` changes and includes `/api/v1/auth/register`, `/api/v1/securities/screener`, `/api/v1/portfolios`. Expected: prints `Swagger paths still OK`.
- [ ] **Step 6: Проверить artifact test теперь зелёный** - [ ] **Step 6: Проверить artifact test теперь зелёный**
@ -1111,7 +1100,7 @@ Expected: both commands exit 0.
- [ ] **Step 8: Commit** - [ ] **Step 8: Commit**
```bash ```bash
git add apps/frontend/src/api/types.ts docs/openapi/openapi.yaml apps/backend/src/openapi-artifacts.spec.ts apps/backend/src/modules git add apps/frontend/src/api/types.ts apps/backend/src/openapi-artifacts.spec.ts apps/backend/src/modules
git commit -m "docs: refresh openapi contract artifacts" git commit -m "docs: refresh openapi contract artifacts"
``` ```

View File

@ -17,7 +17,7 @@
настоящий `MoexClientService`. настоящий `MoexClientService`.
- Ошибки live MOEX-запросов проявляются как Vitest `DataCloneError`, потому что `AxiosError` - Ошибки live MOEX-запросов проявляются как Vitest `DataCloneError`, потому что `AxiosError`
содержит функции в конфигурации запроса, которые нельзя клонировать между worker'ами. содержит функции в конфигурации запроса, которые нельзя клонировать между worker'ами.
- `docs/openapi/openapi.yaml` и `apps/frontend/src/api/types.ts` не содержат актуальные эндпоинты - backend Swagger JSON по `/api/docs-json` и `apps/frontend/src/api/types.ts` не отражают актуальные эндпоинты
`auth`, `portfolios` и `securities/screener`. `auth`, `portfolios` и `securities/screener`.
- README, AGENTS и страницы Docusaurus местами описывают старое состояние репозитория. - README, AGENTS и страницы Docusaurus местами описывают старое состояние репозитория.
- `npm run build:docs` успешно генерирует статические файлы, но выводит предупреждения Docusaurus о - `npm run build:docs` успешно генерирует статические файлы, но выводит предупреждения Docusaurus о
@ -78,7 +78,7 @@
- `apps/docs/docs/backend/api.md` не содержит portfolio и screener endpoints. - `apps/docs/docs/backend/api.md` не содержит portfolio и screener endpoints.
- `apps/docs/docs/backend/portfolio.md` документирует `PATCH /api/v1/portfolios/:id/patch`, хотя - `apps/docs/docs/backend/portfolio.md` документирует `PATCH /api/v1/portfolios/:id/patch`, хотя
controller реализует `PATCH /api/v1/portfolios/:id`. controller реализует `PATCH /api/v1/portfolios/:id`.
- `docs/openapi/openapi.yaml` и `apps/frontend/src/api/types.ts` содержат только ранние paths для - backend Swagger JSON по `/api/docs-json` и `apps/frontend/src/api/types.ts` содержат только ранние paths для
health, search, shares, bonds и candles. health, search, shares, bonds и candles.
## Доменная модель ## Доменная модель
@ -110,7 +110,7 @@ decorators по `/api/docs-json`.
Сгенерированные или синхронизированные артефакты: Сгенерированные или синхронизированные артефакты:
- `docs/openapi/openapi.yaml`: checked-in человекочитаемый snapshot. - `/api/docs-json`: live Swagger JSON, канонический machine-readable contract.
- `apps/frontend/src/api/types.ts`: сгенерированные TypeScript path и schema types. - `apps/frontend/src/api/types.ts`: сгенерированные TypeScript path и schema types.
- Docusaurus API pages: поясняющая документация, но не канонический machine contract. - Docusaurus API pages: поясняющая документация, но не канонический machine contract.
@ -276,7 +276,7 @@ broken links на `/`. Отдельное update-check warning про permission
1. Добавить или завершить Swagger metadata для актуальных routes. 1. Добавить или завершить Swagger metadata для актуальных routes.
2. Перегенерировать `apps/frontend/src/api/types.ts`. 2. Перегенерировать `apps/frontend/src/api/types.ts`.
3. Синхронизировать `docs/openapi/openapi.yaml` с текущим contract. 3. Проверить `/api/docs-json` и синхронизировать `apps/frontend/src/api/types.ts` с текущим contract.
4. Проверить, что generated paths включают auth, screener и portfolio routes. 4. Проверить, что generated paths включают auth, screener и portfolio routes.
### Этап 3: обновить документацию ### Этап 3: обновить документацию
@ -311,7 +311,7 @@ npm run format:check
`/`. `/`.
- `npm run format:check` завершается с exit code 0. - `npm run format:check` завершается с exit code 0.
- `apps/frontend/src/api/types.ts` содержит актуальные auth, screener и portfolio paths. - `apps/frontend/src/api/types.ts` содержит актуальные auth, screener и portfolio paths.
- `docs/openapi/openapi.yaml` содержит актуальные auth, screener и portfolio paths. - `/api/docs-json` содержит актуальные auth, screener и portfolio paths.
- README, AGENTS и Docusaurus docs больше не утверждают, что frontend tests отсутствуют. - README, AGENTS и Docusaurus docs больше не утверждают, что frontend tests отсутствуют.
- Portfolio docs используют `PATCH /api/v1/portfolios/:id`, что соответствует controller. - Portfolio docs используют `PATCH /api/v1/portfolios/:id`, что соответствует controller.

View File

@ -7,8 +7,8 @@
## Контекст ## Контекст
Документация проекта публикуется только из `apps/docs` через Docusaurus. Текущая структура уже Документация проекта публикуется только из `apps/docs` через Docusaurus. Текущая структура уже
зафиксирована в `docs/superpowers/specs/2026-06-13-docusaurus-docs-design.md`: страницы лежат в зафиксирована в `docs/features/docusaurus-docs/spec.md`: страницы лежат в `apps/docs/docs`,
`apps/docs/docs`, навигация описана в `apps/docs/sidebars.ts`, Mermaid включён через навигация описана в `apps/docs/sidebars.ts`, Mermaid включён через
`@docusaurus/theme-mermaid`. `@docusaurus/theme-mermaid`.
Сейчас большая часть человекочитаемого текста в опубликованной документации написана на английском: Сейчас большая часть человекочитаемого текста в опубликованной документации написана на английском:

View File

@ -455,7 +455,7 @@ Phase 1 не требует событий. Для будущих фаз:
## 10. OpenAPI Specification ## 10. OpenAPI Specification
Дополнение к существующему `docs/openapi/openapi.yaml`: Дополнение к текущему backend OpenAPI-контракту по `/api/docs-json`:
```yaml ```yaml
paths: paths: