|
| 1 | +# AtCoder NoviSteps |
| 2 | + |
| 3 | +A web service for tracking submissions on AtCoder and other competitive programming sites, which are graded by difficulty (Q11-D6). |
| 4 | + |
| 5 | +## Tech Stack |
| 6 | + |
| 7 | +SvelteKit 2 + Svelte 5 (Runes) + TypeScript | PostgreSQL + Prisma | Flowbite Svelte + Tailwind 4 | Vitest + Playwright |
| 8 | + |
| 9 | +## Commands |
| 10 | + |
| 11 | +```bash |
| 12 | +pnpm dev # Start dev server (localhost:5174) |
| 13 | +pnpm build # Build for production |
| 14 | +pnpm test # Run all tests |
| 15 | +pnpm test:unit # Vitest unit tests |
| 16 | +pnpm test:integration # Playwright E2E tests |
| 17 | +pnpm coverage # Report test coverage |
| 18 | +pnpm lint # ESLint check |
| 19 | +pnpm format # Prettier format |
| 20 | +pnpm check # Svelte type check |
| 21 | +pnpm exec prisma generate # Generate Prisma client |
| 22 | +pnpm exec prisma migrate dev --name # Create migration (with description) |
| 23 | +pnpm db:seed # Seed database |
| 24 | +``` |
| 25 | + |
| 26 | +## Project Structure |
| 27 | + |
| 28 | +```md |
| 29 | +src/routes/ # SvelteKit file-based routing |
| 30 | +src/lib/ |
| 31 | +├── actions/ # SvelteKit actions |
| 32 | +├── clients/ # External API clients (AtCoder Problems, AOJ) |
| 33 | +├── components/ # Svelte components |
| 34 | +├── constants/ |
| 35 | +├── server/ # Server-only (auth.ts, database.ts) |
| 36 | +├── services/ # Business logic |
| 37 | +├── stores/ # Svelte stores (.svelte.ts with Runes) |
| 38 | +├── types/ # TypeScript types |
| 39 | +├── utils/ # Pure utility functions |
| 40 | +└── zod/ # Validation schemas |
| 41 | +src/test/ # Unit tests (mirrors src/lib/) |
| 42 | +tests/ # E2E tests (Playwright) |
| 43 | +prisma/schema.prisma # Database schema |
| 44 | +``` |
| 45 | + |
| 46 | +## Key Conventions |
| 47 | + |
| 48 | +- **Svelte 5 Runes**: Use `$props()`, `$state()`, `$derived()` in all new components |
| 49 | +- **Server data**: `+page.server.ts` → `+page.svelte` via `data` prop |
| 50 | +- **Forms**: Superforms + Zod validation |
| 51 | +- **Tests**: Factories via `@quramy/prisma-fabbrica`, HTTP mocking via Nock |
| 52 | +- **Naming**: `camelCase` variables, `PascalCase` types/components, `snake_case` files/routes, `kebab-case` directories |
| 53 | +- **Pre-commit**: Lefthook runs Prettier + ESLint (bypass: `LEFTHOOK=0 git commit`) |
| 54 | + |
| 55 | +## References |
| 56 | + |
| 57 | +- See `package.json` for versions and scripts |
| 58 | +- See `prisma/schema.prisma` for database models |
| 59 | +- See `docs/guides/` for detailed documentation |
0 commit comments