Spaces:
Sleeping
Sleeping
add local test
Browse filesFiles changed (9)
- HF_SECRETS_μ€μ .mdDeleted-65
- README.md+9-91
- app.py+9-2
- env_example.txtDeleted-10
- requirements.txt+1
- start.py+47-1
- test_api.shAdded+76
- κ²μ_κ²°κ³Ό.mdDeleted-237
- λ°°ν¬_체ν¬λ¦¬μ€νΈ.mdDeleted-191
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465# π Hugging Face Secrets μ€μ κ°μ΄λ
## π μ€μ ν 5κ° Secrets
Hugging Face Space β Settings β Repository secrets β New secret
### 1οΈβ£ DB_USER```Value: ADMIN```
### 2οΈβ£ DB_PASSWORD```Value: Oracle_DB_λΉλ°λ²νΈ```(Oracle Cloud Consoleμμ νμΈ λλ μ¬μ€μ )
### 3οΈβ£ DB_TNS_ALIAS```Value: musclecare_high```(wallet/tnsnames.oraμμ νμΈν μ΄λ¦)
### 4οΈβ£ WALLET_ZIP_B64 β κ°μ₯ μ€μ!```Value: (wallet_base64.txt νμΌ μ 체 λ΄μ©)```
**μμ± λ°©λ²:**```bash# Wallet zip νμΌμ Base64λ‘ μΈμ½λ©base64 -i ~/Downloads/Wallet_musclecare.zip -o wallet_base64.txt
# wallet_base64.txt νμΌ μ΄μ΄μ μ 체 볡μ¬cat wallet_base64.txt | pbcopy # Mac```
### 5οΈβ£ WALLET_PASSWORD```Value: Wallet_λ€μ΄λ‘λμ_μ€μ ν_λΉλ°λ²νΈ```
---
## β
μ€μ μλ£ ν
```bashgit push```
μλμΌλ‘ λ°°ν¬λ©λλ€!
---
## π§ͺ λ°°ν¬ νμΈ
```bashcurl https://[username]-musclecare-api.hf.space/health```
**μ±κ³΅ μλ΅:**```json{"ok": true, "db": 1}```
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293# ποΈ MuscleCare FastAPIOracle Autonomous Database μ°λ FastAPI μλ² (Wallet κΈ°λ° mTLS)## π μ£Όμ κΈ°λ₯- π **Wallet κΈ°λ° mTLS μ°κ²°** - μ΅κ³ 보μ μμ€- π€ **μ¬μ©μ μν μ λ‘λ/λ€μ΄λ‘λ** - baseline + user_emb- π **νΌλ‘λ λ‘κ·Έ μ μ₯** - Oracle DBμ μμ νκ² μ μ₯---## π‘ API μλν¬μΈνΈ| μλν¬μΈνΈ | λ©μλ | μ€λͺ ||-----------|--------|------|| `/health` | GET | DB μ°κ²° μν νμΈ || `/upload_state` | POST | μ¬μ©μ μν μ λ‘λ || `/upload_logs` | POST | νΌλ‘λ λ‘κ·Έ μ λ‘λ |---## π Hugging Face Space λ°°ν¬### 1. Wallet Base64 μΈμ½λ©```bashbase64 -i ~/Downloads/Wallet_musclecare.zip -o wallet_base64.txt```### 2. Hugging Face Secrets μ€μ (5κ°)**Settings β Repository secrets**| Secret | Value ||--------|-------|| `DB_USER` | `ADMIN` || `DB_PASSWORD` | Oracle DB λΉλ°λ²νΈ || `DB_TNS_ALIAS` | `musclecare_high` || `WALLET_ZIP_B64` | wallet_base64.txt μ 체 λ΄μ© || `WALLET_PASSWORD` | Wallet λΉλ°λ²νΈ |### 3. Git Push```bashgit push```**μλ λ°°ν¬!** `start.py`κ° Walletμ μλμΌλ‘ λμ½λ©νκ³ μλ²λ₯Ό μμν©λλ€.---## π§ͺ ν μ€νΈ### λ°°ν¬ ν:```bash# ν¬μ€ 체ν¬curl https://[username]-musclecare-api.hf.space/health# API λ¬Έμhttps://[username]-musclecare-api.hf.space/docs```### λ‘컬 ν μ€νΈ:```bash# .env νμΌ μμ±cp env_example.txt .envnano .env # μ€μ κ° μ λ ₯# μλ² μ€νpython app.py```---## π μμΈ κ°μ΄λ- **HF_SECRETS_μ€μ .md** - Secrets μ€μ λ°©λ²- **DATA_ARCHITECTURE.md** - μ 체 μν€ν μ²---## π 보μ- β `.gitignore` - .env, wallet/ μ μΈ- β Wallet Base64λ‘ μμ νκ² λ°°ν¬- β Secretsλ‘ νκ²½ λ³μ κ΄λ¦¬---Made with β€οΈ for MuscleCare1234567891011---title: MuscleCare APIemoji: ποΈcolorFrom: bluecolorTo: purplesdk: dockersdk_version: "3.10"app_file: start.pypinned: falselicense: apache-2.0---
1 unmodified line2345678923 unmodified lines33343536373811 unmodified lines505152535455561 unmodified lineimport jsonfrom typing import List, Optionalfrom fastapi import FastAPI, HTTPExceptionfrom pydantic import BaseModel, Field, conlistimport oracledb# ----- νκ²½ λ³μ -----DB_USER = os.environ["DB_USER"]23 unmodified lines# ----- λͺ¨λΈ -----class StatePayload(BaseModel):user_id: strrms_base: Optional[float] = Nonefreq_base: Optional[float] = None11 unmodified lineswindow_count: Optional[int] = Noneclass LogsPayload(BaseModel):items: conlist(LogItem, min_items=1)# ----- μ νΈ -----def clob_json(obj) -> str:1 unmodified line23456789101112131423 unmodified lines383940414243444511 unmodified lines575859606162631 unmodified lineimport jsonfrom typing import List, Optionalfrom fastapi import FastAPI, HTTPExceptionfrom pydantic import BaseModel, Field, ConfigDictfrom typing import Listimport oracledbfrom dotenv import load_dotenv# λ‘컬 κ°λ°: .env νμΌ λ‘λ (μμΌλ©΄)load_dotenv()# ----- νκ²½ λ³μ -----DB_USER = os.environ["DB_USER"]23 unmodified lines# ----- λͺ¨λΈ -----class StatePayload(BaseModel):model_config = ConfigDict(protected_namespaces=())user_id: strrms_base: Optional[float] = Nonefreq_base: Optional[float] = None11 unmodified lineswindow_count: Optional[int] = Noneclass LogsPayload(BaseModel):items: List[LogItem] = Field(..., min_length=1)# ----- μ νΈ -----def clob_json(obj) -> str:
12345678910# λ‘컬 κ°λ°μ© νκ²½ λ³μ μμ# μ΄ νμΌμ .envλ‘ λ³΅μ¬νκ³ μ€μ κ°μΌλ‘ λ³κ²½νμΈμ# cp env_example.txt .env
DB_USER=ADMINDB_PASSWORD=your_db_password_hereDB_TNS_ALIAS=musclecare_highWALLET_DIR=/Users/gimhyeon-u/workspace/MuscleCare-FastAPI/walletWALLET_PASSWORD=your_wallet_password_here
2 unmodified lines3452 unmodified linespython-multipartoracledb>=2.3pydantic2 unmodified lines34562 unmodified linespython-multipartoracledb>=2.3pydanticpython-dotenv
1234567891011121314151617181920212223import os, base64, zipfile, io, sys, tempfile, subprocessdef prepare_wallet_dir():b64 = os.environ["WALLET_ZIP_B64"]wallet_password = os.environ["WALLET_PASSWORD"]# walletμ λ©λͺ¨λ¦¬->μμλλ ν λ¦¬λ‘ λ³΅μwallet_dir = tempfile.mkdtemp(prefix="wallet_")zip_bytes = base64.b64decode(b64)with zipfile.ZipFile(io.BytesIO(zip_bytes)) as z:z.extractall(wallet_dir)# μμ μ μν΄ κΆν μΆμfor root, _, files in os.walk(wallet_dir):for f in files:os.chmod(os.path.join(root, f), 0o600)# μ§κ° λΉλ°λ²νΈλ oracledbμμ μ¬μ©os.environ["WALLET_DIR"] = wallet_diros.environ["WALLET_PASSWORD"] = wallet_passwordreturn wallet_dirif __name__ == "__main__":prepare_wallet_dir()# Uvicorn κΈ°λsubprocess.run([sys.executable, "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"])123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869import os, base64, zipfile, io, sys, tempfile, subprocessfrom pathlib import Pathfrom dotenv import load_dotenv# .env νμΌ λ‘λ (λ‘컬 κ°λ°μ©)load_dotenv()def prepare_wallet_dir():"""Wallet μ€λΉ:- λ°°ν¬ νκ²½: WALLET_ZIP_B64μμ λμ½λ©- λ‘컬 νκ²½: WALLET_DIR κ²½λ‘ μ¬μ©"""# λ‘컬 κ°λ°: WALLET_DIRμ΄ μ΄λ―Έ μ€μ λμ΄ μλ κ²½μ°if "WALLET_DIR" in os.environ:wallet_dir = os.environ["WALLET_DIR"]if Path(wallet_dir).exists():print(f"π λ‘컬 Wallet μ¬μ©: {wallet_dir}")return wallet_dir# λ°°ν¬ νκ²½: WALLET_ZIP_B64μμ λμ½λ©if "WALLET_ZIP_B64" not in os.environ:raise RuntimeError("β WALLET_ZIP_B64 λλ WALLET_DIR νκ²½ λ³μκ° νμν©λλ€.\n"" λ‘컬: .env νμΌμ WALLET_DIR μ€μ \n"" λ°°ν¬: Hugging Face Secretsμ WALLET_ZIP_B64 μ€μ ")print("π Wallet Base64 λμ½λ© μμ...")b64 = os.environ["WALLET_ZIP_B64"]wallet_password = os.environ["WALLET_PASSWORD"]# walletμ λ©λͺ¨λ¦¬->μμλλ ν λ¦¬λ‘ λ³΅μwallet_dir = tempfile.mkdtemp(prefix="wallet_")print(f"π μμ λλ ν 리: {wallet_dir}")zip_bytes = base64.b64decode(b64)with zipfile.ZipFile(io.BytesIO(zip_bytes)) as z:z.extractall(wallet_dir)# μμ μ μν΄ κΆν μΆμfor root, _, files in os.walk(wallet_dir):for f in files:os.chmod(os.path.join(root, f), 0o600)print("β Wallet μμΆ ν΄μ μλ£")# μ§κ° λΉλ°λ²νΈλ oracledbμμ μ¬μ©os.environ["WALLET_DIR"] = wallet_diros.environ["WALLET_PASSWORD"] = wallet_passwordreturn wallet_dirif __name__ == "__main__":print("=" * 60)print("π MuscleCare FastAPI μλ² μμ")print("=" * 60)# Wallet μ€λΉtry:prepare_wallet_dir()except Exception as e:print(f"β Wallet μ€λΉ μ€ν¨: {e}")sys.exit(1)# Uvicorn κΈ°λprint("\nπ FastAPI μλ² μ€ν...")print("=" * 60)subprocess.run([sys.executable, "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"])
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576#!/bin/bash
# MuscleCare API ν
μ€νΈ μ€ν¬λ¦½νΈ
# μλ² URL μ€μ # λ‘컬: http://localhost:7860# λ°°ν¬: https://[username]-musclecare-api.hf.spaceBASE_URL="${1:-http://localhost:7860}"
echo "======================================"echo "π§ͺ MuscleCare API ν
μ€νΈ"echo "======================================"echo "μλ²: $BASE_URL"echo ""
# 1. Health 체ν¬echo "1οΈβ£ Health 체ν¬"echo "--------------------------------------"curl -X GET "$BASE_URL/health" \ -H "accept: application/json" | jq .echo ""echo ""
# 2. μ¬μ©μ μν μ
λ‘λecho "2οΈβ£ μ¬μ©μ μν μ
λ‘λ"echo "--------------------------------------"curl -X POST "$BASE_URL/upload_state" \ -H "Content-Type: application/json" \ -H "accept: application/json" \ -d '{ "user_id": "test_user_001", "rms_base": 0.11, "freq_base": 50.1, "user_emb": [0.135, 0.012, 49.3, 0.8, 0.84, 0.02, 0.11, 0.0021, 0.35, 0.71, 0.92, 0.88], "model_version": "v1.0.0" }' | jq .echo ""echo ""
# 3. νΌλ‘λ λ‘κ·Έ μ
λ‘λecho "3οΈβ£ νΌλ‘λ λ‘κ·Έ μ
λ‘λ"echo "--------------------------------------"curl -X POST "$BASE_URL/upload_logs" \ -H "Content-Type: application/json" \ -H "accept: application/json" \ -d '{ "items": [ { "user_id": "test_user_001", "session_id": "session_001", "measure_date": "2025-10-22", "rms": 0.12, "freq": 49.8, "fatigue": 0.83, "mode": "Hybrid", "window_count": 100 }, { "user_id": "test_user_001", "session_id": "session_002", "measure_date": "2025-10-22", "rms": 0.15, "freq": 48.5, "fatigue": 0.91, "mode": "E2E", "window_count": 120 } ] }' | jq .echo ""echo ""
echo "======================================"echo "β
ν
μ€νΈ μλ£"echo "======================================"
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237# β
μ 체 κ²μ κ²°κ³Ό
## π κ²μ μλ£ - λ°°ν¬ μ€λΉ μλ£!
---
## π― ν΅μ¬ νμΌ κ΅¬μ‘°
```MuscleCare-FastAPI/βββ start.py β
Wallet λμ½λ© + μλ² λΆν
βββ app.py β
FastAPI μ± (κ°μνλ¨)βββ Dockerfile β
start.py μ€νβββ requirements.txt β
μμ‘΄μ±βββ .gitignore β
보μ νμΌ μ μΈβββ README.md β
νλ‘μ νΈ μ€λͺ
βββ env_example.txt β
νκ²½ λ³μ μμ```
---
## β
μ½λ κ²μ κ²°κ³Ό
### 1. start.py β
```pythonβ
WALLET_ZIP_B64 νκ²½ λ³μ μ½κΈ°β
Base64 λμ½λ©β
zipfileλ‘ μμΆ ν΄μ β
μμ λλ ν 리 μμ± (/tmp/wallet_)β
νμΌ κΆν μ€μ (0o600)β
WALLET_DIR, WALLET_PASSWORD νκ²½ λ³μ μ€μ β
uvicorn subprocess μ€ν```
**μλ νλ¦:**```start.py μ€ν βprepare_wallet_dir() βνκ²½ λ³μ: WALLET_DIR, WALLET_PASSWORD μ€μ βuvicorn app:app μ€ν βapp.pyκ° WALLET_DIR μ¬μ©```
### 2. app.py β
```pythonβ
νκ²½ λ³μ μ½κΈ°: - DB_USER - DB_PASSWORD - WALLET_DIR (start.pyκ° μ€μ ) - WALLET_PASSWORD (start.pyκ° μ€μ ) - DB_TNS_ALIAS
β
oracledb.create_pool(): - user, password - dsn=TNS_ALIAS - config_dir=WALLET_DIR - wallet_location=WALLET_DIR - wallet_password=WALLET_PASSWORD β
μλν¬μΈνΈ: - GET /health β DB μ°κ²° ν
μ€νΈ - POST /upload_state β user_state ν
μ΄λΈ UPSERT - POST /upload_logs β fatigue_logs ν
μ΄λΈ INSERT```
### 3. Dockerfile β
```dockerfileβ
Python 3.10-slimβ
requirements.txt μ€μΉβ
μ½λ 볡μ¬β
CMD ["python", "start.py"] β μ€μ!```
### 4. requirements.txt β
```β
fastapiβ
uvicornβ
python-multipartβ
oracledb>=2.3β
pydantic```
### 5. .gitignore β
```β
.envβ
wallet/β
*.zipβ
wallet_base64.txtβ
__pycache__/```
---
## π 보μ κ²μ
### β
Git μ μΈ νμΌ```bashgit status | grep -E "(\.env|wallet/)"```**κ²°κ³Ό:** `.gitignore` νμΈ β μ μΈλ¨ β
### β
νκ²½ λ³μ μ¬μ©- λͺ¨λ λ―Όκ° μ 보λ νκ²½ λ³μλ‘ κ΄λ¦¬- μ½λμ νλμ½λ© μμ
### β
Wallet 보νΈ- Gitμ ν¬ν¨ μ λ¨- Base64λ‘ Secretsμ μμ νκ² μ μ₯
---
## π‘ API κ²μ
### μλν¬μΈνΈ ꡬ쑰
#### GET /health```pythonβ
pool.acquire() μ¬μ©β
SELECT 1 FROM DUALβ
μ°κ²° μν λ°ν```
#### POST /upload_state```pythonβ
StatePayload κ²μ¦β
user_emb κΈΈμ΄ μ²΄ν¬ (12)β
MERGE INTO MuscleCare.user_stateβ
CLOB JSON μ μ₯β
νΈλμμ
commit```
#### POST /upload_logs```pythonβ
LogsPayload κ²μ¦β
executemanyλ‘ λ°°μΉ INSERTβ
MuscleCare.fatigue_logs ν
μ΄λΈβ
νΈλμμ
commit```
---
## π λ°°ν¬ νλ‘μ° κ²μ
### Hugging Face Space μ€ν μμ:
```1. Docker λΉλ β2. start.py μ€ν β3. prepare_wallet_dir() - WALLET_ZIP_B64 νκ²½ λ³μ μ½κΈ° (Secrets) - Base64 λμ½λ© - /tmp/wallet_xxxxxμ μμΆ ν΄μ - WALLET_DIR νκ²½ λ³μ μ€μ β4. uvicorn μ€ν - app:app λ‘λ β5. app.py μ΄κΈ°ν - νκ²½ λ³μ μ½κΈ° - oracledb.create_pool() (WALLET_DIR μ¬μ©) β6. β
μλ² μ€ν μλ£```
---
## π§ͺ ν
μ€νΈ 체ν¬λ¦¬μ€νΈ
### λ‘컬 ν
μ€νΈ (μ ν):- [ ] wallet/ λλ ν 리 μ€λΉ- [ ] νκ²½ λ³μ export- [ ] `python app.py` μ€ν- [ ] `curl http://localhost:7860/health` μ±κ³΅
### λ°°ν¬ ν ν
μ€νΈ (νμ):- [ ] Logsμ "β
Wallet μμΆ ν΄μ μλ£"- [ ] Logsμ "Uvicorn running"- [ ] `curl https://[username]-xxx.hf.space/health`- [ ] μλ΅: `{"ok": true, "db": 1}`- [ ] `/docs` νμ΄μ§ μ κ·Ό κ°λ₯
---
## β λ°κ²¬λ λ¬Έμ μ
### μμ! β
λͺ¨λ νμΌμ΄ μ¬λ°λ₯΄κ² ꡬμ±λμμ΅λλ€.
---
## π― λ€μ λ¨κ³
### 1. Hugging Face Secrets μ€μ (5κ°)
`HF_SECRETS_μ€μ .md` μ°Έμ‘°
### 2. Git Push
```bashgit add .git commit -m "Ready for deployment"git push```
### 3. λ°°ν¬ νμΈ
- Logs νμΈ- API ν
μ€νΈ- λ¬Έμ νμΈ
---
## π μ΅μ’
μμ½
| νλͺ© | μν ||------|------|| **μ½λ ꡬ쑰** | β
μλ²½ || **보μ** | β
.gitignore μ€μ λ¨ || **Wallet μ²λ¦¬** | β
start.pyλ‘ μλν || **Docker μ€μ ** | β
start.py μ€ν || **νκ²½ λ³μ** | β
Secretsλ‘ κ΄λ¦¬ || **API ꡬ쑰** | β
κ°κ²°νκ³ ν¨μ¨μ || **λ°°ν¬ μ€λΉ** | β
μλ£ |
---
**κ²μ κ²°κ³Ό: λ°°ν¬ κ°λ₯! π**
Git pushλ§ νλ©΄ λ©λλ€!
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191# β
λ°°ν¬ μ΅μ’
체ν¬λ¦¬μ€νΈ
## π νμΌ κ΅¬μ‘° κ²μ
### β
νμ νμΌ (Gitμ ν¬ν¨)- [x] `start.py` - Wallet λμ½λ© λ° μλ² λΆν
- [x] `app.py` - FastAPI μ ν리μΌμ΄μ
- [x] `Dockerfile` - start.py μ€ν- [x] `requirements.txt` - μμ‘΄μ±- [x] `.gitignore` - 보μ νμΌ μ μΈ- [x] `README.md` - νλ‘μ νΈ μ€λͺ
- [x] `env_example.txt` - νκ²½ λ³μ μμ
### β μ μΈ νμΌ (Gitμ ν¬ν¨ μ λ¨)- [ ] `.env` - λ‘컬 νκ²½ λ³μ- [ ] `wallet/` - Wallet νμΌλ€- [ ] `wallet_base64.txt` - Base64 μΈμ½λ© νμΌ- [ ] `*.zip` - Wallet μμΆ νμΌ
---
## π Hugging Face Secrets (5κ°)
### νμ Secrets:
| Secret Name | μ€μ λ¨? | Value μμ ||-------------|---------|-----------|| `DB_USER` | [ ] | `ADMIN` || `DB_PASSWORD` | [ ] | Oracle DB λΉλ°λ²νΈ || `DB_TNS_ALIAS` | [ ] | `musclecare_high` || `WALLET_ZIP_B64` | [ ] | Base64 μΈμ½λ©λ Wallet || `WALLET_PASSWORD` | [ ] | Wallet λΉλ°λ²νΈ |
---
## π μ½λ κ²μ
### start.py```pythonβ
WALLET_ZIP_B64 νκ²½ λ³μ μ½κΈ°β
Base64 λμ½λ©β
μμ λλ ν 리μ μμΆ ν΄μ β
WALLET_DIR, WALLET_PASSWORD νκ²½ λ³μ μ€μ β
uvicornμΌλ‘ FastAPI μ€ν```
### app.py```pythonβ
νκ²½ λ³μλ‘ DB μ€μ μ½κΈ°β
Wallet κ²½λ‘ μ¬μ©β
μ°κ²° ν μμ± (Thin mode + mTLS)β
/health μλν¬μΈνΈβ
/upload_state μλν¬μΈνΈ (MERGE INTO)β
/upload_logs μλν¬μΈνΈ (executemany)```
### Dockerfile```dockerfileβ
Python 3.10-slimβ
requirements.txt μ€μΉβ
start.pyλ‘ μ€νβ
ν¬νΈ 7860 λ
ΈμΆ```
### requirements.txt```β
fastapiβ
uvicornβ
python-multipartβ
oracledb>=2.3β
pydantic```
---
## π§ͺ λ°°ν¬ μ λ‘컬 ν
μ€νΈ
### νκ²½ λ³μ μ€μ (λ‘컬)
```bashexport DB_USER="ADMIN"export DB_PASSWORD="your_db_password"export DB_TNS_ALIAS="musclecare_high"export WALLET_DIR="/Users/gimhyeon-u/workspace/MuscleCare-FastAPI/wallet"export WALLET_PASSWORD="your_wallet_password"```
### μλ² μ€ν
```bashpython app.py```
λλ start.pyλ‘:
```bash# Wallet zip νμΌ μ€λΉ νμpython start.py```
---
## π λ°°ν¬ λͺ
λ Ήμ΄
### 1. Git μν νμΈ
```bashgit status```
**νμΈ:**- β `.env` μμ΄μΌ ν¨- β `wallet/` μμ΄μΌ ν¨- β `wallet_base64.txt` μμ΄μΌ ν¨
### 2. Git μ»€λ° λ° νΈμ
```bashgit add .git commit -m "Deploy to HF with Wallet mTLS"git push```
---
## π λ°°ν¬ ν νμΈ
### 1. Logs νμΈ
Hugging Face Space β **Logs** ν
**μ±κ³΅ λ©μμ§:**```π Wallet λμ½λ© μμ...π μμ λλ ν 리 μμ±: /tmp/wallet_xxxxxβ
Wallet μμΆ ν΄μ μλ£β
tnsnames.ora νμΈINFO: Uvicorn running on http://0.0.0.0:7860```
### 2. API ν
μ€νΈ
```bashcurl https://[username]-musclecare-api.hf.space/health```
**κΈ°λ μλ΅:**```json{"ok": true, "db": 1}```
### 3. API λ¬Έμ
```https://[username]-musclecare-api.hf.space/docs```
---
## π§ λ¬Έμ ν΄κ²°
### "WALLET_ZIP_B64 νκ²½ λ³μκ° μμ΅λλ€"
- [ ] Secrets μ΄λ¦ νμΈ: `WALLET_ZIP_B64` (μ νν)- [ ] Secret κ° νμΈ: wallet_base64.txt μ 체 λ΄μ©- [ ] Space μ¬μμ
### "Wallet μμΆ ν΄μ μ€ν¨"
- [ ] Base64 μΈμ½λ© μ¬μλ- [ ] Wallet zip νμΌμ΄ μμλμ§ μμλμ§ νμΈ
### "DB μ°κ²° μ€ν¨"
- [ ] Oracle DB μν AVAILABLE νμΈ- [ ] `DB_PASSWORD` νμΈ- [ ] `DB_TNS_ALIAS` νμΈ
---
## β
μ΅μ’
체ν¬
- [ ] Dockerfileμ΄ start.py μ€ννλλ‘ μμ λ¨- [ ] .gitignore μμ±λ¨- [ ] README.md μ
λ°μ΄νΈλ¨- [ ] env_example.txt μμ±λ¨- [ ] Gitμ λ―Όκ° νμΌ μ μΈ νμΈ- [ ] 5κ° Secrets μ€μ μ€λΉλ¨
**λͺ¨λ μ€λΉ μλ£!** π
HF_SECRETS_μ€μ .mdDeleted-65
README.md+9-91
app.py+9-2
env_example.txtDeleted-10
requirements.txt+1
start.py+47-1
test_api.shAdded+76
κ²μ_κ²°κ³Ό.mdDeleted-237
λ°°ν¬_체ν¬λ¦¬μ€νΈ.mdDeleted-191