From af58550f7f3596dae0f641ba4ddc1071ebebb60d Mon Sep 17 00:00:00 2001 From: JakkrapartXD Date: Mon, 12 Jan 2026 03:36:54 +0000 Subject: [PATCH] remove redis --- Backend/.agent/workflows/deployment.md | 4 -- .../.agent/workflows/e-learning-backend.md | 6 +-- Backend/.agent/workflows/setup.md | 4 -- Backend/.agent/workflows/testing.md | 9 +--- Backend/.env.example | 4 -- Backend/README.md | 2 - Backend/agent_skills_backend.md | 2 +- Backend/compose.yaml | 22 --------- docs/api-docs/ER/README.md | 1 - docs/development_setup.md | 47 ++++--------------- 10 files changed, 12 insertions(+), 89 deletions(-) diff --git a/Backend/.agent/workflows/deployment.md b/Backend/.agent/workflows/deployment.md index ea9230b3..5363238b 100644 --- a/Backend/.agent/workflows/deployment.md +++ b/Backend/.agent/workflows/deployment.md @@ -12,7 +12,6 @@ Follow these steps to deploy the E-Learning Platform backend to production. - Production server with Node.js 18+ - PostgreSQL database -- Redis server - MinIO/S3 storage - Domain name and SSL certificate @@ -75,9 +74,6 @@ APP_URL=https://api.elearning.com # Database DATABASE_URL=postgresql://user:password@db-host:5432/elearning_prod -# Redis -REDIS_URL=redis://:password@redis-host:6379 - # MinIO/S3 S3_ENDPOINT=https://s3.elearning.com S3_ACCESS_KEY= diff --git a/Backend/.agent/workflows/e-learning-backend.md b/Backend/.agent/workflows/e-learning-backend.md index 504d5eec..48c20f61 100644 --- a/Backend/.agent/workflows/e-learning-backend.md +++ b/Backend/.agent/workflows/e-learning-backend.md @@ -266,11 +266,7 @@ model Course { } ``` -### 5.2 Caching (Redis) - -Cache course listings, user sessions, and frequently accessed data using Redis with `setEx()` for TTL. - -### 5.3 Rate Limiting +### 5.2 Rate Limiting Use `express-rate-limit` middleware to limit requests (e.g., 100 requests per 15 minutes). diff --git a/Backend/.agent/workflows/setup.md b/Backend/.agent/workflows/setup.md index 47830715..fbad002a 100644 --- a/Backend/.agent/workflows/setup.md +++ b/Backend/.agent/workflows/setup.md @@ -119,9 +119,6 @@ APP_URL=http://localhost:4000 # Database DATABASE_URL=postgresql://postgres:12345678@localhost:5432/elearning_dev -# Redis -REDIS_URL=redis://:dev_redis_password@localhost:6379 - # MinIO/S3 S3_ENDPOINT=http://localhost:9000 S3_ACCESS_KEY=admin @@ -153,7 +150,6 @@ docker compose up -d This starts: - PostgreSQL (port 5432) -- Redis (port 6379) - MinIO (ports 9000, 9001) - Mailhog (ports 1025, 8025) - Adminer (port 8080) diff --git a/Backend/.agent/workflows/testing.md b/Backend/.agent/workflows/testing.md index 541e3a39..8556070f 100644 --- a/Backend/.agent/workflows/testing.md +++ b/Backend/.agent/workflows/testing.md @@ -375,14 +375,7 @@ jest.mock('../src/services/s3.service', () => ({ })); ``` -### Mock Redis -```javascript -jest.mock('../src/services/redis.service', () => ({ - get: jest.fn(), - set: jest.fn(), - del: jest.fn() -})); -``` + --- diff --git a/Backend/.env.example b/Backend/.env.example index cde7c4ea..1c6abbbd 100644 --- a/Backend/.env.example +++ b/Backend/.env.example @@ -6,10 +6,6 @@ APP_URL=http://localhost:4000 # Database DATABASE_URL=postgresql://postgres:12345678@localhost:5432/elearning_dev -# Redis -REDIS_URL=redis://localhost:6379 -REDIS_PASSWORD=dev_redis_password - # MinIO/S3 S3_ENDPOINT=http://localhost:9000 S3_ACCESS_KEY=admin diff --git a/Backend/README.md b/Backend/README.md index 1a1bc5cc..1d1fcf59 100644 --- a/Backend/README.md +++ b/Backend/README.md @@ -11,7 +11,6 @@ Backend API for E-Learning Platform built with TypeScript, Express, TSOA, and Pr - **Role-based Authorization** - Admin, Instructor, Student roles - **Multi-language Support** - Thai and English - **File Upload** - Video and attachment support with MinIO/S3 -- **Redis Caching** - Performance optimization - **Rate Limiting** - API protection - **Comprehensive Error Handling** - Structured error responses @@ -20,7 +19,6 @@ Backend API for E-Learning Platform built with TypeScript, Express, TSOA, and Pr - Node.js >= 18 - Docker & Docker Compose - PostgreSQL (via Docker) -- Redis (via Docker) - MinIO (via Docker) ## ๐Ÿ› ๏ธ Setup diff --git a/Backend/agent_skills_backend.md b/Backend/agent_skills_backend.md index 426995af..4e9bcf00 100644 --- a/Backend/agent_skills_backend.md +++ b/Backend/agent_skills_backend.md @@ -1,7 +1,7 @@ # Agent Skills - E-Learning Backend Development > เธ„เธนเนˆเธกเธทเธญเธชเธณเธซเธฃเธฑเธš AI Agent เนƒเธ™เธเธฒเธฃเธžเธฑเธ’เธ™เธฒ Backend เธ‚เธญเธ‡เธฃเธฐเธšเธš E-Learning Platform -> **Tech Stack**: Node.js + Express + Prisma + PostgreSQL + Redis + MinIO (S3) +> **Tech Stack**: Node.js + Express + Prisma + PostgreSQL + MinIO (S3) --- diff --git a/Backend/compose.yaml b/Backend/compose.yaml index 3d7bbae7..bac438f4 100644 --- a/Backend/compose.yaml +++ b/Backend/compose.yaml @@ -50,26 +50,6 @@ services: timeout: 20s retries: 3 - # Redis - Cache & Session Store - redis: - image: redis:7-alpine - container_name: elearning-redis - restart: unless-stopped - security_opt: - - apparmor=unconfined - ports: - - "6379:6379" - command: redis-server --appendonly yes --requirepass dev_redis_password - volumes: - - redis_data:/data - networks: - - elearning-network - healthcheck: - test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] - interval: 10s - timeout: 3s - retries: 5 - # Mailhog - Email Testing mailhog: image: mailhog/mailhog:latest @@ -105,8 +85,6 @@ volumes: driver: local minio_data: driver: local - redis_data: - driver: local networks: elearning-network: diff --git a/docs/api-docs/ER/README.md b/docs/api-docs/ER/README.md index 7b318ce7..c4219e53 100644 --- a/docs/api-docs/ER/README.md +++ b/docs/api-docs/ER/README.md @@ -274,7 +274,6 @@ CREATE INDEX idx_courses_deleted ON courses(deleted_at) WHERE deleted_at IS NULL ### Query Optimization - Use `SELECT` specific columns - Implement pagination -- Cache course lists in Redis - Use database views for complex queries --- diff --git a/docs/development_setup.md b/docs/development_setup.md index 34ff79bc..1775e78f 100644 --- a/docs/development_setup.md +++ b/docs/development_setup.md @@ -22,9 +22,9 @@ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Docker Compose Stack โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ PostgreSQL โ”‚ โ”‚ MinIO โ”‚ โ”‚ Redis โ”‚ โ”‚ โ”‚ -โ”‚ โ”‚ โ”‚ Port: 5432 โ”‚ โ”‚ Port: 9000 โ”‚ โ”‚ Port: 6379 โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ PostgreSQL โ”‚ โ”‚ MinIO โ”‚ โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Port: 5432 โ”‚ โ”‚ Port: 9000 โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ @@ -52,22 +52,18 @@ - **Purpose**: File storage (videos, documents, images) - **Access**: Backend + Developers -### 3. Redis - Cache & Session -- **Port**: 6379 -- **Purpose**: Caching, session storage, queue -- **Access**: Backend only -### 4. Mailhog - Email Testing +### 3. Mailhog - Email Testing - **Port**: 1025 (SMTP), 8025 (Web UI) - **Purpose**: Catch all emails in development - **Access**: All developers -### 5. Adminer - Database Management +### 4. Adminer - Database Management - **Port**: 8080 - **Purpose**: Web-based database management - **Access**: All developers -### 6. Forgejo - Git Server +### 5. Forgejo - Git Server - **Port**: 3030 (HTTP), 2222 (SSH) - **Purpose**: Self-hosted Git repository (like GitHub/GitLab) - **Access**: All developers @@ -152,23 +148,6 @@ services: networks: - elearning-network - # Redis - Cache & Session Store - redis: - image: redis:7-alpine - container_name: elearning-redis - restart: unless-stopped - ports: - - "6379:6379" - command: redis-server --appendonly yes --requirepass dev_redis_password - volumes: - - redis_data:/data - networks: - - elearning-network - healthcheck: - test: ["CMD", "redis-cli", "--raw", "incr", "ping"] - interval: 10s - timeout: 3s - retries: 5 # Mailhog - Email Testing mailhog: @@ -226,8 +205,7 @@ volumes: driver: local minio_data: driver: local - redis_data: - driver: local + forgejo_data: driver: local @@ -296,8 +274,6 @@ docker-compose logs -f postgres # Test PostgreSQL docker exec -it elearning-postgres psql -U elearning -d elearning_dev -c "SELECT version();" -# Test Redis -docker exec -it elearning-redis redis-cli -a dev_redis_password ping # Test MinIO curl http://192.168.1.100:9000/minio/health/live @@ -391,11 +367,6 @@ DB_NAME=elearning_dev DB_USER=elearning DB_PASSWORD=dev_password_change_in_prod -# Redis -REDIS_URL=redis://:dev_redis_password@192.168.1.100:6379 -REDIS_HOST=192.168.1.100 -REDIS_PORT=6379 -REDIS_PASSWORD=dev_redis_password # MinIO/S3 S3_ENDPOINT=http://192.168.1.100:9000 @@ -500,7 +471,7 @@ docker exec -it elearning-minio mc ls local/ | **PostgreSQL** | 192.168.1.100:5432 | elearning / dev_password_change_in_prod | | **MinIO Console** | http://192.168.1.100:9001 | minioadmin / minioadmin123 | | **MinIO API** | http://192.168.1.100:9000 | - | -| **Redis** | 192.168.1.100:6379 | Password: dev_redis_password | + | **Mailhog UI** | http://192.168.1.100:8025 | - | | **Adminer** | http://192.168.1.100:8080 | - | | **Forgejo** | http://192.168.1.100:3030 | Setup on first visit | @@ -647,4 +618,4 @@ docker-compose stop - [Docker Compose Documentation](https://docs.docker.com/compose/) - [PostgreSQL Documentation](https://www.postgresql.org/docs/) - [MinIO Documentation](https://min.io/docs/) -- [Redis Documentation](https://redis.io/documentation) +