How okchang95/oow-fastapi works
Project type and purpose
• This is a monolithic FastAPI-based backend service that exposes RESTful endpoints for:
• MyPage (image upload + OCR verification + user stats)
• Calendar (daily attendance overview)
• Notice (CRUD for announcements)
• It uses Firebase (Firestore + Storage) as its database and file store, and is packaged in a Docker container.
File structure
• Top-level:
• Dockerfile / .dockerignore / .gitignore / requirements.txt
• README.md with environment and usage instructions
• serviceAccountKey.json + .env for Firebase credentials and config
• app/
• main.py — FastAPI app instantiation + router mounting
• api/ — route modules (calendar, mypage, notice)
– each subfolder has a router .py handling HTTP methods
– mypage/timecheck/ocr.py provides image-to-text logic
• core/config.py — Pydantic settings loader
• db/firebase.py — initializes Firebase Admin SDK (Firestore & Storage)
README for additional insights
• Environment variables configure CORS (FRONTEND_URL), Firebase key path, bucket name
• Docker build and run instructions emphasize volume-mounting the Firebase key
Elements
• Clear labels: “FastAPI Server”, “Router Layer”, “OCR Service”, “Firebase Firestore”, “Firebase Storage”, “Frontend/UI”
• Client → HTTP → FastAPI
• FastAPI → Firebase Storage / Firestore
• OCR → Storage → OCR result → FastAPI → Client
• Blue rectangles for internal modules (app/api, app/core, app/db)
Detailed guidance
• Inside it, partition three horizontal layers:
1) “API Gateway” – listing the three routers (calendar, mypage, notice)
2) “Business Logic” – OCR module, stats calculator
3) “Data Access” – Firebase initializer module
• Outside the container, show:
• Frontend (browser at FRONTEND_URL) invoking /docs and endpoints
• .env + serviceAccountKey.json feeding into the container at startup
• Firebase Cloud with two sub-services: Firestore and Storage