feat: build core API, fraud engine, notifier, and frontend
Phase 1 — Core API (Go): - Events, guests, tokens, RSVPs CRUD on PostgreSQL via pgx/v5 - HMAC-signed per-guest tokens with format validation - Health endpoint with DB ping, slog JSON logging, graceful shutdown Phase 2 — NATS + Fraud Engine: - NATS JetStream pub/sub with explicit-ack consumers - Python/FastAPI fraud engine with heuristic risk scoring (fingerprint mismatch, IP change, missing signals, repeated access) - gRPC sync scoring with 250ms fail-open timeout - Per-guest baseline tracking; risk bands low/medium/high/block Phase 3 — Notifications + Frontend: - Notification worker scaffolding (Twilio/SES stubs, retry/backoff) - Nuxt 3 frontend with Tailwind dark theme + brand green - Live monitor via WebSocket with auto-reconnect - Activity history endpoint backfills monitor with RSVPs + scored access checks (including blocked attempts) UX polish: - Marketing-friendly landing page (hero mockup, how-it-works, features, use cases, testimonials, FAQ, final CTA) - Animated layered card mockups on landing + new-event page - Plus-ones stepper, RSVP status badges, filter buttons - Friendly access-check labels (Verified/Review/Suspicious/Blocked) - Dashboard hydration fix via ClientOnly wrapper Infrastructure: - docker-compose for full local dev (postgres, nats, api, fraud-engine, notifier, frontend) - Multi-stage Dockerfiles, non-root UID 1000 - Integration tests with testcontainers-go Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
.PHONY: build run test integration-test vet tidy fmt up down logs clean fraud-test fraud-install proto
|
||||
|
||||
build:
|
||||
go build -o bin/api ./cmd/api
|
||||
|
||||
run:
|
||||
go run ./cmd/api
|
||||
|
||||
test:
|
||||
go test ./... -race -count=1
|
||||
|
||||
# Integration tests spin up real Postgres + NATS via testcontainers and an
|
||||
# in-process gRPC stub for the fraud engine. Requires Docker.
|
||||
integration-test:
|
||||
go test -tags=integration -count=1 -timeout=5m ./test/integration/...
|
||||
|
||||
vet:
|
||||
go vet ./...
|
||||
|
||||
tidy:
|
||||
go mod tidy
|
||||
|
||||
fmt:
|
||||
gofmt -s -w .
|
||||
|
||||
up:
|
||||
docker compose up --build -d
|
||||
|
||||
down:
|
||||
docker compose down
|
||||
|
||||
logs:
|
||||
docker compose logs -f api fraud-engine nats
|
||||
|
||||
fraud-install:
|
||||
cd fraud-engine && python3 -m venv .venv && . .venv/bin/activate && pip install -e ".[dev]"
|
||||
|
||||
fraud-test:
|
||||
cd fraud-engine && . .venv/bin/activate && python -m pytest -v
|
||||
|
||||
# Regenerates Go + Python stubs from proto/fraud/v1/fraud.proto.
|
||||
# Requires fraud-engine venv (provides bundled protoc via grpcio-tools)
|
||||
# and the Go plugins (protoc-gen-go, protoc-gen-go-grpc) on $(go env GOPATH)/bin.
|
||||
proto:
|
||||
@command -v protoc-gen-go >/dev/null || go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
|
||||
@command -v protoc-gen-go-grpc >/dev/null || go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
|
||||
cd fraud-engine && . .venv/bin/activate && \
|
||||
PATH="$$(go env GOPATH)/bin:$$PATH" python -m grpc_tools.protoc -I ../proto \
|
||||
--go_out=.. --go_opt=module=github.com/alchemistkay/guestguard \
|
||||
--go-grpc_out=.. --go-grpc_opt=module=github.com/alchemistkay/guestguard \
|
||||
--python_out=. --pyi_out=. --grpc_python_out=. \
|
||||
../proto/fraud/v1/fraud.proto
|
||||
|
||||
clean:
|
||||
rm -rf bin fraud-engine/.venv
|
||||
Reference in New Issue
Block a user