From 2fe5b51f80e8df5ecbaf148915c3657d4eb7d5e1 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Thu, 14 May 2026 17:54:18 +0200 Subject: [PATCH] feat(01-01): compose file, env example, gitignore, bootstrap migration - compose.yaml: postgres:16-alpine with pg_isready healthcheck (no seed mounts) - .env.example: DATABASE_URL, PORT, ENV (D-15) - .gitignore: bin/, tmp/, .env, generated tailwind.css, bootstrap-downloaded htmx.min.js, *_templ.go, sqlc output - migrations/0001_init.sql: goose no-op bootstrap migration --- backend/.env.example | 8 ++++++++ backend/.gitignore | 24 ++++++++++++++++++++++++ backend/compose.yaml | 21 +++++++++++++++++++++ backend/migrations/0001_init.sql | 6 ++++++ 4 files changed, 59 insertions(+) create mode 100644 backend/.env.example create mode 100644 backend/.gitignore create mode 100644 backend/compose.yaml create mode 100644 backend/migrations/0001_init.sql diff --git a/backend/.env.example b/backend/.env.example new file mode 100644 index 0000000..64a9610 --- /dev/null +++ b/backend/.env.example @@ -0,0 +1,8 @@ +# Postgres connection string used by the web + worker binaries (and `just migrate`). +DATABASE_URL=postgres://xtablo:xtablo@localhost:5432/xtablo?sslmode=disable + +# HTTP port for cmd/web. +PORT=8080 + +# Environment selector: "development" enables the slog text handler; "production" switches to JSON. +ENV=development diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 0000000..894176d --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1,24 @@ +# Local environment files (only .env.example is committed) +.env +.env.local + +# Bootstrap-downloaded CLIs and Tailwind binary (re-created by `just bootstrap`) +bin/ +!bin/.gitkeep + +# air rebuild output +tmp/ + +# Tailwind-compiled CSS (re-created by `just generate` / `just styles-watch`) +static/tailwind.css + +# HTMX bootstrap-downloaded by `just bootstrap` (never committed; the justfile is the single +# authoritative source for the pinned HTMX version — see CONTEXT D-10) +static/htmx.min.js + +# templ-generated Go files (regenerate via `templ generate` — Research Pitfall 1) +*_templ.go + +# sqlc-generated code (regenerate via `sqlc generate`); keep the .gitkeep +internal/db/sqlc/*.go +!internal/db/sqlc/.gitkeep diff --git a/backend/compose.yaml b/backend/compose.yaml new file mode 100644 index 0000000..1f5777f --- /dev/null +++ b/backend/compose.yaml @@ -0,0 +1,21 @@ +services: + postgres: + image: postgres:16-alpine + container_name: xtablo-backend-postgres + restart: unless-stopped + environment: + POSTGRES_DB: xtablo + POSTGRES_USER: xtablo + POSTGRES_PASSWORD: xtablo + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U xtablo -d xtablo"] + interval: 5s + timeout: 5s + retries: 10 + +volumes: + postgres_data: diff --git a/backend/migrations/0001_init.sql b/backend/migrations/0001_init.sql new file mode 100644 index 0000000..64cafd3 --- /dev/null +++ b/backend/migrations/0001_init.sql @@ -0,0 +1,6 @@ +-- +goose Up +-- Phase 1: no-op bootstrap migration. Real schema lands in Phase 2 (sessions/users) and Phase 3 (tablos). +SELECT 1; + +-- +goose Down +SELECT 1;