Files
hackerthon-vote/README.md
th-kim0823 02e186a860 fix: UX — start.sh 자동 LAN IP 감지 + topics/vote 레이아웃 조정
- start.sh: 호스트 LAN IP 자동 감지 후 PUBLIC_BASE_URL 세팅, 이제 QR이 172.x 컨테이너 IP 대신 실제 LAN IP를 가리킴
- docker-compose.yml: PUBLIC_BASE_URL 환경변수 pass-through 추가
- app.py: topics min-height 480→360, font-size/line-height 상향, vote counter를 QR 위로 이동, pct 계산 단순화
- README: 실행 섹션 교체 (start.sh 권장, raw/최소 방식 병기)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 21:07:11 +09:00

112 lines
3.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 해커톤 투표
35명 (34명 참가 + 1명 진행요원) / 7팀 / 3분야 (재미·완성도·실용성) 투표 앱.
**DB 없이 단일 JSON 파일** (`hackathon.json`)에 모든 데이터.
## 흐름 (행사 진행)
1. **Stage 1 — 팀 편성 + 안내** (큰 화면 `/`)
2. **Stage 2 — 예시 주제** (큰 화면 `/`, 어드민이 "다음 stage →")
3. **해킹** (앱 외부, 2시간)
4. **발표**
5. **Stage 3 — 투표** (큰 화면에 QR, 모바일 → `/?mode=vote`)
6. **시상** (`/?mode=ceremony&token=mlops2026`)
## 실행 — Docker
```bash
./start.sh # LAN IP 자동 감지 + PUBLIC_BASE_URL 세팅 + 컨테이너 기동
```
또는 raw 방식 (LAN IP 수동):
```bash
PUBLIC_BASE_URL="http://192.168.0.47:8501" docker compose up -d --build
```
또는 최소 (LAN IP 없이, 어드민에서 나중에 override):
```bash
docker compose up -d --build
```
첫 부팅 시 `entrypoint.sh``assign_teams.py`를 자동 실행해서 `./data/hackathon.json` 시드 생성. 이후 부팅은 기존 데이터 보존.
```bash
docker compose down # 종료 (데이터 보존)
```
**ADMIN_TOKEN**: `mlops2026` (외우기 쉬운 고정값). 변경하려면 `docker-compose.yml``ADMIN_TOKEN:` 값 직접 수정 후 재기동.
## URL
```bash
./show-urls.sh # localhost + LAN IP 포함 모든 URL 출력
```
- 큰 화면: `http://<서버>:8501/`
- 모바일 투표 (QR target): `http://<서버>:8501/?mode=vote`
- 어드민: `http://<서버>:8501/?mode=admin&token=mlops2026`
- 시상식: `http://<서버>:8501/?mode=ceremony&token=mlops2026`
- JSON 원본: `http://<서버>:8501/?mode=raw&token=mlops2026`
macOS 빠른 열기:
```bash
open "http://localhost:8501/?mode=admin&token=mlops2026"
```
## 데이터 파일 — `./data/hackathon.json`
```json
{
"people": [
{"name": "홍길동", "team": "팀1", "dept": "MLOps Data", "senior": true, "notes": ""},
...
],
"settings": {"voting_open": true},
"titles": {"팀1": "Slack 자동 분류기"},
"tie_breaks": {
"utility_team": {"winner_team": "팀1", "method": "random", "decided_at": "..."}
},
"votes": [
{"voter_name": "...", "employee_id": "...", "voter_team": "...", "fun_team": "...",
"polish_team": "...", "utility_team": "...", "created_at": "..."}
]
}
```
- 호스트에서 직접 편집 가능 (jq, vi 등). 앱이 매 요청 reload — 핫리로드.
- `./data/` 디렉터리 read-write mount. atomic write (tmp + rename).
- 행사 전 명단 변경: `people[*].team` 값만 바꾸면 즉시 반영.
- 어드민 페이지 또는 `?mode=raw&token=...`에서 JSON 다운로드 가능.
- 시드 재생성: `rm data/hackathon.json && docker compose up -d` (entrypoint 자동 실행).
- `topics.categories` 4 카테고리 × 10 items. 어드민에서 form / JSON 둘 다 편집.
- `settings.current_stage` ∈ {"intro","topics","vote"} — 어드민에서 stage 컨트롤.
## 운영 흐름
1. 투표 시작 (기본 open)
2. 모두 투표 → 어드민 "🛑 투표 마감"
3. 동률 있으면 어드민에서 추첨/선택
4. "팀별 결과물 제목" 입력 (또는 발표 직후)
5. ceremony URL 띄움 → 시상 진행
## 테스트
```bash
docker cp tests/e2e.py hackathon-vote:/tmp/e2e.py
docker exec hackathon-vote python3 /tmp/e2e.py
```
19개 시나리오 검증 (로드, 마감 토글, winner, priority, 동률, 추첨, UNIQUE, 제목, archive, atomic, clear).
## 시상 매핑
| 상 | 상품 | 평가 |
|---|---|---|
| 🛠 실용성상 | 팜레스트 5개 (최고가) | 실제 쓸 만함 |
| 🏆 완성도상 | 양우산 5개 | 동작 / 시연 안정성 |
| 🎉 재미상 | 손선풍기 5개 | 발표장 임팩트 |
수상 우선순위: 실용성 > 완성도 > 재미. 발표 순서: 재미 → 완성도 → 실용성 (긴장감).