P Podology Center CRM
Product concept · v0.1

The salon, clearly visible.

A Telegram Mini App CRM for Podology Center: center-wide control for admins and a private earnings workspace for every podologist.

Admin + Worker rolesMonthly earningsClients & proceduresExisting DB credentialsMobile first
Clickable prototype

Explore the app roles

Switch between Admin and Worker, choose a page and change the month. Login is shown separately. Numbers and people below are sample data for the design only.

АдминистраторОксана
DEMO

Центр сегодня

Обзор денег, процедур и команды

Выручка центра за месяц
48 620 zł
↑ 8,4% к прошлому месяцу
Выполнено процедур31224 сегодня
Зарплаты мастеров18 940 złрасчётный итог
Команда · этот месяц
IN
Инна104 процедуры
8 320 złзарплата
OL
Ольга97 процедур
7 840 złзарплата
VI
Viktoriia111 процедур
8 960 złзарплата

Мастера

Сравнение нагрузки и результата

1
5
10
15
20
25
По мастерам
IN
ИннаВыручка 20 800 zł
104процедуры
OL
ОльгаВыручка 19 600 zł
97процедур
VI
ViktoriiaВыручка 22 400 zł
111процедур

Все клиенты

Поиск по имени, телефону, мастеру или дате

АК
Анна К.Инна · Подологический педикюр
Выполнено21 июля
МС
Мария С.Ольга · Консультация
Запланировано22 июля
ЕЛ
Елена Л.Viktoriia · Обработка стопы
Выполнено20 июля
ИК
Ирина К.Инна · Коррекция ногтя
Запланировано24 июля

Процедуры

Из чего складывается выручка центра

ПроцедураКол-воСумма
Подологический педикюр8218 450 zł
Обработка стопы6112 200 zł
Коррекция ногтя548 640 zł
Консультация434 300 zł
Другие процедуры725 030 zł
Payment breakdown
Наличные19 230 zł
Карта / BLIK29 390 zł

Мой месяц

Личный результат · только ваши данные

Заработано с 1 числа
7 840 zł
97 завершённых процедур
Выручка по моим процедурам19 600 złдо расчёта зарплаты
Средний заработок / день523 zł15 рабочих дней
Последние процедуры
АК
Анна К.Подологический педикюр
90 złзарплата
МС
Мария С.Коррекция ногтя
56 złзарплата
ИЛ
Ирина Л.Обработка стопы
72 złзарплата

Мои клиенты

Другие мастера и их клиенты недоступны

АК
Анна К.5 визитов · последний сегодня
МС
Мария С.2 визита · следующий 28 июля
ИЛ
Ирина Л.7 визитов · последний 18 июля

Мои начисления

Прозрачный расчёт по каждой процедуре

Итого зарплата
7 840 zł
Расчёт только по завершённым услугам
ПроцедураСуммаМне
Подологический педикюр225 zł90 zł
Коррекция ногтя140 zł56 zł
Обработка стопы180 zł72 zł
Консультация100 zł40 zł

Профиль

Доступ и настройки

OL
ОльгаПодолог · активный доступ
Worker
RU
Язык интерфейсаРусский
🔒
БезопасностьTelegram + пароль центра
Access model

One CRM, strict role boundaries

Role filtering is enforced by the backend on every request. Hiding a menu item in the frontend is helpful UX, but it is never treated as security.

CapabilityAdminWorkerFirst release?
Center dashboard and total revenueYesNoYes
All workers and worker comparisonYesNoYes
All clients and appointment searchYesNoYes
Own clients, visits and proceduresYesOwn onlyYes
Own salary from first day of selected monthAll workersOwn onlyYes
Procedure and payment analyticsCenter-wideOwn onlyYes
Edit appointment, money or business dataConfirmed writesConfirmed own scopeLater iteration
Inventory, PDFs and advanced exportsYesOwn reportsLater iteration
System architecture

Separate UI, shared source of truth

The Mini App gets a dedicated frontend and a new CRM API boundary. Existing Podology business tables remain the source of truth; calculations and access rules live server-side.

Telegram user

Admin or approved worker launches the Mini App from the current bot.

CRM Mini App

Mobile TypeScript UI, Telegram themes, safe areas, role-specific navigation.

Auth & Role Gate

Validate Telegram init data, then phone + password; issue short-lived session; enforce Admin/Worker scope.

Podology CRM API

Class-based controllers, services, repositories, DTOs and audit policy.

Worker serviceOwn dashboard & clients
Admin serviceCenter-wide analytics
Salary serviceServer-side monthly rules
Client serviceSearch & visit history
Audit serviceConfirmation & action trail

Repository layer

Parameterized queries, pagination, read models, transactions for future writes.

Existing MariaDB + new CRM tables

Current appointments/workers stay authoritative. New sessions, audit and salary snapshots use separate migrations only after approval.

🔐 Security

No DB credentials, bot token, salary rules or passwords in browser code. Telegram display data is not trusted without backend validation.

