Event: 3-Day Sports Week
Organizer: CSIT Students
Faculties: CSIT, BCA, BSW, BBS
- Project Overview
- Entity Relationship Diagram
- Deployment Architecture
- Design System & UX/UI
- Animation System
- Backend & API
- Frontend & Testing
- Docker & Deployment
- Tailscale Deployment (Recommended)
- Cloudflare Tunnel Guide
- Homeserver Deployment
- Code Architecture & Refactoring
- Testing & Reports
- Project Phases & TODOs
- Support & Resources
This tool manages a multi-faculty sports week event, providing real-time dashboards, live scoring, and automated leaderboards. Built with Bun, React, Express, PostgreSQL, Drizzle ORM, and Socket.io.
Tech Stack:
- Runtime: Bun (v1.0+)
- Frontend: React (Vite) + Tailwind CSS v4 + Lucide-React Icons
- Backend: Express.js (Bun) + Drizzle ORM
- Database: PostgreSQL 16 (Docker)
- Real-time: Socket.io 4.8.3
- Auth: JWT (Admin/Manager roles)
- Deployment: Docker Compose + Tailscale VPN (recommended)
- Reverse Proxy: Nginx
- Container Registry: GitHub Container Registry (GHCR)
Deployment Scripts:
deploy-tailscale.sh- One-command Tailscale deploymentbuild-and-push.sh- Build and push Docker images to GHCRdeploy-homeserver.sh- Legacy homeserver deployment
Quick Links:
- π Architecture Diagrams - Mermaid diagrams of deployment architecture
- π Tailscale Guide - Recommended deployment method
- π Quick Start - 5-minute deployment guide
- π Deployment Comparison - Tailscale vs Cloudflare
- β Deployment Checklist - Step-by-step verification
- π Deployment Story - How this was built and deployed
erDiagram
FACULTY ||--o{ PLAYER : "enrolled in"
FACULTY ||--o{ TEAM : "forms"
GAME ||--o{ MATCH : "has"
MATCH ||--o{ MATCH_PARTICIPANT : "contested by"
TEAM ||--o{ MATCH_PARTICIPANT : "competes as"
PLAYER ||--o{ MATCH_PARTICIPANT : "competes as"
USER ||--o{ GAME : "assigned to manage"
FACULTY {
string id PK
string name "CSIT, BCA, BSW, BBS"
int totalPoints "Auto-calculated"
}
PLAYER {
string id PK
string name
string facultyId FK
string semester "e.g., 5th"
}
GAME {
string id PK
string name "Futsal, Chess, Cricket, etc."
string type "TEAM or INDIVIDUAL"
int pointWeight "Weight for Faculty Tally"
}
TEAM {
string id PK
string facultyId FK
string gameId FK
string name "e.g., CSIT 5th Tigers"
}
MATCH {
string id PK
string gameId FK
datetime startTime
string venue "Ground A, Hall B"
string status "UPCOMING, LIVE, FINISHED"
}
MATCH_PARTICIPANT {
string id PK
string matchId FK
string teamId FK "NULL if Individual"
string playerId FK "NULL if Team"
int score
int pointsEarned "Points contributing to Faculty"
}
USER {
string id PK
string username
string passwordHash
string role "ADMIN or MANAGER"
}
See ARCHITECTURE.md for comprehensive deployment architecture diagrams.
Interactive Mermaid Diagrams:
- System Architecture: Complete overview of Tailscale β Docker stack
- Request Flow: Sequence diagram showing user interactions
- Network Topology: Docker network and external access patterns
- Deployment Process: Complete deployment flowchart
- Security Layers: 4-layer security architecture
- Scaling Options: Future growth paths
- Traffic Patterns: User workflow diagrams
- Monitoring Points: Observable metrics
- Backup Strategy: Automated backup schedule
Key Architecture Highlights:
- Tailscale VPN: WireGuard mesh network for secure access
- Docker Compose: 4-container orchestration (nginx, backend, frontend, postgres)
- Nginx Reverse Proxy: Routes traffic and handles WebSocket upgrades
- Zero-Cost Hosting: Self-hosted on home server (Dell laptop)
- Real-time Updates: Socket.io for live score broadcasting
See DESIGN_SYSTEM.md and UX_BEST_PRACTICES.md for full details.
Highlights:
- Color system: Blue, green, amber, red, gray palettes
- Typography: System UI, clear hierarchy, accessible sizes
- Spacing: 4px grid, responsive layouts
- Shadows, border radius, and interaction states
- Accessibility: WCAG AA, keyboard navigation, ARIA labels
- Responsive: Mobile-first, breakpoints for all devices
See ANIMATIONS.md, ANIMATION_VISUAL_GUIDE.md, and ANIMATION_SUMMARY.md.
Key Components:
- PageTransition: Smooth page loads
- CardTransition: Staggered card/grid animations
- StaggerContainer: Coordinated child animations
- ListItemAnimation: List item slide/fade
- ScaleAnimation: Badge pop-in
Specs:
- Duration: 200-300ms
- Easing: ease-out, spring (stiffness 300, damping 20)
- Accessibility: Respects prefers-reduced-motion
- GPU-accelerated (transform, opacity)
See backend/README.md, REFACTORING_SUMMARY.md, and BACKEND_TEST_REPORT.md.
Features:
- Express.js backend (Bun runtime)
- Drizzle ORM, PostgreSQL
- JWT authentication (admin/manager)
- Socket.io for real-time updates
- Clean architecture: config, services, routes, middleware
- API endpoints for faculties, games, teams, players, matches, points
Quick Start:
cd backend
bun install
bun run db:push
bun run seed
bun run devSee frontend/README.md, TESTING.md, and PHASE-9-CHECKLIST.md.
Features:
- React (Vite), Tailwind CSS, Lucide Icons
- Real-time Socket.io client
- Protected routes (admin/manager)
- Loading skeletons, error boundaries, toast notifications
- Framer Motion animations
- Comprehensive testing with Vitest, Testing Library
Testing:
cd frontend
bun testComplete Deployment Guides:
- TAILSCALE_DEPLOYMENT.md - Recommended for home servers
- DEPLOYMENT_COMPARISON.md - Compare Tailscale vs Cloudflare
- DEPLOYMENT_CHECKLIST.md - Step-by-step verification
- DEPLOYMENT_SUMMARY.md - Quick overview
- QUICK_START_TAILSCALE.md - 5-minute guide
- ARCHITECTURE.md - Architecture diagrams
- HOMESERVER_DEPLOYMENT.md - Full homeserver guide
Local Development:
docker compose up -d
docker compose ps
docker compose logs -fServices:
- Web App: http://localhost:5173
- API: http://localhost:3001
- Database: localhost:5433
Why Tailscale?
- β $0 hosting cost
- β WireGuard encryption (bank-grade security)
- β 5-minute setup
- β No credit card required
- β No port forwarding needed
- β Works behind NAT
- β Both private AND public access options
Access Methods:
-
Private Network (Primary) - 100% reliable, invite-only
- Users join your Tailscale network
- Access via:
http://<device>.tail-scale.ts.net - Perfect for managers and authorized users
-
Public Access (Tailscale Funnel) - Works for most users
- Enabled with:
tailscale funnel 80 - Access via:
https://<device>.saury-company.ts.net - No Tailscale required for viewers
- Note: May have DNS restrictions on some mobile networks
- Enabled with:
One-Command Deployment:
./deploy-tailscale.shWhat it does:
- Checks prerequisites (Docker, Tailscale)
- Gets your Tailscale hostname automatically
- Generates secure passwords and JWT secret
- Creates .env with proper configuration
- Pulls Docker images from GHCR
- Starts all services with health checks
- Provides your access URLs (private + public)
Enable Public Access (Optional):
tailscale funnel 80Build and Push Images:
./build-and-push.shUser Access:
For Managers (Private Network):
- Install Tailscale
- Join your Tailscale network (via invite link)
- Access the private URL
For Public Viewers (Funnel):
- Just visit the public URL - no Tailscale needed!
- Works on most networks
See TAILSCALE_DEPLOYMENT.md for complete guide.
See CLOUDFLARE_TUNNEL_SETUP.md for secure remote access setup.
Features:
- Zero open ports on homeserver
- Automatic HTTPS, DDoS protection
- DNS setup, systemd service, troubleshooting
See HOMESERVER_DEPLOYMENT.md for full guide.
Steps:
- Install Docker & Compose
- Clone repo & configure .env
- Run
docker compose up -d - Monitor with
docker compose logs -f - Backup/restore database as needed
See REFACTORING_SUMMARY.md and backend/README.md.
Highlights:
- Clean separation: config, services, routes, middleware
- TypeScript types throughout
- Centralized error handling
- Service layer for business logic
- Real-time events: scoreUpdate, matchStatusChange, leaderboardUpdate
See BACKEND_TEST_REPORT.md, frontend/TESTING.md, and PHASE-9-COMPLETION.md.
Backend:
- All endpoints tested (faculties, games, matches, players, teams, users, points)
- Real-time Socket.io events verified
- Data integrity and performance optimal
Frontend:
- Unit/component tests with Vitest
- 80%+ coverage on core components
- Manual and automated test checklists
See AI_CONTEXT.prompt.txt for full breakdown.
Phases:
- Phase 0: Infrastructure Setup
- Phase 1: Backend Foundation
- Phase 2: Code Refactoring
- Phase 3: Frontend & Socket.io
- Phase 4: User Management
- Phase 5: Admin CRUD
- Phase 6: Manager Dashboard
- Phase 7: Public Dashboard
- Phase 8: Points Calculation
- Phase 9: UI Polish & Testing
- Phase 10: Deployment
Current Status:
- All major features implemented
- Production ready
- See phase checklists for details
- Framer Motion Docs
- Web Animation Performance
- Accessibility & Motion
- Docker Documentation
- Bun Documentation
- Next.js Docs
- Prisma Docs
- Supabase Docs
Status: β
Production Ready | π Self-Hosted on Tailscale | π Publicly Accessible
Deployment: β
One-command setup (./deploy-tailscale.sh) - 5 minutes from zero to deployed
Cost: $0 - Self-hosted on home server (Dell laptop) with Tailscale VPN
Access:
- π Private Network: Secure invite-only access for managers via Tailscale mesh
- π Public Access: Available via Tailscale Funnel (no Tailscale required for viewers)
Features: Real-time scoring, live leaderboards, team management, automated points calculation
Recommended Deployment: Tailscale (see TAILSCALE_DEPLOYMENT.md)
Alternative: Cloudflare Tunnel has free tier limitations - see DEPLOYMENT_COMPARISON.md
Documentation:
- Complete architecture diagrams in ARCHITECTURE.md
- Deployment guides: Tailscale, Cloudflare, Homeserver
- Production deployment story: linkedin_post.txt
PS : This sevice may be unavailable after the event ends.
Last Updated: February 9, 2026