Small Next.js app that lists dashboards from MySQL. Built for the MagiDash Corp interview brief — see
BRIEF.md.
Stack: Next.js 16 (App Router), TypeScript, mysql2/promise (no ORM), Zod, Vitest.
docker-compose up --force-recreate --build- UI: http://localhost/
- JSON: http://localhost/api/dashboards
- Health: http://localhost/api/health
Tear down with docker-compose down -v. The -v wipes the DB volume so the seed re-applies on the next up.
npm install
docker-compose up mysql-db -d
npm run devSet DB_HOST=127.0.0.1 in .env.local so the dev server reaches the compose-managed DB.
npm test
npm run typecheck./smoke_tests.shShort ADRs for the choices that are not obvious from the code:
Built and tested on macOS (Apple Silicon, Docker Desktop). The mysql:5 image runs under Rosetta via
platform: linux/amd64 — first boot of the DB is slower because of that.