AI ๊ธฐ๋ฐ ๋ฌ๋ ์์ธ ํผ๋๋ฐฑ ์์คํ
์ฌ์ฉ์์ ๋ฌ๋ ์์์ ๋ถ์ํ์ฌ MediaPipe๋ฅผ ํตํด ์์ธ๋ฅผ ์ถ์ถํ๊ณ , AI ๊ธฐ๋ฐ ํผ๋๋ฐฑ์ ์ ๊ณตํ๋ ์์คํ ์ ๋๋ค.
- ํ๋ก ํธ์๋: Flutter (iOS - iPhone 15 Pro)
- ๋ฐฑ์๋: FastAPI + PostgreSQL + Celery
- CV ์์ง: Google MediaPipe Pose
- ํจํด: klid-aicb (๊ธฐ๋ฅ๋ณ ๋ชจ๋ํ)
NikePoint/
โโโ backend/ # FastAPI ๋ฐฑ์๋
โ โโโ src/
โ โ โโโ core/ # ๊ณตํต ์ค์
โ โ โโโ user/ # ์ฌ์ฉ์ ์ธ์ฆ
โ โ โโโ video/ # ์์ ์
๋ก๋/๊ด๋ฆฌ
โ โ โโโ pose_detection/ # MediaPipe ํคํฌ์ธํธ ์ถ์ถ
โ โ โโโ workers/ # Celery ๋ฐฑ๊ทธ๋ผ์ด๋ ์์
โ โ โโโ main.py # FastAPI ์ฑ
โ โโโ tests/ # ํ
์คํธ
โ โโโ alembic/ # ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ง์ด๊ทธ๋ ์ด์
โ โโโ storage/ # ๋ก์ปฌ ํ์ผ ์ ์ฅ์
โ
โโโ frontend/ # Flutter ์ฑ โ
์์ฑ!
โ โโโ lib/
โ โ โโโ config/ # API & ํ
๋ง ์ค์
โ โ โโโ models/ # ๋ฐ์ดํฐ ๋ชจ๋ธ
โ โ โโโ services/ # API ์๋น์ค
โ โ โโโ providers/ # ์ํ ๊ด๋ฆฌ
โ โ โโโ screens/ # ํ๋ฉด UI
โ โ โโโ widgets/ # ์ฌ์ฌ์ฉ ์์ ฏ
โ โโโ ios/ # iOS ์ค์
โโโ README.md
- Docker & Docker Compose ์ค์น
- Git
git clone <repository-url>
cd NikePointcd backend
docker-compose up -d์ด ๋ช ๋ น์ผ๋ก ๋ค์ ์๋น์ค๊ฐ ์์๋ฉ๋๋ค:
- PostgreSQL (ํฌํธ 5432)
- Redis (ํฌํธ 6379)
- FastAPI ์๋ฒ (ํฌํธ 8000)
- Celery ์์ปค
- API ๋ฌธ์ (Swagger): http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Health Check: http://localhost:8000/api/health
# uv ์ค์น
curl -LsSf https://astral.sh/uv/install.sh | sh
# PostgreSQL & Redis ์ค์น (๋๋ Docker๋ก ์คํ)
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=dev_password postgres:15
docker run -d -p 6379:6379 redis:7cd backend
uv venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
uv sync# ๋ง์ด๊ทธ๋ ์ด์
์ ์ฉ
alembic upgrade head# FastAPI ์๋ฒ
uvicorn src.main:app --reload --port 8000
# Celery ์์ปค (๋ณ๋ ํฐ๋ฏธ๋)
celery -A src.workers.tasks worker --loglevel=infoUser (์ฌ์ฉ์)
- id, email, password_hash
- height (ํค), weight, age
Video (์์)
- id, user_id
- file_path, status
- uploaded_at, processed_at
Keypoint (ํคํฌ์ธํธ)
- id, video_id
- frame_number, timestamp
- landmarks (JSONB - 33๊ฐ ํฌ์ธํธ)
# ํ์๊ฐ์
POST /api/auth/register
{
"email": "user@example.com",
"password": "password123",
"height": 175.5
}
# ๋ก๊ทธ์ธ
POST /api/auth/login
{
"email": "user@example.com",
"password": "password123"
}# ์์ ์
๋ก๋
POST /api/video/upload
Content-Type: multipart/form-data
- user_id: <user_id>
- file: <video_file>
# ์ฒ๋ฆฌ ์ํ ํ์ธ
GET /api/video/{video_id}/status
# ํคํฌ์ธํธ ์กฐํ
GET /api/pose/video/{video_id}/keypoints# ๋ชจ๋ ํ
์คํธ ์คํ
pytest
# ํน์ ํ
์คํธ๋ง ์คํ
pytest tests/test_user/
# ์ปค๋ฒ๋ฆฌ์ง ํฌํจ
pytest --cov=src tests/- FastAPI: ๊ณ ์ฑ๋ฅ ์น ํ๋ ์์ํฌ
- SQLAlchemy: ORM
- Alembic: ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ง์ด๊ทธ๋ ์ด์
- Celery: ๋น๋๊ธฐ ์์ ํ
- Redis: ๋ฉ์์ง ๋ธ๋ก์ปค
- PostgreSQL: ๋ฐ์ดํฐ๋ฒ ์ด์ค
- MediaPipe: ์์ธ ์ถ์ถ
- OpenCV: ์์ ์ฒ๋ฆฌ
- uv: ๋น ๋ฅธ Python ํจํค์ง ๊ด๋ฆฌ์
- Docker: ์ปจํ ์ด๋ํ
- pytest: ํ ์คํธ ํ๋ ์์ํฌ
- โ ์ฌ์ฉ์ ์ธ์ฆ (ํ์๊ฐ์ /๋ก๊ทธ์ธ)
- โ ์์ ์ ๋ก๋ ๋ฐ ์ ์ฅ
- โ MediaPipe๋ฅผ ์ด์ฉํ ํคํฌ์ธํธ ์ถ์ถ
- โ Celery ๋น๋๊ธฐ ์ฒ๋ฆฌ
- โ RESTful API
- โ Docker ๋ฐฐํฌ ํ๊ฒฝ
- โ ํ ์คํธ ์ฝ๋
- โ ๊ฐค๋ฌ๋ฆฌ์์ ์์ ์ ํ
- โ ํค(์ ์ฅ) ์ ๋ ฅ UI
- โ ๋ฐฑ์๋ API ์ฐ๋
- โ ์ค์๊ฐ ์ฒ๋ฆฌ ์ํ ํ์
- โ 33๊ฐ ํคํฌ์ธํธ ์๊ฐํ
- โ ํ๋ ์๋ณ ์ ๋๋ฉ์ด์
- โ Provider ์ํ ๊ด๋ฆฌ
cd frontend
open -a Simulator
flutter runcd frontend
flutter devices
flutter run -d <device-id>์ฃผ์: ์ค์ ๊ธฐ๊ธฐ์์๋ lib/config/api_config.dart์์ ๋งฅ๋ถ IP๋ก ๋ณ๊ฒฝ ํ์
-
์นด๋ฉ๋ผ ์ดฌ์ ๊ธฐ๋ฅ (camera ํจํค์ง)
- ์ค์๊ฐ ์ดฌ์
- ํ๋ฆฌ๋ทฐ ํ๋ฉด
-
์์ธ ๋ถ์ ์๊ณ ๋ฆฌ์ฆ
- ๋ณดํญ, ์ฐฉ์ง๊ฐ๋, ์ผ์ด๋์ค ๊ณ์ฐ
- ์์ง ์ง๋, ์ ์ง ์๊ฐ ์ธก์
-
LLM ํผ๋๋ฐฑ ์์ฑ
- OpenAI GPT-4 ๋๋ Claude ํตํฉ
- ์์ฐ์ด ํผ๋๋ฐฑ ์์ฑ
- ๊ฐ์ ์ ์ ์ ๊ณต
-
ํ์คํ ๋ฆฌ & ํต๊ณ
- ๊ณผ๊ฑฐ ๋ถ์ ๊ฒฐ๊ณผ ์กฐํ
- ์ง์ฒ๋ ๊ทธ๋ํ
- ๊ฐ์ ์ถ์ด ํ์
-
์ธ์ฆ ๊ฐํ
- JWT ํ ํฐ ์ธ์ฆ
- Apple Login ์ฐ๋
-
์ธํ๋ผ ๊ฐ์
- AWS S3 ์คํ ๋ฆฌ์ง
- CI/CD ํ์ดํ๋ผ์ธ
- ํ๋ก๋์ ๋ฐฐํฌ
.env ํ์ผ ์์ฑ (.env.example ์ฐธ๊ณ ):
DATABASE_URL=postgresql://nikepoint:dev_password@localhost:5432/nikepoint
REDIS_URL=redis://localhost:6379/0
STORAGE_PATH=./storage/videos
MEDIAPIPE_MODEL_COMPLEXITY=2-
๊ธฐ๋ฅ ๊ฐ๋ฐ
git checkout -b feature/new-feature # ์ฝ๋ ์์ฑ pytest # ํ ์คํธ ์คํ git commit -m "feat: add new feature"
-
๋ก์ปฌ ํ ์คํธ
docker-compose up -d # API ํ ์คํธ curl http://localhost:8000/api/health -
๋ฐฐํฌ
docker-compose build docker-compose up -d
MIT License
์ด์์ PR์ ํ์ํฉ๋๋ค!
NikePoint - AI ๊ธฐ๋ฐ ๋ฌ๋ ์์ธ ๋ถ์ ์์คํ