Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c8a16d5
fix(security): remove mock jwt bypass and externalize secrets to env …
vpn-cli Nov 17, 2026
702a4ce
fix(routing): route client requests strictly through api gateway to p…
vpn-cli Nov 17, 2026
bf7ca54
feat(orchestration): configure docker-compose with kraft kafka, postg…
vpn-cli Nov 17, 2026
bb7f645
feat(orchestration): add one-command stack startup and end-to-end che…
vpn-cli Nov 17, 2026
491db66
fix(security): remove GET auth backdoor and gate POST behind DEMO_AUT…
vpn-cli Nov 17, 2026
2bfe606
fix(routes): enforce single /payment endpoint and remove route aliases
vpn-cli Nov 17, 2026
dd7ed2a
feat(orchestration): switch to official apache/kafka kraft image and …
vpn-cli Nov 17, 2026
ba3acfb
perf(benchmarks): measure and document first-request vs steady-state …
vpn-cli Nov 17, 2026
5368e0e
feat(core): implement transactional outbox with skip locked, idempote…
vpn-cli Nov 17, 2026
539440e
feat(events): enforce deterministic partition keys, correlation and c…
vpn-cli Nov 17, 2026
632a1cb
feat(outbox): eliminate dual-write in order and email services with a…
vpn-cli Nov 17, 2026
ecb5f6f
feat(idempotency): implement processed_events deduplication in analyt…
vpn-cli Nov 17, 2026
9d77993
feat(orchestration): wire postgres persistence in docker-compose and …
vpn-cli Nov 17, 2026
e59ebf2
feat(testing): add crash-recovery, broker-outage, and e2e-latency int…
vpn-cli Nov 17, 2026
98b0cc3
docs: update benchmarks, architecture guide, and interview prep with …
vpn-cli Nov 17, 2026
70ea9cf
docs(benchmarks): document empirical cold-start, k6 load test, and ou…
vpn-cli Nov 17, 2026
67c46f8
chore(git): add interview project flow markdown and latex artifacts t…
vpn-cli Nov 17, 2026
177b1aa
perf(gateway,payment): optimize throughput with connection pooling, p…
vpn-cli Nov 17, 2026
c5588d2
refactor(auth,benchmarks): revert jwt verification cache and add meas…
vpn-cli Nov 18, 2026
756000d
chore: add Phase 1 benchmark raw results (all 4 configurations)
vpn-cli Nov 18, 2026
71a8f72
fix(payment): implement kafka retry with backoff and 503 health check
vpn-cli Nov 18, 2026
6fdf63a
perf(payment): batch kafka producer sends in outbox relay worker
vpn-cli Nov 18, 2026
910d6dc
docs(benchmarks): update Phase 1 benchmarks with accepted vs complete…
vpn-cli Nov 18, 2026
e90c881
feat(payment): add outbox pruning, configurable relay busy pause, and…
vpn-cli Nov 18, 2026
4269d14
feat(benchmarks): support 1,000 distinct user JWTs distributed per VU…
vpn-cli Nov 18, 2026
51cc87c
test(benchmarks): add master gateway keep-alive probe and clean matri…
vpn-cli Nov 18, 2026
3e3f661
docs(benchmarks): document clean rerun matrix and answers to the 9 ar…
vpn-cli Nov 18, 2026
77e9b9c
feat(payment): split liveness (/health) and relay status (/relay-stat…
vpn-cli Nov 18, 2026
40a760d
test(order-service): instrument consumer message breakdown and measur…
vpn-cli Nov 18, 2026
f013d59
feat(outbox): add partial indexes and background pruning for order an…
vpn-cli Nov 18, 2026
4efe594
feat(order-service): implement dual-mode consumer supporting partitio…
vpn-cli Nov 18, 2026
5c7f584
fix(infra): pass consumer and relay env vars in docker-compose, fix p…
vpn-cli Nov 18, 2026
67bd289
feat(observability): log effective container configs at startup, surf…
vpn-cli Nov 18, 2026
b437de4
test(benchmarks): add clean full-drain raw results for baseline_consu…
vpn-cli Nov 18, 2026
a13780c
docs(benchmarks): update PHASE1-BENCHMARKS with verified full-drain c…
vpn-cli Nov 18, 2026
f750d81
feat(order-service): add eachBatch per-message poison fallback, DLQ i…
vpn-cli Nov 18, 2026
b12fe60
feat(consumers): apply eachBatch and batched outbox relays to email a…
vpn-cli Nov 18, 2026
0a8f721
ci: run Docker Compose resilience suite in GitHub Actions and fix cro…
vpn-cli Nov 18, 2026
49e72b0
chore(security): remove hardcoded Neon credential, strip demo JWTs fr…
vpn-cli Nov 18, 2026
152ddec
feat(demo): add narrated npm run demo:outage script showing Kafka out…
vpn-cli Nov 18, 2026
05c8a19
docs(readme): update architecture diagram, verified full-drain benchm…
vpn-cli Nov 18, 2026
d7069ab
fix(gateway): centralize JWT_SECRET validation in config.js with no f…
vpn-cli Nov 18, 2026
f7490d0
chore(config): remove hardcoded JWT_SECRET defaults and auto-generate…
vpn-cli Nov 18, 2026
6d0c96e
ci(security): generate ephemeral JWT_SECRET per run and randomize ben…
vpn-cli Nov 18, 2026
2df8ba7
chore(deps): apply non-breaking npm audit fixes in api-gateway and pa…
vpn-cli Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# StreamMart Environment Variables Template
# Copy this file to .env and configure values before starting services

# Application Environment
NODE_ENV=development
PORT=8085
GATEWAY_URL=http://localhost:8085

# Database Configuration (PostgreSQL)
# For local Docker Compose Postgres:
DATABASE_URL=postgresql://postgres:postgres@postgres:5432/streammart
# For local host access:
# DATABASE_URL=postgresql://postgres:postgres@localhost:5432/streammart
# For remote PostgreSQL with TLS:
# DATABASE_URL=postgresql://<user>:<password>@<remote-host>:5432/<db>?sslmode=require

# Apache Kafka Configuration (KRaft Single-Node Broker)
# Within Docker Compose network:
KAFKA_BROKERS=kafka:9092
# From host machine:
# KAFKA_BROKERS=localhost:9094

# Authentication (API Gateway JWT Secret - minimum 32 characters)
JWT_SECRET=replace-with-output-of-openssl-rand-hex-32

# Internal Service Routing (Used by API Gateway)
PAYMENT_SERVICE_URL=http://payment-service:8000
5 changes: 2 additions & 3 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@


DATABASE_URL=postgresql://postgres.xxxxx:password@aws-0-eu-central-1.pooler.supabase.com:6543/postgres
# Copy to .env and fill in your local or remote PostgreSQL connection string
DATABASE_URL=postgresql://<user>:<password>@<host>:5432/<db>
116 changes: 91 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,103 @@ name: Microservices CI

on:
push:
branches: [ "main" ]
branches: [ "master", "main", "fix/*" ]
pull_request:
branches: [ "main" ]
branches: [ "master", "main", "fix/*" ]

jobs:
build-and-test:
unit-and-integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies and test Payment Service
run: |
cd payment-service
npm install
npm test
env:
NODE_ENV: test

# Later you can add steps here to build the docker images and push them to a registry (Docker Hub/ECR)
- name: Build Docker Image for Payment Service
run: |
cd payment-service
docker build -t my-payment-service:test .
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Generate ephemeral JWT_SECRET
run: |
SECRET=$(openssl rand -hex 32)
echo "::add-mask::$SECRET"
echo "JWT_SECRET=$SECRET" >> "$GITHUB_ENV"

- name: Install dependencies & test API Gateway
run: |
cd api-gateway
npm install
npm test

- name: Install dependencies & test Payment Service
run: |
cd payment-service
npm install
npm test
env:
NODE_ENV: test

- name: Install dependencies & test Order Service
run: |
cd order-service
npm install
npm test

- name: Install dependencies & test Email Service
run: |
cd email-service
npm install
npm test

- name: Install dependencies & test Analytic Service
run: |
cd analytic-service
npm install
npm test

docker-resilience-tests:
needs: unit-and-integration-tests
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Generate ephemeral JWT_SECRET
run: |
SECRET=$(openssl rand -hex 32)
echo "::add-mask::$SECRET"
echo "JWT_SECRET=$SECRET" >> "$GITHUB_ENV"

- name: Start full stack with Docker Compose
run: docker compose up -d --build --wait

- name: Poison message fallback test (eachBatch)
run: node scripts/test-poison-batch.js

- name: Mid-batch crash recovery test (SIGKILL before offset commit)
run: node scripts/test-mid-batch-crash.js

- name: Order-service crash recovery test (kill between DB commit and publish)
run: node scripts/test-order-crash-recovery.js

- name: Kafka outage & concurrent SKIP LOCKED relay test (500 checkouts)
run: node scripts/test-outbox-outage.js

- name: Collect container status on failure
if: failure()
run: |
docker compose ps
docker compose logs --tail=80

- name: Tear down stack
if: always()
run: docker compose down -v
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ microservices-kafka/
# Interview Prep
interview.md
append-interview
project_flow_for_interviews.md
project_flow_for_interviews.tex
Loading
Loading