|
2 | 2 |
|
3 | 3 | 五月祭・駒場祭用 |
4 | 4 |
|
5 | | -## Tech Stack |
| 5 | +## 技術スタック |
6 | 6 |
|
7 | | -- **Frontend**: React Router v7 (SSR), TailwindCSS + DaisyUI |
8 | | -- **Backend**: Cloudflare Workers |
9 | | -- **Database**: Cloudflare D1 (SQLite), Drizzle ORM |
10 | | -- **Auth**: Better-Auth (anonymous login) |
| 7 | +- **フレームワーク**: React Router v7 (SSR) |
| 8 | +- **スタイリング**: TailwindCSS + DaisyUI |
| 9 | +- **デプロイ**: Cloudflare Workers |
| 10 | +- **データベース**: Cloudflare D1 (SQLite), Drizzle ORM |
| 11 | +- **認証**: Better-Auth (anonymous login) |
11 | 12 |
|
12 | | -## Getting Started |
| 13 | +## 開発 |
13 | 14 |
|
14 | 15 | ```bash |
15 | | -npm install |
16 | | -npm run dev |
| 16 | +pnpm install |
| 17 | +pnpm dev |
17 | 18 | ``` |
18 | 19 |
|
19 | | -## Database Migrations |
| 20 | +## マイグレーション |
20 | 21 |
|
21 | | -### Local Development |
| 22 | +### ローカル |
22 | 23 |
|
23 | 24 | ```bash |
24 | | -# Generate migration from schema changes |
25 | | -npx drizzle-kit generate --name <migration_name> |
| 25 | +pnpm drizzle-kit generate --name <migration_name> |
26 | 26 |
|
27 | | -# Apply migration to local D1 |
28 | | -npx drizzle-kit migrate |
| 27 | +pnpm drizzle-kit migrate |
29 | 28 | ``` |
30 | 29 |
|
31 | | -### Better-Auth Schema Generation |
| 30 | +### Better-Auth |
32 | 31 |
|
33 | 32 | ```bash |
34 | | -# Generate auth schema to match DB schema location |
35 | | -npx auth generate --output ./app/lib/db/auth-schema.ts --adapter drizzle --dialect sqlite |
| 33 | +pnpx auth generate --output ./app/db/auth-schema.ts --adapter drizzle --dialect sqlite |
36 | 34 | ``` |
37 | 35 |
|
38 | | -### Remote (Production) |
| 36 | +### リモート (Production) |
39 | 37 |
|
40 | 38 | ```bash |
41 | | -# Apply migration to remote D1 |
42 | | -npx wrangler d1 migrations apply hitori-mahjong-db --remote |
| 39 | +pnpm wrangler d1 migrations apply hitori-mahjong-db --remote |
43 | 40 | ``` |
44 | | - |
45 | | -This reads the generated SQL files from `drizzle/` and applies them to the remote D1 database. |
46 | | - |
47 | | -## Available Scripts |
48 | | - |
49 | | -- `npm run dev` - Start development server and **generate local D1 instance** |
50 | | -- `npm run build` - Build for production |
51 | | -- `npm run deploy` - Build and deploy to Cloudflare (If you push the changes to the main branch, it will trigger a new deploy) |
52 | | -- `npm run typecheck` - Type checking |
53 | | -- `npm run format` - Format code with Biome |
0 commit comments