diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/dev/architecture.md | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 102db1e..12c6fb0 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md @@ -5,6 +5,8 @@ | Layer | Technology | |-------|------------| | Frontend | React + Vite | +| Routing | Wouter | +| Styling | TailwindCSS | | Backend | Hono + TypeScript | | Database | PostgreSQL | | ORM | Drizzle | @@ -37,9 +39,9 @@ | Server | | +----------------------------------------------+| | | Hono (TypeScript) || -| | +--------+ +--------+ +--------+ +--------+ || -| | | Auth | | FSRS | | Sync | | Import | || -| | +--------+ +--------+ +--------+ +--------+ || +| | +----------+ +----------+ +----------+ || +| | | Auth | | FSRS | | Sync | || +| | +----------+ +----------+ +----------+ || | +----------------------------------------------+| | | | | v | @@ -60,17 +62,15 @@ kioku/ │ │ ├── middleware/ │ │ ├── repositories/ │ │ ├── routes/ -│ │ ├── types/ # Server types │ │ ├── schemas/ # Zod validation -│ │ └── lib/ -│ │ └── apkg/ # Anki import +│ │ └── scripts/ # CLI scripts (add-user) │ └── client/ # React frontend │ ├── index.tsx │ ├── components/ +│ ├── pages/ │ ├── stores/ │ ├── db/ # Dexie IndexedDB │ ├── sync/ # Sync engine -│ ├── types/ # Client types │ └── api/ ├── drizzle/ # Drizzle migrations ├── public/ # Static files (PWA manifest) @@ -95,6 +95,18 @@ interface User { } ``` +### RefreshToken + +```typescript +interface RefreshToken { + id: string; // UUID + user_id: string; + token_hash: string; + expires_at: Date; + created_at: Date; +} +``` + ### Deck ```typescript @@ -176,7 +188,6 @@ interface ReviewLog { ``` POST /api/auth/login - Login (returns JWT) POST /api/auth/refresh - Refresh token -POST /api/auth/logout - Logout ``` Note: User registration is disabled. Use CLI to add users: `pnpm user:add` @@ -214,12 +225,6 @@ POST /api/sync/push - Push local changes to server GET /api/sync/pull - Pull server changes ``` -### Import - -``` -POST /api/import/apkg - Import Anki deck -``` - ## Offline Sync Strategy ### Approach |
