Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,33 @@ web3-student-lab/
- Rust toolchain (for smart contracts)
- Stellar CLI

### Infrastructure (Docker Compose)

Most day-to-day work only needs **PostgreSQL + standalone Redis**. Prefer the development override so Sentinel and Cluster nodes are not started:

```bash
# Recommended for development (PostgreSQL + standalone Redis only)
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
```

Other compose profiles:

```bash
# Full stack (PostgreSQL, Redis, Sentinels, Cluster, backend) — production-like testing
docker compose -f docker-compose.yml up -d

# High-availability Redis testing (Sentinel / Cluster wired for the backend)
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
```

| File | Purpose |
|------|---------|
| `docker-compose.yml` | Full stack: Postgres, Redis, Sentinels, Cluster, backend |
| `docker-compose.dev.yml` | Dev override: Postgres + standalone Redis only |
| `docker-compose.prod.yml` | HA override: Sentinel/Cluster-oriented backend config |

Stop services with `docker compose down` (pass the same `-f` flags you used to start).

## 🔐 MVP Update: Decentralized Identity Verification

The Open Source Contribution Trainer now includes decentralized identity verification for contributor
Expand All @@ -88,7 +115,6 @@ workflows in `frontend/src/app/version-control/page.tsx`.
`frontend/src/lib/version-control/engine.ts`.
- Core attestation creation and verification logic lives in
`frontend/src/lib/open-source-trainer/identity.ts`.
>>>>>>> origin/main

## 🤝 Contributing

Expand Down
28 changes: 28 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Development override — PostgreSQL + standalone Redis only.
# Usage (from repo root):
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
#
# This disables the read replica, Redis Sentinels, Redis Cluster nodes,
# and the backend container so local development stays lightweight.

services:
db-read-replica:
profiles: ["disabled"]

redis-sentinel-1:
profiles: ["disabled"]

redis-sentinel-2:
profiles: ["disabled"]

redis-cluster-1:
profiles: ["disabled"]

redis-cluster-2:
profiles: ["disabled"]

redis-cluster-3:
profiles: ["disabled"]

backend:
profiles: ["disabled"]
32 changes: 32 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Production-like / high-availability override — Sentinel + Cluster enabled.
# Usage (from repo root):
# docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# Use this when you need to exercise Redis Sentinel failover or Cluster
# topology alongside PostgreSQL. The base docker-compose.yml already
# defines these services; this file wires the backend to HA Redis modes.

services:
backend:
environment:
# Switch to sentinel or cluster as needed for HA testing:
# REDIS_MODE=sentinel | REDIS_MODE=cluster | REDIS_MODE=standalone
- REDIS_MODE=${REDIS_MODE:-sentinel}
- REDIS_SENTINELS=redis-sentinel-1:26379,redis-sentinel-2:26380
- REDIS_SENTINEL_NAME=mymaster
- REDIS_CLUSTER_NODES=redis-cluster-1:6381,redis-cluster-2:6382,redis-cluster-3:6383
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
redis-sentinel-1:
condition: service_healthy
redis-sentinel-2:
condition: service_healthy
redis-cluster-1:
condition: service_healthy
redis-cluster-2:
condition: service_healthy
redis-cluster-3:
condition: service_healthy
15 changes: 7 additions & 8 deletions docs/REDIS_CACHING_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,15 @@ await invalidateCourseCache(courseId);

### Start Services
```bash
# Standalone mode (development)
docker-compose up
# Recommended for development (Postgres + standalone Redis only)
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d

# Scale with Sentinel (high availability)
# Ensure REDIS_MODE=sentinel in backend environment
docker-compose up
# Full stack / production-like (includes Sentinel + Cluster)
docker compose -f docker-compose.yml up -d

# Scale with Cluster (distributed)
# Ensure REDIS_MODE=cluster in backend environment
docker-compose up
# High-availability Redis testing (Sentinel/Cluster-oriented backend config)
# Ensure REDIS_MODE=sentinel or REDIS_MODE=cluster as needed
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
```

### Initialize Redis Cluster
Expand Down
10 changes: 8 additions & 2 deletions docs/REDIS_SETUP_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ NODE_ENV=development
### 3. Start Services

```bash
# From project root
docker-compose up -d
# From project root — recommended for development (Postgres + standalone Redis only)
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d

# Full stack including Sentinel + Cluster (production-like)
docker compose -f docker-compose.yml up -d

# HA testing with Sentinel/Cluster-oriented backend config
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d

# Verify services are running
docker ps
Expand Down
4 changes: 3 additions & 1 deletion docs/architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,11 @@ Choose one of the following options.

#### Option A: Use Docker Compose

From the project root:
From the project root (recommended: Postgres + standalone Redis only):

```bash
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# Or start just the database:
docker compose up -d db
```

Expand Down
4 changes: 3 additions & 1 deletion docs/general/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,11 @@ Choose one of the following options.

#### Option A: Use Docker Compose

From the project root:
From the project root (recommended: Postgres + standalone Redis only):

```bash
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# Or start just the database:
docker compose up -d db
```

Expand Down
Loading