2. Technická architektura
Stack
Ověřený fakt — ze package.json a zdrojových souborů:
| Vrstva | Technologie | Verze |
|---|---|---|
| Frontend framework | React | 18.2 |
| Build tool | Vite | 6.1 |
| Styling | Tailwind CSS | 3.4 |
| UI komponenty | shadcn/ui (Radix UI primitives) | viz package.json |
| Ikony | lucide-react | 0.475 |
| Routing | react-router-dom | v6.26 |
| Data fetching | @tanstack/react-query | v5.84 |
| Animace | framer-motion | 11 |
| Datum/čas | date-fns | 3.6 |
| Drag & drop | @hello-pangea/dnd | 17 |
| Rich text editor | react-quill | 2.0 |
| PDF generování | jsPDF | 4.0 |
| Backend runtime | Deno (serverless, Base44 platform) | — |
| Databáze | Base44 entities (NoSQL, proprietární) | — |
| Resend API | — | |
| Platby | Stripe (@stripe/react-stripe-js) | připraveno |
| Autentizace admin | Base44 Auth (session-based) | — |
| Autentizace klient | OTP kód → localStorage session | vlastní implementace |
Adresářová struktura
var/source/
├── base44/
│ ├── config.jsonc # Název aplikace, build příkazy
│ ├── connectors/
│ │ └── outlook.jsonc # MS Outlook OAuth scopes
│ ├── entities/ # Schémata databázových entit (JSONC)
│ │ ├── CalendarEvent.jsonc
│ │ ├── Booking.jsonc
│ │ ├── Client.jsonc
│ │ └── ... (28 entit celkem)
│ └── functions/ # Backend serverless funkce (Deno/TypeScript)
│ ├── clientAuth/entry.ts
│ ├── clientBooking/entry.ts
│ ├── sendNotification/entry.ts
│ ├── checkAvailabilityConflicts/entry.ts
│ ├── reminderDispatcher/entry.ts
│ ├── syncToOutlook/entry.ts
│ ├── activityLogger/entry.ts
│ ├── generateInvoice/entry.ts
│ ├── batchGenerateInvoices/entry.ts
│ └── onPaymentConfirmed/entry.ts
│
└── src/
├── App.jsx # Kořenový komponent: Router + Providers
├── Layout.jsx # Top navbar (role-based navigace)
├── pages.config.js # Registrace stránek + main page
├── index.css # CSS design tokeny (custom properties)
│
├── pages/ # 26 stránek aplikace
├── components/ # Sdílené komponenty
│ ├── calendar/ # 15 komponent
│ ├── availability/ # 2 komponenty
│ ├── clients/ # 5 komponent
│ ├── activitylog/ # 3 komponenty
│ ├── notifications/ # 1 komponenta
│ ├── demo/ # 2 komponenty
│ ├── optimcall/ # 2 komponenty (příchozí hovor)
│ ├── services/ # 1 komponenta
│ ├── settings/ # 1 komponenta
│ ├── therapists/ # 2 komponenty
│ └── ui/ # shadcn/ui primitivy (~30 komponent)
│
├── api/
│ └── base44Client.js # Inicializovaný Base44 SDK klient
│
└── lib/
├── AuthContext.jsx # Admin auth stav
├── DemoAuthContext.jsx # Demo user přepínač
├── query-client.js # React Query konfigurace
├── permissions.js # Role-based viditelnost navigace
├── NavigationTracker.jsx # Sledování navigace
├── StatusContext.jsx # Globální stav aplikace
└── utils.js # Utility funkce
Datový tok
Ověřený fakt:
Frontend (React)
│
├── base44.entities.* ← CRUD nad NoSQL databází (SDK)
│ .list(), .filter(), .get(), .create(), .update(), .delete()
│
└── base44.functions.invoke() ← Volání Deno serverless funkcí
clientAuth, clientBooking, sendNotification, ...
Všechna komunikace probíhá přes @base44/sdk — neexistuje žádný vlastní REST API server.
Autentizace
Admin přihlášení:
- Řeší Base44 platforma transparentně
AuthContext.jsx— stav:isLoadingAuth,authError,navigateToLogin- Chybové stavy:
user_not_registered,auth_required
Klient přihlášení (OTP):
- Klient zadá e-mail nebo telefon → backend
clientAuthvygeneruje 6-místný kód (platný 10 min) - Kód se odešle e-mailem přes Resend API
- Po ověření vrátí backend data klienta → session se uloží do
localStorage ClientAuthContextspravuje stav v klientském portálu
Plánovaná automatizace
Ověřený fakt — reminderDispatcher je serverless funkce spouštěná každých 5 minut (Base44 scheduler):
- Posílá připomínky 10 minut před termínem
- Posílá připomínky 24 hodin před termínem
- Deduplication přes
NotificationLogentitu