diff --git a/.github/workflows/check-main-pr.yml b/.github/workflows/check-main-pr.yml new file mode 100644 index 0000000..dd8128f --- /dev/null +++ b/.github/workflows/check-main-pr.yml @@ -0,0 +1,17 @@ +name: Block PRs to Main except from Develop + +on: + pull_request: + branches: + - main # main 브랜치로 향하는 PR에 대해서만 실행 + +jobs: + check-source-branch: + runs-on: ubuntu-latest + steps: + - name: Check source branch + if: github.head_ref != 'develop' # 들어오는 브랜치(source)가 develop이 아니면 + run: | + echo "Error: You can only merge to 'main' from 'develop'." + echo "Please change the base branch to 'develop' or merge your changes to 'develop' first." + exit 1 # 강제로 에러(Fail)를 발생시켜 머지를 막음 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa29a65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +__pycache__/ +*.py[cod] + +.venv/ + +.env +.env.* + +.pytest_cache/ +.mypy_cache/ +.cache/ + +.vscode/ +.idea/ + +.DS_Store +Thumbs.db diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f4cb6e --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +# PrimerFlow + + +## 프로젝트 구조 + +```text +PrimerFlow-BE/ +├─ api/ +│ ├─ deps.py +│ └─ v1/ +│ └─ endpoints/ # 엔드포인트 모음 +├─ schemas/ # Pydantic 모델 모음 +│ └─ schemas.py +├─ algorithms/ # 알고리즘 모음 +├─ docs/ # 협업 가이드 문서 모음 +│ └─ prompts/ +│ └─ strategy/ +├─ main.py # FastAPI 앱 엔트리포인트 +├─ requirements.txt # Python 패키지 목록 +├─ README.md +└─ .gitignore +``` + + +## 개발 환경 설정 + +### 1. 가상환경 생성 및 활성화 + +- Windows + ```powershell + python -m venv .venv + .\.venv\Scripts\Activate.ps1 # PowerShell + # 또는 + .\.venv\Scripts\activate.bat # cmd + ``` +- macOS / Linux + ```bash + python3 -m venv .venv + source .venv/bin/activate + ``` + +### 2. 의존성 설치 + +```powershell +pip install -r requirements.txt +``` + +### 3. 개발 서버 실행 + +```powershell +uvicorn main:app --reload +``` + +- 기본 엔드포인트: http://localhost:8000/ +- OpenAPI 문서: http://localhost:8000/docs +- ReDoc 문서: http://localhost:8000/redoc + + + diff --git a/algorithms/example.py b/algorithms/example.py new file mode 100644 index 0000000..26830c5 --- /dev/null +++ b/algorithms/example.py @@ -0,0 +1 @@ +# 이 파일 지우시고 코드 짜시면 됩니다 \ No newline at end of file diff --git a/api/deps.py b/api/deps.py new file mode 100644 index 0000000..0b06487 --- /dev/null +++ b/api/deps.py @@ -0,0 +1 @@ +# 의존성 주입 \ No newline at end of file diff --git a/api/v1/endpoints/health.py b/api/v1/endpoints/health.py new file mode 100644 index 0000000..877e4ab --- /dev/null +++ b/api/v1/endpoints/health.py @@ -0,0 +1,8 @@ +from fastapi import APIRouter + +router = APIRouter() + +@router.get("/health", summary="Health check") +async def health_check(): + """Simple health check endpoint.""" + return {"status": "ok"} diff --git a/main.py b/main.py new file mode 100644 index 0000000..daf30f2 --- /dev/null +++ b/main.py @@ -0,0 +1,2 @@ +from fastapi import FastAPI + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..be08dc6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +fastapi[standard] \ No newline at end of file diff --git a/schemas/schemas.py b/schemas/schemas.py new file mode 100644 index 0000000..385412e --- /dev/null +++ b/schemas/schemas.py @@ -0,0 +1 @@ +# Pydantic 데이터 스키마 \ No newline at end of file