chore: scaffold turbo monorepo with hono api and react admin web
This commit is contained in:
62
README.md
Normal file
62
README.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# 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 :3000, web on :5173
|
||||
```
|
||||
|
||||
Or a single workspace: `bun run dev --filter=@superlist/web`.
|
||||
|
||||
## Verification
|
||||
|
||||
```bash
|
||||
bun run build # turbo run build
|
||||
bun run lint # oxlint
|
||||
bun run typecheck # tsc
|
||||
bun run test # bun test (api) / vitest (web, shared)
|
||||
```
|
||||
|
||||
## Useful scripts
|
||||
|
||||
| Command | Effect |
|
||||
| --------------------- | ------------------------------------------------------------- |
|
||||
| `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 |
|
||||
| `bun run format` | Format the repo with Prettier |
|
||||
|
||||
## 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.
|
||||
Reference in New Issue
Block a user