🧭 One bot, one Telegram contour

The Mini App is opened by the existing bot. We do not create a second poller for the same Telegram token.

🧾 Read-only first

Initial CRM endpoints only read and calculate. Write operations come later with explicit confirmation and audit history.

01Launch

User opens CRM from the bot menu/button.

02Verify Telegram

Backend validates raw launch data and freshness.

03Link account

Phone + existing password identify worker/admin.

04Resolve role

Server creates a scoped session and role context.

05Return data

Repositories apply worker ownership filters before data leaves the server.

Recommended login policy

Require phone + password on the first link, on a new Telegram account/device, and after an expired/revoked session. For normal returns, validated Telegram launch data can resume a short-lived secure server session. The final policy should be confirmed before implementation.

OOP implementation

Classes own behavior and boundaries

We will not create one large procedural file. UI screens, auth, calculations and persistence are represented by classes with narrow responsibilities and test seams.

Frontend · TypeScript class-based SPA

src/
  app/
    TelegramBridge.ts
    AppRouter.ts
    SessionStore.ts
    ApiClient.ts
  auth/
    AuthSession.ts
    LoginPage.ts
    RoleGuard.ts
  admin/
    AdminDashboardPage.ts
    WorkersPage.ts
    AllClientsPage.ts
    ProcedureReportPage.ts
  worker/
    WorkerDashboardPage.ts
    MyClientsPage.ts
    MyEarningsPage.ts
  components/
    MonthSelector.ts
    MoneyCard.ts
    ClientList.ts
    ProcedureTable.ts

Backend · Python class layers

app/
  controllers/
    AuthController.py
    WorkerController.py
    AdminController.py
  services/
    AuthService.py
    RolePolicy.py
    WorkerDashboardService.py
    AdminAnalyticsService.py
    SalaryCalculationService.py
  repositories/
    WorkerRepository.py
    ClientRepository.py
    ProcedureRepository.py
    SessionRepository.py
  domain/
    User.py
    Role.py
    Money.py
    SalaryPeriod.py
  infrastructure/
    MariaDbUnitOfWork.py
    TelegramInitDataValidator.py
  tests/
    unit/  integration/  authorization/
Frontend recommendation

TypeScript + Vite with class-based page/components. Small payload, direct Telegram WebView integration, OOP-friendly.

Backend recommendation

Python FastAPI for transport, with thin class-based controllers and all rules in domain/services/repositories.

Data recommendation

MariaDB remains the source. Use indexed read queries, DTOs and separate migrations for any new CRM-only tables.

Delivery plan

Small iterations, one review at a time

Each phase lives in its own feature branch and pull request. You review the real behavior, approve or request changes, and only then we merge and start the next phase.

Iteration 0

Discovery & contracts

Freeze exact salary, role and monthly-period rules.

  • Read-only DB/schema map
  • API contract and permission matrix
  • Wireframes accepted
docs/00-crm-contracts
Iteration 1

Project foundation

Scaffold frontend, backend, CI and local environment.

  • OOP module boundaries
  • Health endpoint and DB read smoke
  • Unit-test baseline
feat/01-foundation
Iteration 2

Authentication & RBAC

Telegram launch verification plus existing phone/password login.

  • Admin/Worker session
  • Revocation and expiry
  • Cross-worker denial tests
feat/02-auth-rbac
Iteration 3

Worker dashboard

Own earnings from day one of a selected month.

  • Month switcher
  • Own totals and procedures
  • Salary calculation trace
feat/03-worker-dashboard
Iteration 4

Worker clients

Own client list, search and visit history.

  • Phone/name search
  • Pagination
  • Privacy tests
feat/04-worker-clients
Iteration 5

Admin center dashboard

All workers, clients, earnings and procedure mix.

  • Center month totals
  • Worker comparison
  • Procedure/payment analytics
feat/05-admin-dashboard
Iteration 6

Reports & exports

Monthly drilldowns and export/PDF options.

  • Admin and worker reports
  • Data reconciliation flags
  • Download permissions
feat/06-reports
Iteration 7

Confirmed writes

Only after read-only CRM is trusted.

  • Restate → confirm → write
  • Idempotency and audit trail
  • Old/new verification
feat/07-confirmed-writes
Iteration 8

Hardening & release

Production quality, privacy and Telegram WebView testing.

  • Light/dark and safe areas
  • Security/performance tests
  • Staged rollout and rollback
chore/08-release-hardening
Branch workflow

Feature branch → tests and preview → pull request → your review → changes if needed → your approval → merge.

Definition of done

Acceptance criteria demonstrated, tests passing, role boundaries verified and no unresolved privacy/security issue.

Repository

A new private Git repository is recommended because this CRM has a separate frontend, API contract, migrations and release lifecycle.

Before Iteration 1

Please create the private Git repository when this concept direction is approved. Then provide the repository URL and preferred default branch protection rules. No production database, bot routing or deployment should change during the initial scaffold.