Internal tools

Restaurant shift swap scheduler with manager approval

Internal web app where restaurant staff post and accept shift swaps, and a manager approves them, built with Next.js, TypeScript and SQLite.

nextjstypescriptsqliteprismavitest

Built 1 time, downloaded 0 times.

Install from your terminal

Run this in your project folder. It signs you in, shows what changes and asks before it overwrites a file.

npx claude-lab add restaurant-shift-swap-scheduler-with-manager-approval-952e7b
CLAUDE.md
# Restaurant shift swap scheduler

## What this app is

An internal web app where restaurant staff post shifts they want to swap. A coworker accepts the swap, and the manager approves or rejects it. It is for a small team and runs on one shared machine or a small server.

## Stack

Use this stack exactly unless the user changes it.

- Next.js latest stable with App Router
- TypeScript in strict mode
- Prisma ORM with a SQLite file at prisma/dev.db
- Vitest for unit tests
- ESLint with Next.js defaults

## Commands

- `npm install`: install dependencies (asks first, see permissions)
- `npm run dev`: start the app on port 3000
- `npm run typecheck`: TypeScript check
- `npm run lint`: ESLint check
- `npm test`: Vitest unit tests
- `npm run build`: production build
- `npx prisma migrate dev`: apply schema changes to the dev database
- `npx prisma studio`: browse the data in a browser

## Verification

Before saying a task is done, run typecheck, lint, test and build. Report the result of each one with its exit code. The `verify` skill does this.

## Business rules

- All swap rules live in SPEC.md. Read SPEC.md before changing swap logic.
- Never change SPEC.md without asking the user first.
- Swap rule logic lives in `src/lib/swaps.ts` and is tested there.

## Secrets

- Real secret values live only in `.env`. Never commit `.env`.
- `.env.example` holds placeholders only, such as `SESSION_SECRET=YOUR_SESSION_SECRET`.
- Never print real secret values in chat, code, tests or logs.

## Code style

- Keep functions small.
- Use one file per route group.
- Put business rules in `src/lib/swaps.ts`, not in routes or components.
- Do not add new dependencies without asking first.

## Review

Every change is judged against the checklist in @REVIEW.md.

## Gotchas

- SQLite allows one writer at a time. Wrap every approval change in a single Prisma transaction.
- Dates are stored in UTC. Display them in the restaurant's local time zone, set by `RESTAURANT_TZ` in `.env`.
- Staff login uses a signed cookie that depends on `SESSION_SECRET`. Keep that value out of git.

## Working habits

- Use `/clear` between unrelated tasks.
- Use `/compact` at natural breaks in a long task.
- Hand long test runs to the `test-runner` subagent so the main session stays small.
- Explore, plan, code, then verify. Give Claude a way to check its work.
Use for my project