Files
superlist/README.md

68 lines
2.6 KiB
Markdown

# Superlist
Monorepo with a Bun + Hono API and a React + Vite admin app.
| Workspace | What it is |
| ----------------- | ----------------------------------------------------------------------- |
| `apps/api` | Bun + Hono backend, Prisma (Postgres), Zod validation, Pino logging |
| `apps/web` | React + Vite + TypeScript frontend, shadcn/ui, TanStack Router + Query |
| `packages/shared` | `@superlist/shared` — Result pattern and RFC 9457 Problem Details types |
See `STACK.md` for the stack and `AGENTS.md` for the architecture conventions.
## Requirements
- [Bun](https://bun.sh) (workspace package manager and API runtime)
- Postgres (only needed once you run migrations)
## Getting started
```bash
bun install
# API
cp apps/api/.env.example apps/api/.env # then edit DATABASE_URL / BETTER_AUTH_SECRET
bun run db:generate # prisma generate
bun run db:migrate # requires a reachable Postgres
# Web
cp apps/web/.env.example apps/web/.env
```
Run everything in parallel:
```bash
bun run dev # turbo run dev → api on :4100, web on :7153
```
Or a single workspace: `bun run dev --filter=@superlist/web`.
## Verification
```bash
bun run build # turbo run build
bun run lint # biome check per package (lint + format + import order)
bun run typecheck # tsc
bun run test # bun test (api) / vitest (web, shared)
```
CI (`.github/workflows/ci.yml`) runs `db:generate` → `lint:ci` → `typecheck` → `test` → `build` on every push
to `main` and every pull request.
## Useful scripts
| Command | Effect |
| --------------------- | ------------------------------------------------------------------- |
| `bun run lint:fix` | Apply Biome fixes: lint, formatting and import sorting (whole repo) |
| `bun run lint:ci` | `biome ci` — check the whole repo exactly as CI does |
| `bun run format` | Format with Biome (`format:check` to verify only) |
| `bun run db:generate` | Regenerate the Prisma client into `apps/api/src/generated` |
| `bun run db:migrate` | Create and apply a migration (development) |
| `bun run db:studio` | Open Prisma Studio |
## Auth
BetterAuth is mounted by the API under `/api/auth/*` and uses the Prisma adapter. The web app talks to it
through `apps/web/src/lib/auth-client.ts`; the `_authenticated` route layout redirects to `/sign-in` when there
is no session.