No description
Find a file
David Kiania 48842d126d Fix healthcheck to use 127.0.0.1 (Alpine IPv6 localhost issue), remove labels from compose
Traefik labels managed by Dokploy UI to avoid duplication.
Healthcheck was failing because Alpine resolves localhost to ::1 (IPv6)
but Next.js only listens on IPv4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 18:10:50 +03:00
app Add Next.js app with Supabase auth, notes feature, and Docker setup 2026-04-16 15:43:09 +03:00
components Add Next.js app with Supabase auth, notes feature, and Docker setup 2026-04-16 15:43:09 +03:00
lib/supabase Fix TypeScript implicit any error on setAll cookie parameter 2026-04-16 16:30:43 +03:00
public Add public directory required by Dockerfile COPY step 2026-04-16 16:33:45 +03:00
supabase/migrations Add Next.js app with Supabase auth, notes feature, and Docker setup 2026-04-16 15:43:09 +03:00
.env.example Add Next.js app with Supabase auth, notes feature, and Docker setup 2026-04-16 15:43:09 +03:00
.gitignore Add Next.js app with Supabase auth, notes feature, and Docker setup 2026-04-16 15:43:09 +03:00
docker-compose.yml Fix healthcheck to use 127.0.0.1 (Alpine IPv6 localhost issue), remove labels from compose 2026-04-16 18:10:50 +03:00
Dockerfile Add Next.js app with Supabase auth, notes feature, and Docker setup 2026-04-16 15:43:09 +03:00
middleware.ts Fix TypeScript implicit any error on setAll cookie parameter 2026-04-16 16:30:43 +03:00
next.config.ts Add Next.js app with Supabase auth, notes feature, and Docker setup 2026-04-16 15:43:09 +03:00
package-lock.json Add package-lock.json and upgrade Next.js to 15.5.15 (fixes CVE-2025-66478) 2026-04-16 16:25:05 +03:00
package.json Add package-lock.json and upgrade Next.js to 15.5.15 (fixes CVE-2025-66478) 2026-04-16 16:25:05 +03:00
README.md Update README.md 2026-04-16 15:46:05 +03:00
tsconfig.json Add Next.js app with Supabase auth, notes feature, and Docker setup 2026-04-16 15:43:09 +03:00

karuradev-test-app

End-to-end deployment smoke test for the self-hosted stack:

Forgejo  →  Dokploy (Docker Compose)  →  Supabase (Auth + DB)

What this tests

Layer What's exercised
Forgejo Source repo, webhook trigger to Dokploy
Dokploy Multi-stage Docker build, Compose deploy, healthcheck
Supabase Auth Email/password signup, login, SSR session via cookies
Supabase DB notes table, Row Level Security, per-user reads/writes
Next.js 15 Server Components, middleware, edge health route

Quick start

1. Run the DB migration

In your Supabase SQL editor, run the contents of:

supabase/migrations/001_notes.sql

This creates the notes table and RLS policies.

2. Local dev

cp .env.example .env.local
# fill in your Supabase URL and anon key

npm install
npm run dev

Open http://localhost:3000 — it redirects to /auth/login.

3. Deploy via Dokploy

  1. Push this repo to your Forgejo instance
  2. In Dokploy, create a new application → Docker Compose
  3. Set source to your Forgejo repo
  4. Add environment variables:
    NEXT_PUBLIC_SUPABASE_URL=https://your-supabase.yourdomain.com
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
    
  5. Set the compose file to docker-compose.yml
  6. Deploy

4. Configure Supabase redirect URLs

In your Supabase dashboard → Authentication → URL Configuration:

  • Site URL: https://your-app.yourdomain.com
  • Redirect URLs: add https://your-app.yourdomain.com/**

Project structure

app/
  auth/login/        ← public login
  auth/signup/       ← public signup
  dashboard/         ← protected, SSR, reads user + notes
  api/health/        ← GET /api/health — Docker healthcheck
components/
  AuthForm.tsx       ← client, email/password auth
  NotesList.tsx      ← client, create/delete notes
  SignOutButton.tsx
lib/supabase/
  server.ts          ← SSR client (cookies)
  client.ts          ← browser client
middleware.ts        ← route guard + session refresh
supabase/
  migrations/        ← SQL to run in Supabase
Dockerfile           ← multi-stage standalone build
docker-compose.yml   ← Dokploy entry point

Healthcheck

GET /api/health
→ { "status": "ok", "app": "karuradev-test-app", "ts": "..." }

Dokploy and Docker will use this to verify the container is alive.