diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | README.md | 28 | ||||
| -rw-r--r-- | docs/dev/architecture.md | 45 | ||||
| -rw-r--r-- | docs/dev/roadmap.md | 4 | ||||
| -rw-r--r-- | package.json | 18 | ||||
| -rw-r--r-- | pkgs/client/package.json | 13 | ||||
| -rw-r--r-- | pkgs/client/src/index.ts | 1 | ||||
| -rw-r--r-- | pkgs/client/tsconfig.json | 10 | ||||
| -rw-r--r-- | pkgs/server/package.json | 13 | ||||
| -rw-r--r-- | pkgs/server/src/index.ts | 1 | ||||
| -rw-r--r-- | pkgs/server/tsconfig.json | 9 | ||||
| -rw-r--r-- | pkgs/shared/package.json | 13 | ||||
| -rw-r--r-- | pkgs/shared/src/index.ts | 1 | ||||
| -rw-r--r-- | pkgs/shared/tsconfig.json | 9 | ||||
| -rw-r--r-- | pnpm-lock.yaml | 30 | ||||
| -rw-r--r-- | pnpm-workspace.yaml | 2 | ||||
| -rw-r--r-- | tsconfig.json | 22 |
17 files changed, 167 insertions, 55 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..06e6038 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +*.tsbuildinfo @@ -9,38 +9,12 @@ A spaced repetition learning application (Anki clone) with PWA offline support a - Cloud Sync: Automatic sync when online with conflict resolution - Anki Import: Import existing .apkg decks from Anki -## Tech Stack - -| Layer | Technology | -|-------|------------| -| Frontend | SvelteKit | -| Backend | Hono + TypeScript | -| Database | PostgreSQL | -| ORM | Drizzle | -| Client DB | Dexie.js (IndexedDB) | -| PWA | @vite-pwa/sveltekit | -| Algorithm | FSRS (ts-fsrs) | -| Auth | Username/password + JWT | -| Test | Vitest | -| Monorepo | pnpm workspace | - -## Project Structure - -``` -kioku/ -├── apps/ -│ ├── web/ # SvelteKit frontend (PWA) -│ └── server/ # Hono backend API -└── packages/ - └── shared/ # Shared types and schemas -``` - ## Getting Started ### Prerequisites - Node.js 22+ -- pnpm 9+ +- pnpm 10+ - PostgreSQL 15+ - Docker (optional) diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 9c3749b..2ace388 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md @@ -1,9 +1,5 @@ # Kioku Architecture -## Overview - -Kioku is a spaced repetition learning application (Anki clone) with PWA offline support and cloud sync. - ## Tech Stack | Layer | Technology | @@ -61,26 +57,25 @@ kioku/ ├── package.json # Workspace root ├── pnpm-workspace.yaml ├── docker-compose.yml -├── apps/ -│ ├── web/ # SvelteKit frontend -│ │ ├── src/ -│ │ │ ├── lib/ -│ │ │ │ ├── components/ -│ │ │ │ ├── stores/ -│ │ │ │ ├── db/ # Dexie IndexedDB -│ │ │ │ ├── sync/ # Sync engine -│ │ │ │ └── api/ -│ │ │ └── routes/ -│ │ └── static/ -│ └── server/ # Hono backend -│ └── src/ -│ ├── routes/ -│ ├── services/ -│ ├── db/ # Drizzle schema -│ ├── middleware/ -│ └── lib/ -│ └── apkg/ # Anki import -└── packages/ +└── pkgs/ + ├── web/ # SvelteKit frontend + │ ├── src/ + │ │ ├── lib/ + │ │ │ ├── components/ + │ │ │ ├── stores/ + │ │ │ ├── db/ # Dexie IndexedDB + │ │ │ ├── sync/ # Sync engine + │ │ │ └── api/ + │ │ └── routes/ + │ └── static/ + ├── server/ # Hono backend + │ └── src/ + │ ├── routes/ + │ ├── services/ + │ ├── db/ # Drizzle schema + │ ├── middleware/ + │ └── lib/ + │ └── apkg/ # Anki import └── shared/ # Shared types └── src/ ├── types/ @@ -252,5 +247,3 @@ POST /api/import/apkg - Import Anki deck - [ts-fsrs](https://github.com/open-spaced-repetition/ts-fsrs) - [Anki APKG Format](https://eikowagenknecht.de/posts/understanding-the-anki-apkg-format/) -- [Vite PWA for SvelteKit](https://vite-pwa-org.netlify.app/frameworks/sveltekit.html) -- [Dexie.js](https://dexie.org/) diff --git a/docs/dev/roadmap.md b/docs/dev/roadmap.md index 32af8c7..e9b6b9c 100644 --- a/docs/dev/roadmap.md +++ b/docs/dev/roadmap.md @@ -5,8 +5,8 @@ ### Project Setup - [x] Create docs/dev/architecture.md - [x] Create docs/dev/roadmap.md -- [ ] Initialize pnpm workspace -- [ ] Configure TypeScript +- [x] Initialize pnpm workspace +- [x] Configure TypeScript - [ ] Configure Biome - [ ] Setup Vitest diff --git a/package.json b/package.json new file mode 100644 index 0000000..b74b508 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "kioku", + "version": "0.1.0", + "description": "An Anki clone", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "typecheck": "tsc --build pkgs/*/tsconfig.json" + }, + "keywords": [], + "author": "nsfisis", + "license": "MIT", + "packageManager": "pnpm@10.23.0", + "type": "module", + "devDependencies": { + "typescript": "^5.9.3" + } +} diff --git a/pkgs/client/package.json b/pkgs/client/package.json new file mode 100644 index 0000000..35a5bae --- /dev/null +++ b/pkgs/client/package.json @@ -0,0 +1,13 @@ +{ + "name": "@kioku/client", + "version": "0.1.0", + "private": true, + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "nsfisis", + "license": "MIT", + "packageManager": "pnpm@10.23.0", + "type": "module" +} diff --git a/pkgs/client/src/index.ts b/pkgs/client/src/index.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/pkgs/client/src/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/pkgs/client/tsconfig.json b/pkgs/client/tsconfig.json new file mode 100644 index 0000000..0dc0dfe --- /dev/null +++ b/pkgs/client/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/pkgs/server/package.json b/pkgs/server/package.json new file mode 100644 index 0000000..d986b65 --- /dev/null +++ b/pkgs/server/package.json @@ -0,0 +1,13 @@ +{ + "name": "@kioku/server", + "version": "0.1.0", + "private": true, + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "nsfisis", + "license": "MIT", + "packageManager": "pnpm@10.23.0", + "type": "module" +} diff --git a/pkgs/server/src/index.ts b/pkgs/server/src/index.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/pkgs/server/src/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/pkgs/server/tsconfig.json b/pkgs/server/tsconfig.json new file mode 100644 index 0000000..ed464a9 --- /dev/null +++ b/pkgs/server/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/pkgs/shared/package.json b/pkgs/shared/package.json new file mode 100644 index 0000000..c15c299 --- /dev/null +++ b/pkgs/shared/package.json @@ -0,0 +1,13 @@ +{ + "name": "@kioku/shared", + "version": "0.1.0", + "private": true, + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "nsfisis", + "license": "MIT", + "packageManager": "pnpm@10.23.0", + "type": "module" +} diff --git a/pkgs/shared/src/index.ts b/pkgs/shared/src/index.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/pkgs/shared/src/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/pkgs/shared/tsconfig.json b/pkgs/shared/tsconfig.json new file mode 100644 index 0000000..ed464a9 --- /dev/null +++ b/pkgs/shared/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..923850a --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,30 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + typescript: + specifier: ^5.9.3 + version: 5.9.3 + + pkgs/client: {} + + pkgs/server: {} + + pkgs/shared: {} + +packages: + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + +snapshots: + + typescript@5.9.3: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..4276d04 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'pkgs/**' diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..db698cf --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2022", + "lib": ["ES2022"], + "module": "ESNext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "noEmit": true, + "isolatedModules": true, + "verbatimModuleSyntax": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "forceConsistentCasingInFileNames": true + }, + "exclude": ["node_modules", "dist"] +} |
