From b7b32a045770572efd858e2e8f242ef7a5b55de0 Mon Sep 17 00:00:00 2001 From: kamask Date: Sun, 25 Oct 2026 13:03:23 +0300 Subject: [PATCH] chore: switch selector prefix to ksk and remove angular demo content Co-Authored-By: Claude Sonnet 5.5 --- .env.example | 1 + README.md | 50 +++--- angular.json | 2 +- docs/architecture.md | 2 +- eslint.config.mjs | 4 +- src/app/app.css | 0 src/app/app.html | 359 ------------------------------------------- src/app/app.spec.ts | 7 - src/app/app.ts | 9 +- src/index.html | 4 +- 10 files changed, 35 insertions(+), 403 deletions(-) delete mode 100644 src/app/app.css diff --git a/.env.example b/.env.example index 5a32ea6..92b1a32 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ # Copy to .env and fill in. .env is not committed. +PB_URL=http://127.0.0.1:8090 PB_DIR=pocketbase/pb_data PB_SUPERUSER_EMAIL= PB_SUPERUSER_PASSWORD= diff --git a/README.md b/README.md index 374f19a..73629ee 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,13 @@ CRM для частных мастеров: учёт клиентов и зая ## Понятия -| Понятие | Что это | -| --- | --- | -| Пользователь | мастер, владелец аккаунта | -| Клиент | заказчик мастера | +| Понятие | Что это | +| ---------------- | -------------------------------------------------------------------- | +| Пользователь | мастер, владелец аккаунта | +| Клиент | заказчик мастера | | Заявка (`Order`) | заказ; принадлежит одному клиенту, у клиента может быть много заявок | -| Метка (`Tag`) | ярлык заявки, который мастер создаёт сам | -| Публичная ссылка | страница заявки для клиента по случайному токену | +| Метка (`Tag`) | ярлык заявки, который мастер создаёт сам | +| Публичная ссылка | страница заявки для клиента по случайному токену | ## Стек @@ -47,19 +47,19 @@ pnpm start # приложение на http://localhost:4200/ ## Команды -| Команда | Что делает | -| --- | --- | -| `pnpm start` | dev-сервер приложения | -| `pnpm build` | production-сборка в `dist/` | -| `pnpm lint` | ESLint | -| `pnpm test` | unit-тесты | -| `pnpm test:api` | API-тесты PocketBase: схема, правила доступа, изоляция пользователей | -| `pnpm test:integration` | репозитории приложения против тестового PocketBase | -| `pnpm e2e` | сценарии в браузере и проверка доступности (axe) | -| `pnpm e2e:prod` | сценарии на production-сборке | -| `pnpm pb:serve` | PocketBase для разработки | -| `pnpm pb:migrate` | применить миграции | -| `pnpm pb:superuser` | создать суперпользователя или сбросить его пароль | +| Команда | Что делает | +| ----------------------- | -------------------------------------------------------------------- | +| `pnpm start` | dev-сервер приложения | +| `pnpm build` | production-сборка в `dist/` | +| `pnpm lint` | ESLint | +| `pnpm test` | unit-тесты | +| `pnpm test:api` | API-тесты PocketBase: схема, правила доступа, изоляция пользователей | +| `pnpm test:integration` | репозитории приложения против тестового PocketBase | +| `pnpm e2e` | сценарии в браузере и проверка доступности (axe) | +| `pnpm e2e:prod` | сценарии на production-сборке | +| `pnpm pb:serve` | PocketBase для разработки | +| `pnpm pb:migrate` | применить миграции | +| `pnpm pb:superuser` | создать суперпользователя или сбросить его пароль | Тесты, которым нужен PocketBase, сами поднимают временный экземпляр и не трогают `pocketbase/pb_data`. Перед первым запуском e2e установите браузер: `pnpm exec playwright install chromium`. @@ -101,11 +101,11 @@ PB_DIR=/path/to/pb_data node --env-file=.env scripts/pb-superuser.mjs PB_URL=http://127.0.0.1:8090 PORT=4000 node dist/pchelpcrm/server/server.mjs ``` -| Переменная | Назначение | -| --- | --- | -| `PB_URL` | внутренний адрес PocketBase для SSR-сервера и dev-прокси, по умолчанию `http://127.0.0.1:8090` | -| `PORT` | порт Node SSR-сервера, по умолчанию `4000` | -| `PB_DIR` | папка данных PocketBase для скрипта `pb:superuser` | -| `PB_SUPERUSER_EMAIL`, `PB_SUPERUSER_PASSWORD` | суперпользователь PocketBase (скрипт `pb:superuser` и тесты) | +| Переменная | Назначение | +| --------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `PB_URL` | внутренний адрес PocketBase для SSR-сервера и dev-прокси, по умолчанию `http://127.0.0.1:8090` | +| `PORT` | порт Node SSR-сервера, по умолчанию `4000` | +| `PB_DIR` | папка данных PocketBase для скрипта `pb:superuser` | +| `PB_SUPERUSER_EMAIL`, `PB_SUPERUSER_PASSWORD` | суперпользователь PocketBase (скрипт `pb:superuser` и тесты) | Резервная копия — копирование папки `pb_data`. После первого релиза приложение планируется поставлять одним Docker-контейнером (SSR-сервер и PocketBase вместе). diff --git a/angular.json b/angular.json index 4277eb1..3d4e906 100644 --- a/angular.json +++ b/angular.json @@ -11,7 +11,7 @@ "schematics": {}, "root": "", "sourceRoot": "src", - "prefix": "app", + "prefix": "ksk", "architect": { "build": { "builder": "@angular/build:application", diff --git a/docs/architecture.md b/docs/architecture.md index cdaa7c3..3eac4e8 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -7,7 +7,7 @@ ``` ┌─ location /pb/ ─(префикс /pb срезается)─► PocketBase :8090 Браузер ──► nginx ──┤ ▲ - └─ location / ──► Node SSR-сервер :4200 ────────┘ + └─ location / ──► Node SSR-сервер :4000 ────────┘ (src/server.ts) PB_URL — напрямую, без nginx ``` diff --git a/eslint.config.mjs b/eslint.config.mjs index 69e881c..5dd968b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -18,11 +18,11 @@ export default defineConfig([ rules: { '@angular-eslint/directive-selector': [ 'error', - { type: 'attribute', prefix: 'app', style: 'camelCase' }, + { type: 'attribute', prefix: 'ksk', style: 'camelCase' }, ], '@angular-eslint/component-selector': [ 'error', - { type: 'element', prefix: 'app', style: 'kebab-case' }, + { type: 'element', prefix: 'ksk', style: 'kebab-case' }, ], }, }, diff --git a/src/app/app.css b/src/app/app.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/app.html b/src/app/app.html index 68c1dc0..67e7bd4 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -1,360 +1 @@ - - - - - - - - - - - -
-
-
- -

