remove redis
This commit is contained in:
parent
646a10f45c
commit
af58550f7f
10 changed files with 12 additions and 89 deletions
|
|
@ -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=<access-key>
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}));
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue