How csb-218/mathtastic works
Project type and purpose
• This is a full-stack educational game application (“Balance Scale Game”) with a Vue.js/Pinia/TailwindCSS frontend and a Python/FastAPI backend.
• It provides user authentication via Firebase, real-time game updates, and persistence in MongoDB (and Firestore).
File structure
• Top-level directories:
• backend/ – contains the FastAPI service, models, routers, schemas, utilities, Dockerfile and tests
• frontend/ – contains the Vue 3 application, components, services, store (Pinia), router, assets, Dockerfile, E2E & unit tests
• Key patterns:
• Frontend is component + service + store-driven (MVVM-ish)
• Backend follows a router/model/schema pattern (FastAPI’s flavor of MVC)
• Infrastructure as code: two Dockerfiles, .dockerignore, deployment config (vercel.json)
Extract additional insights from the README
• Tech stack: Vue.js, Pinia, TailwindCSS, FastAPI, MongoDB, Firestore, Firebase Auth, JWT
• Features highlight protected routes, JWT sessions, real-time updates
• Roadmap mentions Dockerization (already partially in place)
• Web Browser (client)
• Frontend SPA (Vue.js + Pinia + Tailwind)
• Backend API (FastAPI)
• Data stores: MongoDB cluster, Firebase Firestore
• Auth service: Firebase Authentication / JWT verification
• External services: Firebase Realtime updates (if used), static file hosting (e.g., Vercel)
• Browser ↔ Frontend (static assets served from CDN/Vercel)
• Frontend → Backend API (Axios HTTP calls, protected routes using JWT in headers)
• Backend → MongoDB (via db.py wrapper)
• Backend → Firestore (via firebase_admin.py)
• Backend ↔ Firebase Auth (JWT verification on each request)
c. Architectural patterns and principles:
• Separation of concerns: UI / state management / API services / persistence
• RESTful API endpoints organized by resource (users, games, activities, badges)
• Model-Schema mapping in backend for validation and serialization
• Pinia stores centralize client state, Services layer encapsulates API calls
d. Key technologies and frameworks:
• Vue 3 + Pinia + TailwindCSS + Vite (frontend build)
• FastAPI + Pydantic Schemas (backend)
• MongoDB (primary database), Firestore (supplementary, realtime), Firebase Auth (OAuth + JWT)
• Docker containers for frontend & backend
Detail without over-fragmentation
• Every major module: frontend’s Router, Pinia Store, API Services, backend routers/models/schemas.