Author: Hironobu Nakae hnakae@uoregon.edu
hosted on vercel: https://task-orchestrator-peach.vercel.app/
run: cd task-orchestrator npm install b npm run dev
The Workflow:
- Database: You update schema.prisma.
- Generate: Prisma generates the database client and Zod schemas.
- Full-Stack Safety: Your Frontend forms and Backend actions now "know" about the new database column immediately, with zero manual typing.
Summary of Benefits in this Project:
- Zero Desync: You can't accidentally send a string to a numeric database column.
- Auto-Documentation: The schema tells other developers exactly what a "Task" requires.
- Fail-Fast: Errors are caught at the API boundary (Server Actions) before they cause weird bugs in the database or UI.
TO UNDO GIT PUSH:
git reset --hard <last-good-commit-hash>
git push origin <branch-name> --force
IF THE APP ISN'T WORKING:
- Database Status: Check Supabase DB and ensure it's resumed if paused.
- Syncing Schema Changes: If you've modified
prisma/schema.prismaor are seeing type errors, run the following commands:npm run db:sync: Recommended. This runs bothdb:migrateanddb:generatein sequence, ensuring your database and types are fully synchronized in one step.npm run db:migrate: This usesdotenvandprisma migrate dev. It creates a new migration file based on yourschema.prismachanges and applies it to your database. Use this when you change the database structure.npm run db:generate: This runsprisma generateto update the Prisma Client andzod-prisma-typesto update the Zod schemas inlib/generated/zod. It also runsnode fix-types.jsto patch a known typing issue in the generated Zod files.
- Why Zod?: This project uses
zod-prisma-typesto automatically generate Zod validation schemas from your Prisma models. These are located inlib/generated/zod/index.ts.- If your Server Actions are failing due to validation, check if the Zod schema matches your expected input.
- If you add a new field to a model, running
db:generateensures your frontend forms and backend validation logic are immediately aware of the change.
- Type Errors: If you see
ENOTFOUNDorfetch failederrors, verify your.envfile contains the correctNEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY.