Skip to content

Commit a699ed3

Browse files
committed
feat: end-to-end WalStream CDC platform with durable ingest/replay, FastAPI control plane, Next.js dashboard, and observability
1 parent 43f7cac commit a699ed3

File tree

167 files changed

+20494
-4798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+20494
-4798
lines changed

.claude/settings.local.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,26 @@
55
"Bash(tree:*)",
66
"Bash(mkdir:*)",
77
"WebSearch",
8-
"Bash(findstr:*)"
8+
"Bash(findstr:*)",
9+
"Bash(find:*)",
10+
"Bash(npx shadcn@latest add:*)",
11+
"Bash(npm install:*)",
12+
"Bash(npm run build:*)",
13+
"Bash(test:*)",
14+
"Bash(grep:*)",
15+
"Bash(python -c:*)",
16+
"Bash(python -m pytest:*)",
17+
"Bash(.venv/Scripts/python -m pytest control/tests/ -x -v --tb=short)",
18+
"Bash(.venv/Scripts/pip list:*)",
19+
"Bash(.venv/Scripts/python -m pip:*)",
20+
"Bash(.venv/Scripts/python.exe -m pip:*)",
21+
"Bash(.venv/Scripts/python.exe:*)",
22+
"Bash(where:*)",
23+
"Bash(ls:*)"
924
]
10-
}
25+
},
26+
"enableAllProjectMcpServers": true,
27+
"enabledMcpjsonServers": [
28+
"context7"
29+
]
1130
}

.env.example

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,32 @@
1-
# WalStream CDC Configuration
2-
# Copy this file to .env and adjust values as needed
3-
4-
# ==========================================================================
5-
# Database
6-
# ==========================================================================
7-
81
# Source database (PostgreSQL with WAL)
92
POSTGRES_HOST=localhost
103
POSTGRES_USER=repluser
114
POSTGRES_PASSWORD=replpass
125
POSTGRES_DB=walstreamdb
13-
146
# Control plane database
157
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5433/walstream_control
16-
17-
# ==========================================================================
18-
# Message Queues
19-
# ==========================================================================
20-
21-
# Redis
228
REDIS_URL=redis://localhost:6379/0
239
REDIS_STREAM=walstream:events
2410
REDIS_STREAM_MAXLEN=100000
25-
2611
# Kafka
2712
KAFKA_BROKER=localhost:29092
2813
KAFKA_TOPIC=walstream.archive
29-
30-
# ==========================================================================
31-
# Services
32-
# ==========================================================================
33-
3414
# Replayer gRPC
3515
REPLAYER_HOST=localhost
3616
REPLAYER_PORT=50051
3717
REPLAYER_TIMEOUT_SECONDS=30
38-
3918
# Target database for replay
4019
TARGET_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/walstreamdb
41-
4220
# Dedup database
4321
DEDUP_DATABASE_URL=postgresql://postgres:postgres@localhost:5433/walstream_control
44-
45-
# ==========================================================================
46-
# Security
47-
# ==========================================================================
48-
49-
# JWT Secret (change in production!)
5022
SECRET_KEY=change-me-in-production-use-long-random-string
5123
JWT_ALGORITHM=HS256
5224
JWT_EXPIRATION_MINUTES=60
53-
54-
# ==========================================================================
55-
# CORS
56-
# ==========================================================================
57-
5825
CORS_ORIGINS=["http://localhost:3000"]
59-
60-
# ==========================================================================
61-
# Worker Configuration
62-
# ==========================================================================
63-
6426
JOB_WORKER_COUNT=4
6527
JOB_POLL_INTERVAL_SECONDS=1.0
6628
JOB_HEARTBEAT_INTERVAL_SECONDS=10.0
6729
JOB_LEASE_DURATION_SECONDS=300
68-
69-
# ==========================================================================
70-
# Observability
71-
# ==========================================================================
72-
7330
METRICS_PORT=9091
7431
LOG_LEVEL=INFO
7532
DEBUG=false

.mcp.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"mcpServers": {
3+
"context7": {
4+
"type": "http",
5+
"url": "https://mcp.context7.com/mcp",
6+
"headers": {
7+
"CONTEXT7_API_KEY": "ctx7sk-6467cf35-65f9-4546-8719-4e820ec50818"
8+
}
9+
}
10+
}
11+
}

Makefile

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.PHONY: up down logs test lint proto migrate migrate-check migrate-new clean help
2+
3+
up:
4+
docker-compose up -d
5+
down:
6+
docker-compose down
7+
## Tail logs for all services
8+
logs:
9+
docker-compose logs -f --tail=50
10+
11+
## Start monitoring stack (Prometheus + Grafana + Alertmanager)
12+
up-monitoring:
13+
docker-compose --profile monitoring up -d
14+
## Run Alembic migrations to head
15+
migrate:
16+
cd control && alembic upgrade head
17+
18+
## Check current DB revision
19+
migrate-check:
20+
cd control && alembic current
21+
22+
## Create a new migration (usage: make migrate-new MSG="add foo column")
23+
migrate-new:
24+
cd control && alembic revision --autogenerate -m "$(MSG)"
25+
## Show migration history
26+
migrate-history:
27+
cd control && alembic history --verbose
28+
## Regenerate protobuf Python files
29+
proto:
30+
cd walstream-proto && python -m walstream_proto.generate
31+
32+
test:
33+
pytest --tb=short -q
34+
35+
test-cov:
36+
pytest --cov=control --cov=ingestor --cov=replayer --tb=short
37+
38+
## Run proto compatibility tests
39+
test-proto:
40+
pytest walstream-proto/tests/ --tb=short -q
41+
42+
## Run delivery-semantics focused tests
43+
test-delivery:
44+
pytest -k "delivery or dedup or idempoten" --tb=short -q
45+
46+
lint:
47+
ruff check .
48+
49+
fmt:
50+
ruff format .
51+
52+
typecheck:
53+
mypy control/ ingestor/ replayer/
54+
55+
check: lint typecheck
56+
57+
dev-control:
58+
cd control && uvicorn app.main:app --reload --port 8000
59+
60+
dev-ingestor:
61+
python ingestor/ingestor.py
62+
63+
dev-replayer:
64+
python replayer/server.py
65+
66+
dev-frontend:
67+
cd frontend && npm run dev
68+
69+
## Remove Python caches and build artifacts
70+
clean:
71+
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
72+
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
73+
find . -type d -name .mypy_cache -exec rm -rf {} + 2>/dev/null || true
74+
find . -name "*.pyc" -delete 2>/dev/null || true
75+
76+
## Remove Docker volumes (DESTRUCTIVE)
77+
clean-volumes:
78+
docker-compose down -v
79+
80+
help:
81+
@echo "WalStream CDC - Available targets:"
82+
@echo ""
83+
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/^## / /'
84+
@echo ""
85+
@echo "Run 'make <target>' to execute."

0 commit comments

Comments
 (0)