Step 1: Minimal Foundation - Console service with Docker
- Created docker-compose.yml with Console backend service - Implemented Console backend with FastAPI (port 8011) - Added health check and status endpoints - Set up Docker-only development principle - Console service successfully running as API Gateway foundation Test with: - curl http://localhost:8011/health - curl http://localhost:8011/api/status 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -2,6 +2,12 @@
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Development Principles
|
||||
**IMPORTANT**:
|
||||
1. 모든 개발은 Docker 환경에서만 진행
|
||||
2. Docker 빌드는 백그라운드로 실행하고 완료까지 대기
|
||||
3. 로컬 환경 설정 금지 (venv, npm install 등)
|
||||
|
||||
## File Naming Convention
|
||||
**IMPORTANT**: 모든 문서 파일은 대문자.md 형식으로 생성
|
||||
- 예: README.md, CHANGELOG.md, TODO.md, ARCHITECTURE.md
|
||||
|
||||
29
README.md
Normal file
29
README.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Site11 - Microservices Architecture
|
||||
|
||||
## Overview
|
||||
Microservices platform with Console as API Gateway orchestrating multiple domain services.
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Start Services
|
||||
```bash
|
||||
# Start console service
|
||||
docker-compose up -d console-backend
|
||||
|
||||
# Check status
|
||||
curl http://localhost:8011/health
|
||||
```
|
||||
|
||||
### Available Endpoints
|
||||
- `http://localhost:8011/` - Root endpoint
|
||||
- `http://localhost:8011/health` - Health check
|
||||
- `http://localhost:8011/api/status` - System status
|
||||
|
||||
## Architecture
|
||||
- **Console**: API Gateway and orchestrator
|
||||
- **Services**: Domain-specific microservices (users, oauth, images, etc.)
|
||||
- **Database**: MongoDB for persistence
|
||||
- **Cache**: Redis for caching and pub/sub
|
||||
|
||||
## Development
|
||||
See `docs/PLAN.md` for implementation roadmap and `docs/PROGRESS.md` for current status.
|
||||
21
console/backend/Dockerfile
Normal file
21
console/backend/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy requirements first for better caching
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
# Run the application
|
||||
CMD ["python", "main.py"]
|
||||
58
console/backend/main.py
Normal file
58
console/backend/main.py
Normal file
@ -0,0 +1,58 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
import uvicorn
|
||||
from datetime import datetime
|
||||
|
||||
app = FastAPI(
|
||||
title="Console API Gateway",
|
||||
description="Central orchestrator for microservices",
|
||||
version="0.1.0"
|
||||
)
|
||||
|
||||
# CORS middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {
|
||||
"message": "Console API Gateway",
|
||||
"status": "running",
|
||||
"timestamp": datetime.now().isoformat()
|
||||
}
|
||||
|
||||
@app.get("/health")
|
||||
async def health_check():
|
||||
return {
|
||||
"status": "healthy",
|
||||
"service": "console",
|
||||
"timestamp": datetime.now().isoformat()
|
||||
}
|
||||
|
||||
@app.get("/api/status")
|
||||
async def system_status():
|
||||
return {
|
||||
"console": "online",
|
||||
"services": {
|
||||
"users": "pending",
|
||||
"oauth": "pending",
|
||||
"images": "pending",
|
||||
"applications": "pending",
|
||||
"data": "pending",
|
||||
"statistics": "pending"
|
||||
},
|
||||
"timestamp": datetime.now().isoformat()
|
||||
}
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(
|
||||
"main:app",
|
||||
host="0.0.0.0",
|
||||
port=8000,
|
||||
reload=True
|
||||
)
|
||||
5
console/backend/requirements.txt
Normal file
5
console/backend/requirements.txt
Normal file
@ -0,0 +1,5 @@
|
||||
fastapi==0.109.0
|
||||
uvicorn[standard]==0.27.0
|
||||
python-dotenv==1.0.0
|
||||
pydantic==2.5.3
|
||||
httpx==0.26.0
|
||||
23
docker-compose.yml
Normal file
23
docker-compose.yml
Normal file
@ -0,0 +1,23 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
console-backend:
|
||||
build:
|
||||
context: ./console/backend
|
||||
dockerfile: Dockerfile
|
||||
container_name: site11_console_backend
|
||||
ports:
|
||||
- "8011:8000"
|
||||
environment:
|
||||
- ENV=development
|
||||
- PORT=8000
|
||||
volumes:
|
||||
- ./console/backend:/app
|
||||
networks:
|
||||
- site11_network
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
site11_network:
|
||||
driver: bridge
|
||||
name: site11_network
|
||||
@ -5,13 +5,17 @@
|
||||
|
||||
## Current Status
|
||||
- **Date Started**: 2025-09-09
|
||||
- **Current Phase**: Planning Complete
|
||||
- **Next Action**: Step 1 - Minimal Foundation 구현
|
||||
- **Current Phase**: Step 1 Complete ✅
|
||||
- **Next Action**: Step 2 - Add First Service (Users)
|
||||
|
||||
## Completed Checkpoints
|
||||
✅ Project structure planning (CLAUDE.md)
|
||||
✅ Implementation plan created (docs/PLAN.md)
|
||||
✅ Progressive approach defined
|
||||
✅ Step 1: Minimal Foundation - Docker + Console Hello World
|
||||
- docker-compose.yml created
|
||||
- console/backend with FastAPI
|
||||
- Running on port 8011
|
||||
|
||||
## Active Working Files
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user