Initial commit: site monorepo with API, web, and infra.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
влад
2026-07-16 10:11:54 +03:00
co-authored by Cursor
commit 016910ffb7
447 changed files with 73972 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
BACKUP_DIR="$ROOT/backups"
mkdir -p "$BACKUP_DIR"
STAMP="$(date +%F-%H%M)"
FILE="$BACKUP_DIR/postgres-$STAMP.sql.gz"
docker compose -f "$ROOT/infra/docker/docker-compose.prod.yml" exec -T postgres \
pg_dump -U "${POSTGRES_USER:-compton_app}" "${POSTGRES_DB:-compton}" | gzip > "$FILE"
echo "Backup written: $FILE"
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
BASE="${1:-http://localhost:8000}"
BASE="${BASE%/}"
fail() {
echo "FAIL: $1"
exit 1
}
code="$(curl -fsS -o /dev/null -w "%{http_code}" "$BASE/api/v1/health" || echo 000)"
[[ "$code" == "200" ]] || fail "health returned $code"
root_code="$(curl -fsS -o /dev/null -w "%{http_code}" "${BASE%/api/v1/health}/" 2>/dev/null || curl -fsS -o /dev/null -w "%{http_code}" "$(echo "$BASE" | sed 's|:8000||')/" || echo 000)"
echo "Landing/root HTTP: $root_code"
echo "OK: health check passed"
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
BASE="${1:-http://127.0.0.1:8000}"
BASE="${BASE%/}"
echo "== Smoke: health =="
curl -fsS "$BASE/api/v1/health" | grep -q '"status":"ok"'
echo "== Smoke: docs disabled =="
docs_code="$(curl -s -o /dev/null -w "%{http_code}" "$BASE/api/v1/docs")"
[[ "$docs_code" == "404" || "$docs_code" == "307" ]] || { echo "Expected docs 404, got $docs_code"; exit 1; }
echo "== Smoke: public content =="
curl -fsS "$BASE/api/v1/content/pages" | grep -q '"data"'
echo "All smoke checks passed."