ByteBite Docs
Development

Getting Started

First-time setup for the ByteBite monorepo.

Getting Started

Prerequisites

  • macOS development environment (primary target)
  • Docker Desktop or a compatible Docker runtime (Compose v2+)
  • Git
  • pnpm (host-side lint / typecheck / test / build)
  • Node.js 24 LTS (see .nvmrc)

Database commands run inside Docker. You do not need a host node_modules install solely to migrate or seed.

First-time setup

  1. Clone / open the repository.

  2. Copy .env.example to .env.

  3. Add the required /etc/hosts entries (see the root README.md). Include both 127.0.0.1 and ::1 lines — IPv4-only entries cause ~5s delays on macOS when clients attempt AAAA lookups for .test hostnames.

  4. Start the Docker development stack:

    pnpm dev

    This runs docker compose -f compose.yml -f compose.dev.yml up.

  5. With the stack running, apply the schema and seed Luigi / Mario:

    pnpm db:migrate
    pnpm db:seed

Local URLs

ServiceURL
Storefronthttp://storefront.bytebite.test
Dashboardhttp://dashboard.bytebite.test
API (direct)http://api.bytebite.test
Docshttp://docs.bytebite.test
Luigihttp://luigi.bytebite.test
Mariohttp://mario.bytebite.test
Unknown restauranthttp://unknown.bytebite.test
Same-origin APIhttp://<app-host>/api/...
MinIO consolehttp://localhost:9001
Traefik dashboardhttp://localhost:8080
Drizzle Studiohttp://localhost:4983 (pnpm db:studio)

Direct API example: http://api.bytebite.test/health

Same-origin examples (Traefik strips /api before Fastify):

  • http://luigi.bytebite.test/api/storefront/restaurant
  • http://mario.bytebite.test/api/storefront/restaurant
  • http://luigi.bytebite.test/api/health
  • http://dashboard.bytebite.test/api/health

Commands

CommandDescription
pnpm devStart the Docker dev stack
pnpm dev:downStop the dev stack
pnpm dev:rebuildRebuild images and start the stack
pnpm buildBuild all apps/packages (Turborepo, host)
pnpm lintLint the monorepo
pnpm typecheckTypecheck the monorepo
pnpm testRun unit/integration tests (Vitest)
pnpm db:generateGenerate Drizzle migrations (API container; stack running)
pnpm db:migrateApply migrations (API container; stack running)
pnpm db:seedSeed the local database (API container; stack running)
pnpm db:studioDrizzle Studio at http://localhost:4983

The API does not auto-migrate on startup. pnpm db:* is the documented workflow.

Environment notes

  • .env DATABASE_URL uses localhost (host network).
  • Compose overrides DATABASE_URL inside the API container to hostname postgres.
  • Compose overrides S3_ENDPOINT inside the API container to http://minio:9000.
  • Storefront and Dashboard browser bundles do not receive server secrets. Browser API calls use same-origin /api.
  • Docker dev uses anonymous volumes for apps/docs/.next and apps/storefront/.next so host-side pnpm build output does not corrupt the in-container Next.js dev/Turbopack cache. After adding new Fumadocs MDX pages, restart the docs service if the dev server was already running when the file was created.

Architecture boundaries

  • Fastify is the central backend/business boundary. Storefront and Dashboard must not access PostgreSQL directly.
  • packages/domain is infrastructure-independent.
  • No packages/ui; Dashboard shadcn components live at apps/dashboard/src/components/ui/.
  • No separate apps/admin; the initial ADMIN area is a protected section inside Dashboard.

On this page