Hello, {{ title() }}

-

Congratulations! Your app is running. 🎉

-
- -
-
- @for ( - item of [ - { title: 'Explore the Docs', link: 'https://angular.dev' }, - { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, - { - title: 'Prompt and best practices for AI', - link: 'https://angular.dev/ai/develop-with-ai', - }, - { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, - { - title: 'Angular Language Service', - link: 'https://angular.dev/tools/language-service', - }, - { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, - ]; - track item.title - ) { - - {{ item.title }} - - - - - } -
- -
-
-
- - - - - - - - - diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts index 8c3a91b..9c96496 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.spec.ts @@ -13,11 +13,4 @@ describe('App', () => { const app = fixture.componentInstance; expect(app).toBeTruthy(); }); - - it('should render title', async () => { - const fixture = TestBed.createComponent(App); - await fixture.whenStable(); - const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('h1')?.textContent).toContain('Hello, pchelpcrm'); - }); }); diff --git a/src/app/app.ts b/src/app/app.ts index d248b7a..2da7ac6 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -1,12 +1,9 @@ -import { Component, signal } from '@angular/core'; +import { Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; @Component({ imports: [RouterOutlet], - selector: 'app-root', - styleUrl: './app.css', + selector: 'ksk-root', templateUrl: './app.html', }) -export class App { - protected readonly title = signal('pchelpcrm'); -} +export class App {} diff --git a/src/index.html b/src/index.html index 882aba3..9db9770 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,5 @@ - + Pchelpcrm @@ -8,6 +8,6 @@ - +