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
This commit is contained in:
parent
4de96854b5
commit
2fe5b51f80
4 changed files with 59 additions and 0 deletions
8
backend/.env.example
Normal file
8
backend/.env.example
Normal file
|
|
@ -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
|
||||||
24
backend/.gitignore
vendored
Normal file
24
backend/.gitignore
vendored
Normal file
|
|
@ -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
|
||||||
21
backend/compose.yaml
Normal file
21
backend/compose.yaml
Normal file
|
|
@ -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:
|
||||||
6
backend/migrations/0001_init.sql
Normal file
6
backend/migrations/0001_init.sql
Normal file
|
|
@ -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;
|
||||||
Loading…
Reference in a new issue