How kunalvegada/womens-day-express works
Project type & purpose (from file tree + README)
This is a single-page, static web experience (“Women’s Day Express 2026”) built with HTML/CSS/Vanilla JS and deployed via Firebase Hosting (presence of firebase.json). The “live, interactive” aspects and “attach photos and wishes” strongly imply use of Firebase client SDKs from script.js to persist and retrieve user-generated content—typically:
• Firestore / Realtime Database for wishes/messages and live counters
• Cloud Storage for photo uploads
There is no custom backend server in the repo (no Node/Express, no /functions directory), so the architecture is frontend + managed Firebase services.
File structure to architectural components
• index.html
The SPA entrypoint. Owns DOM structure: train, coaches, counters, popup containers.
• style.css
Presentation layer: Flexbox layout, animations (train motion), responsive styling.
• script.js
Application logic: train speed changes, coach counter, popup messages, and Firebase read/write/upload logic.
• firebase.json
Deployment/runtime hosting config: Firebase Hosting routes, caching, rewrites (if any), public directory mapping (likely root).
• README.md
User / Client
• “User on Desktop/Mobile Browser”
Frontend (static SPA)
• “Women’s Day Express SPA”
• (Optionally subdivide into)
• UI/DOM (index.html)
• Styling/Animations (style.css)
• App Logic + Firebase SDK (script.js)
Firebase Hosting
• Serves index.html, style.css, script.js over HTTPS
• (Note any rewrites/headers if present in firebase.json)
Firebase Data Services (include only what the code uses; infer likely set)
• Firestore or Realtime Database: wishes/messages, “live coach counter”, realtime updates
• Cloud Storage: photo uploads + retrieval URLs
• (Optional, only if referenced in script.js)
• Firebase Auth: anonymous/authenticated posting
Browser → Firebase Hosting
• HTTPS GET static assets (/index.html, /style.css, /script.js)
script.js ↔ Firestore/Realtime DB
• Firebase SDK (HTTPS/WebSocket)
• Writes: “submit wish/message”, increment counters
• Reads/listens: “subscribe to messages”, update live counter, trigger popups
script.js ↔ Cloud Storage
• Firebase SDK upload photo
• download URL retrieval for displaying attached photos
If there is “dynamic train speed” driven by local logic only, show it as internal UI logic inside the SPA (no external dependency). If it’s influenced by live data (e.g., speed increases with number of wishes), show a dependency from the DB read stream to the animation engine.
Architectural patterns/design principles to call out
• Serverless / Backendless architecture: all business logic runs client-side; persistence and realtime handled by Firebase managed services.
• Event-driven UI: user events (submit wish/upload) and realtime DB events (new message) drive UI updates (popups, counters, train behavior).
• Separation of concerns (simple):
• Markup (HTML), Presentation (CSS animations), Behavior (JS), Hosting/Config (Firebase)
• “Firebase Hosting”, “Firestore (realtime listeners)”, “Cloud Storage (photo upload)”, “Women’s Day Express SPA”
• GET static assets
• upload photo
• write wish
• realtime subscribe / receive updates
• Blue: client-side components (Browser, SPA modules)
• Green: Firebase managed services (Hosting/DB/Storage)
• Gray: external actor (User)
• Call out trust boundaries:
• Boundary around “Client” (untrusted)
• Boundary around “Firebase” (managed backend)
• “All validation/security must be enforced by Firebase Security Rules” (important in backendless apps)
“Don’t overthink it” — but do separate into many components
• UI Rendering (DOM)
• Animation Engine (train speed)
• Live Counter Module
• Popup/Toast Module
• Firebase Adapter (init + read/write/upload)
• Data Models: Wish/Message, Photo metadata