Step 5: Authentication System & Environment Variables

- Implemented JWT authentication in Console backend
- Added .env file for environment variable management
- Updated docker-compose to use .env variables
- Created authentication endpoints (login/logout/me)
- Added protected route middleware
- Created ARCHITECTURE.md with Kafka as main messaging platform
- Defined Kafka for both events and task queues
- Redis dedicated for caching and session management

Test credentials:
- admin/admin123
- user/user123

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
jungwoo choi
2025-09-10 16:36:47 +09:00
parent 4b2be7ccaf
commit 315eeea2ae
6 changed files with 378 additions and 20 deletions

View File

@ -5,9 +5,9 @@ services:
build:
context: ./console/frontend
dockerfile: Dockerfile
container_name: site11_console_frontend
container_name: ${COMPOSE_PROJECT_NAME}_console_frontend
ports:
- "3000:80"
- "${CONSOLE_FRONTEND_PORT}:80"
networks:
- site11_network
restart: unless-stopped
@ -18,13 +18,16 @@ services:
build:
context: ./console/backend
dockerfile: Dockerfile
container_name: site11_console_backend
container_name: ${COMPOSE_PROJECT_NAME}_console_backend
ports:
- "8011:8000"
- "${CONSOLE_BACKEND_PORT}:8000"
environment:
- ENV=development
- ENV=${ENV}
- PORT=8000
- USERS_SERVICE_URL=http://users-backend:8000
- USERS_SERVICE_URL=${USERS_SERVICE_URL}
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- JWT_ALGORITHM=${JWT_ALGORITHM}
- ACCESS_TOKEN_EXPIRE_MINUTES=${ACCESS_TOKEN_EXPIRE_MINUTES}
volumes:
- ./console/backend:/app
networks:
@ -37,12 +40,12 @@ services:
build:
context: ./services/users/backend
dockerfile: Dockerfile
container_name: site11_users_backend
container_name: ${COMPOSE_PROJECT_NAME}_users_backend
environment:
- ENV=development
- ENV=${ENV}
- PORT=8000
- MONGODB_URL=mongodb://mongodb:27017
- DB_NAME=users_db
- MONGODB_URL=${MONGODB_URL}
- DB_NAME=${USERS_DB_NAME}
volumes:
- ./services/users/backend:/app
networks:
@ -53,11 +56,11 @@ services:
mongodb:
image: mongo:7.0
container_name: site11_mongodb
container_name: ${COMPOSE_PROJECT_NAME}_mongodb
environment:
- MONGO_INITDB_DATABASE=site11_db
- MONGO_INITDB_DATABASE=${MONGODB_DATABASE}
ports:
- "27017:27017"
- "${MONGODB_PORT}:27017"
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
@ -72,9 +75,9 @@ services:
redis:
image: redis:7-alpine
container_name: site11_redis
container_name: ${COMPOSE_PROJECT_NAME}_redis
ports:
- "6379:6379"
- "${REDIS_PORT}:6379"
volumes:
- redis_data:/data
networks: