Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/check-main-pr.yml
Original file line number Diff line number Diff line change
@@ -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)를 발생시켜 머지를 막음
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
__pycache__/
*.py[cod]

.venv/

.env
.env.*

.pytest_cache/
.mypy_cache/
.cache/

.vscode/
.idea/

.DS_Store
Thumbs.db
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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



1 change: 1 addition & 0 deletions algorithms/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 이 파일 지우시고 코드 짜시면 됩니다
1 change: 1 addition & 0 deletions api/deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 의존성 주입
8 changes: 8 additions & 0 deletions api/v1/endpoints/health.py
Original file line number Diff line number Diff line change
@@ -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"}
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from fastapi import FastAPI

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fastapi[standard]
1 change: 1 addition & 0 deletions schemas/schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Pydantic 데이터 스키마