Your Intelligent Sports Copilot โ Find, Compare & Book Courts Using Natural Language
๐ Vercel Link: https://aiplaysphere.vercel.app/
๐ Netlify Link: https://aiplaysphere.netlify.app/
Problem โข Solution โข Architecture โข AI Agents โข Features โข Tech Stack โข Database โข API Docs โข Installation โข Demo
Organizing a game of football, badminton, or cricket is a fragmented, frustrating experience:
- ๐ Players manually search across multiple platforms and messaging groups for available venues
- ๐ Coordination requires endless calls to venue managers to verify open slots
- ๐ฐ No transparent pricing โ players can't easily compare rates or find budget-friendly options
- ๐บ๏ธ No unified geographic search โ discovering nearby facilities requires trial and error
- ๐ Venue owners lack data-driven tools to optimize pricing, track demand, or manage bookings efficiently
The sports infrastructure discovery and booking pipeline is broken โ it needs an intelligent, agentic solution.
graph LR
subgraph BEFORE["โ Current Experience"]
B1[Search WhatsApp Groups] --> B2[Call 5+ Venues]
B2 --> B3[Check Availability Manually]
B3 --> B4[Negotiate Pricing]
B4 --> B5[Hope for Confirmation]
end
subgraph AFTER["โ
With PlaySphere"]
A1["'Book badminton 7 PM Gomti Nagar'"] --> A2["AI Parses โ Searches โ Books"]
A2 --> A3["โ
Confirmed in Seconds"]
end
BEFORE -.->|"PlaySphere Replaces"| AFTER
style BEFORE fill:#1a0000,stroke:#ef4444,color:#fca5a5
style AFTER fill:#001a0e,stroke:#10b981,color:#6ee7b7
PlaySphere is a full-stack, AI-powered sports venue discovery and booking platform that combines:
| Capability | Description |
|---|---|
| ๐ค AI Sports Copilot | A conversational agentic AI that parses natural language queries, searches venues, compares prices, and books courts autonomously |
| ๐บ๏ธ Interactive Geo Map | Real-time dark-themed Leaflet map with venue markers, area density overlays, and one-click booking popups |
| โก Real-Time Booking Engine | Live slot availability with Socket.IO push updates, conflict detection, and instant confirmation |
| ๐ Smart Pricing Agent | Demand-aware dynamic pricing suggestions: peak hour surcharges, rainy day discounts, last-minute offers |
| ๐ Venue Owner Dashboard | Business intelligence portal with SVG revenue charts, donut sport breakdowns, AI booking share metrics, sparkline trends, and customer reviews |
| ๐ Role-Based Access | JWT-secured authentication with three roles: Player, Venue Owner, and Platform Admin |
User says: "Book badminton tomorrow 7 PM near Gomti Nagar under โน500"
PlaySphere AI Copilot:
โโโ ๐ Parses intent โ Sport: badminton, Date: tomorrow, Time: 19:00, Area: Gomti Nagar, Budget: โน500
โโโ ๐๏ธ Queries database with geospatial + sport + price filters
โโโ โก Checks real-time slot availability across matching venues
โโโ โ
Books the best available court automatically
โโโ ๐ฑ Returns confirmation with venue details, price, and time
Result: TRUE AGENTIC AI โ from natural language to confirmed booking in one step
graph TB
subgraph Client["๐ฅ๏ธ Frontend โ React 18 + Vite"]
UI[Premium Glassmorphism UI]
MAP[Leaflet Dark Map Engine]
CHAT[AI Chat Widget]
BOOK[Booking Interface]
DASH[SVG Analytics Dashboard]
end
subgraph Server["โ๏ธ Backend โ Express + Socket.IO"]
API[REST API Gateway]
AUTH[JWT Auth Middleware]
RT[Real-Time Engine]
ADAPT[Mongoose-Compatible Adapter]
end
subgraph Agents["๐ค AI Agent Layer"]
NLP[NLP Intent Parser]
REC[Recommendation Agent]
PRICE[Dynamic Pricing Agent]
DEMAND[Demand Prediction Agent]
end
subgraph Data["๐๏ธ Data Layer โ Firebase / Local JSON"]
USERS[(Users Collection)]
VENUES[(Venues + GeoJSON Index)]
BOOKINGS[(Bookings Collection)]
REVIEWS[(Reviews Collection)]
end
Client -->|HTTP/WS| Server
Server -->|Query/Mutate| Data
Server -->|Invoke| Agents
Agents -->|Read/Write| Data
RT -->|Push Updates| Client
flowchart LR
A["๐ User Action"] --> B["๐ React Frontend"]
B -->|Axios HTTP| C["โ๏ธ Express Router"]
C --> D{"๐ JWT Auth?"}
D -->|Valid| E["๐ Route Handler"]
D -->|Invalid| F["โ 401 Unauthorized"]
E --> G["๐๏ธ Database Adapter"]
G -->|Firebase Set?| H["โ๏ธ Firestore"]
G -->|No Credentials| I["๐ localDb.json"]
H --> J["๐จ Response"]
I --> J
J -->|JSON| B
E -->|Booking Created?| K["โก Socket.IO Emit"]
K -->|Real-Time Push| B
style A fill:#0d2137,stroke:#06b6d4,color:#67e8f9
style H fill:#1a1040,stroke:#8b5cf6,color:#c4b5fd
style I fill:#0a1628,stroke:#10b981,color:#6ee7b7
style K fill:#1a0d28,stroke:#ec4899,color:#f9a8d4
sequenceDiagram
actor Player as ๐ Athlete
participant Chat as ๐ฌ Chat Widget
participant NLP as ๐ง NLP Intent Parser
participant Search as ๐ Venue Search Agent
participant Book as ๐
Booking Agent
participant DB as ๐๏ธ Database
participant Notify as โก Socket.IO
Player->>Chat: "Book badminton tomorrow 7 PM near Gomti Nagar"
Chat->>NLP: POST /api/ai/chat
rect rgb(15, 23, 42)
Note over NLP: ๐ค AI Agent Processing Pipeline
NLP->>NLP: Extract entities (sport, date, time, location, budget)
NLP->>Search: Build geospatial + filter query
Search->>DB: Find venues matching sport, area, price
DB-->>Search: Return matched venues (sorted by rating)
Search->>Search: Apply budget filter & rank results
end
alt โ
Slot Available
Search->>Book: Top venue selected, create booking
Book->>DB: Create booking with status "confirmed"
DB-->>Book: Booking confirmed
Book->>Notify: Emit "booking:new" event
Notify-->>Player: Real-time confirmation
Book-->>Chat: "โ
Booked at Gomti Nagar Sports Arena, 7:00 PM, โน400"
else โ No Slots
Search-->>Chat: Return alternative venues with available times
Chat-->>Player: Render inline venue suggestion cards
end
graph LR
subgraph Agents["๐ค PlaySphere AI Agents"]
A1[๐ Discovery Agent<br/>Venue search & filtering]
A2[๐
Booking Agent<br/>Slot reservation & conflicts]
A3[๐ฐ Pricing Agent<br/>Dynamic pricing optimization]
A4[โญ Recommendation Agent<br/>Personalized suggestions]
A5[๐ Demand Agent<br/>Trend prediction & analytics]
end
A1 --> A2
A1 --> A4
A3 --> A2
A5 --> A3
A5 --> A4
| Agent | Role | Input | Output |
|---|---|---|---|
| Discovery Agent | Searches venues by sport, location, price, and amenities | User query + filters | Ranked venue list |
| Booking Agent | Handles slot availability, conflict detection, and reservation | Venue + time + user | Confirmed booking |
| Pricing Agent | Generates peak/off-peak/weekend pricing recommendations | Venue bookings data | Pricing matrix |
| Recommendation Agent | Scores venues based on user preferences and play history | User profile + venues | Scored recommendations |
| Demand Agent | Predicts trending sports, peak hours, and busiest days | Aggregate booking data | Demand insights |
flowchart TD
INPUT["๐ฌ User Message"] --> LOWER["๐ก Normalize & Lowercase"]
LOWER --> S{"๐
Sport\nDetected?"}
S -->|Yes| SPORT["football / badminton / cricket..."]
S -->|No| DEFAULT["Use user preferences"]
LOWER --> L{"๐ Location\nDetected?"}
L -->|Yes| LOC["Extract area name"]
L -->|No| GEOLOC["Use GPS coordinates"]
LOWER --> T{"๐ Time\nDetected?"}
T -->|Yes| TIME["Parse hour โ HH:00"]
T -->|No| NEXTSLOT["Find next available"]
LOWER --> D{"๐
Date\nDetected?"}
D -->|Yes| DATE["today / tomorrow / specific date"]
D -->|No| TODAY["Default: today"]
LOWER --> B{"๐ฐ Budget\nDetected?"}
B -->|Yes| BUDGET["Extract max price"]
B -->|No| NOBUDGET["No price filter"]
SPORT --> INTENT["๐ฏ Structured Intent"]
DEFAULT --> INTENT
LOC --> INTENT
GEOLOC --> INTENT
TIME --> INTENT
NEXTSLOT --> INTENT
DATE --> INTENT
TODAY --> INTENT
BUDGET --> INTENT
NOBUDGET --> INTENT
INTENT --> CLASSIFY{"๐ค Intent\nClassification"}
CLASSIFY -->|book / find| SEARCH["๐ Search + Book"]
CLASSIFY -->|recommend| RECOMMEND["โญ Recommendations"]
CLASSIFY -->|demand / trends| ANALYTICS["๐ Demand Insights"]
CLASSIFY -->|schedule| SCHEDULE["๐
My Bookings"]
CLASSIFY -->|help / greeting| HELP["๐ก Help Response"]
style INPUT fill:#0d2137,stroke:#06b6d4,color:#67e8f9
style INTENT fill:#1a1040,stroke:#8b5cf6,color:#c4b5fd
style CLASSIFY fill:#0a1628,stroke:#f59e0b,color:#fcd34d
| Feature | Description |
|---|---|
| ๐ค AI Sports Copilot | Natural language chat to find and book venues โ "Find football turf for 8 players under โน1200 near Chinhat" |
| ๐บ๏ธ Live Venue Map | Dark-themed interactive Leaflet map with custom markers, area popups, and venue density visualization |
| ๐ Smart Filters | Filter by sport, area, rating, price range, and sort by popularity or distance |
| ๐ Instant Slot Booking | Interactive time grid showing real-time availability with one-click reservation |
| โญ Venue Reviews | Rate and review venues with star ratings and written feedback |
| ๐ Booking History | Track upcoming games and past reservations with cancel/refund support |
| ๐ก AI Recommendations | Personalized venue suggestions based on preferred sports and play history |
| ๐ท๏ธ Price Comparison | View and compare prices across multiple venues at a glance |
| Feature | Description |
|---|---|
| ๐ Analytics Dashboard | SVG-rendered revenue bar charts, donut sport breakdown, sparkline trends, and KPI stat cards |
| ๐ฐ AI Dynamic Pricing | Automated pricing recommendations for peak hours, weekends, rainy days, and last-minute slots |
| ๐ Demand Prediction | Trending sports, peak hours analysis, and day-wise demand forecasting |
| ๐ฅ Customer Management | View all bookings, user details, and booking sources (manual vs AI-booked) |
| ๐ง AI Insights Panel | Actionable business intelligence โ weekend surge alerts, off-peak opportunity tips, adoption metrics |
| ๐ Revenue Breakdown | Month-over-month comparison tables with per-booking averages and share percentages |
| ๐ Sport Performance | Ranked sport leaderboard with booking counts, revenue, and progress bars |
| ๐ Real-Time Updates | Live booking feed with instant status changes and source tracking |
| Feature | Description |
|---|---|
| ๐ JWT Authentication | Secure token-based auth with role-based access control (Player / Owner / Admin) |
| โก Real-Time Updates | Socket.IO powered live booking notifications and slot status changes |
| ๐ Geospatial Queries | Haversine distance calculation for proximity-based venue search |
| ๐จ Premium Dark UI | Glassmorphism design with 12+ custom animations, gradient accents, and responsive layouts |
| ๐ฑ Mobile Responsive | Fully responsive across desktop, tablet, and mobile devices |
| ๐ฆถ Professional Footer | Multi-column footer with brand info, sport tags, platform links, social icons, and feature badges |
| ๐ฅ Firebase-Ready | Firestore integration with graceful local JSON fallback for zero-dependency demos |
| ๐ Inline SVG Charts | Zero-dependency bar charts, donut charts, and sparkline trends rendered as pure SVG |
erDiagram
USER ||--o{ BOOKING : "creates"
USER ||--o{ REVIEW : "writes"
USER ||--o{ VENUE : "owns"
VENUE ||--o{ BOOKING : "hosts"
VENUE ||--o{ REVIEW : "receives"
VENUE }|--|| SPORT_CONFIG : "offers"
USER {
string _id PK
string username UK
string email UK
string password
string role "user | venue_owner | admin"
string phone
object location "GeoJSON Point"
array preferredSports
string skillLevel
}
VENUE {
string _id PK
string name
string description
string address
string area
string city
object location "GeoJSON Point"
array sports "SportConfig[]"
array amenities
ref owner FK "โ User"
float rating "0โ5"
int totalReviews
object operatingHours
boolean isActive
}
BOOKING {
string _id PK
ref user FK "โ User"
ref venue FK "โ Venue"
string sport
int court
date date
string startTime
string endTime
float totalPrice
string status "pending | confirmed | cancelled | completed"
string paymentStatus
boolean isAgentBooked
}
REVIEW {
string _id PK
ref user FK "โ User"
ref venue FK "โ Venue"
int rating "1โ5"
string comment
}
SPORT_CONFIG {
string name
int courts
float pricePerHour
int maxPlayers
}
PlaySphere uses a Mongoose-compatible adapter (mongooseMock.js) that provides a unified interface for both Firebase Firestore and a local JSON database:
flowchart TB
subgraph Models["๐ฆ Mongoose-Style Models"]
U[User.js]
V[Venue.js]
B[Booking.js]
R[Review.js]
end
subgraph Adapter["๐ Database Adapter โ mongooseMock.js"]
SCHEMA["Schema Definition<br/>fields, hooks, methods, statics"]
QE["Query Engine<br/>find, findOne, aggregate, populate"]
FILTER["In-Memory Filter<br/>$regex, $gte, $lte, $in, $or, $near, $text"]
HOOKS["Lifecycle Hooks<br/>pre/post save, deleteOne"]
end
subgraph Storage["๐พ Storage Backend"]
FB["โ๏ธ Firebase Firestore<br/>(if credentials provided)"]
LJ["๐ localDb.json<br/>(zero-dependency fallback)"]
end
Models -->|"require('./mongooseMock')"| Adapter
Adapter -->|"FIREBASE_PROJECT_ID set?"| FB
Adapter -->|"No credentials"| LJ
style Adapter fill:#1a1040,stroke:#8b5cf6,color:#c4b5fd
style FB fill:#1a0d00,stroke:#f59e0b,color:#fcd34d
style LJ fill:#001a0e,stroke:#10b981,color:#6ee7b7
Supported Query Operators:
| Operator | Description | Example |
|---|---|---|
$regex |
Pattern matching with flags | { area: { $regex: 'gomti', $options: 'i' } } |
$gte / $lte |
Range comparisons | { rating: { $gte: 4.0 } } |
$in |
Match any value in array | { status: { $in: ['confirmed', 'completed'] } } |
$or |
Logical OR across conditions | { $or: [{ area: /gomti/i }, { name: /gomti/i }] } |
$near |
Geospatial proximity (Haversine) | { location: { $near: { $geometry: { coordinates: [80.9, 26.8] } } } } |
$text |
Full-text search across fields | { $text: { $search: 'badminton court' } } |
$sum / $avg |
Aggregation operators | { $group: { _id: '$sport', total: { $sum: '$totalPrice' } } } |
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 18 + Vite | Component-based SPA with hot module replacement |
| Routing | React Router DOM v6 | Client-side navigation with protected routes |
| Maps | Leaflet + React Leaflet | Interactive dark-themed map with CartoDB tiles |
| Charts | Inline SVG | Zero-dependency bar charts, donut charts, sparkline trends |
| Icons | Lucide React | Premium icon library (350+ icons) |
| HTTP Client | Axios | API communication with interceptors |
| Styling | Vanilla CSS | Custom design system with CSS variables, glassmorphism, animations |
| Backend | Node.js + Express | RESTful API server with middleware architecture |
| Database | Firebase Firestore / Local JSON | Cloud-native document storage with local fallback |
| DB Adapter | Custom Mongoose Mock | Mongoose-compatible API for seamless model usage |
| Auth | JWT + bcryptjs | Stateless authentication with password hashing |
| Real-Time | Socket.IO | Bidirectional WebSocket communication |
| AI Engine | Custom NLP Parser | Rule-based intent extraction for sports queries |
graph TB
subgraph FE["๐จ Frontend Stack"]
REACT["โ๏ธ React 18"]
VITE["โก Vite"]
LEAFLET["๐บ๏ธ Leaflet Maps"]
SVG["๐ SVG Charts"]
CSS["๐จ Glassmorphism CSS"]
LUCIDE["โจ Lucide Icons"]
AXIOS["๐ก Axios"]
end
subgraph BE["โ๏ธ Backend Stack"]
NODE["๐ Node.js"]
EXPRESS["๐ Express"]
SOCKETIO["โก Socket.IO"]
JWT["๐ JWT"]
BCRYPT["๐ bcryptjs"]
end
subgraph DB["๐๏ธ Data Stack"]
FIREBASE["๐ฅ Firebase Firestore"]
LOCALJSON["๐ Local JSON"]
ADAPTER["๐ Mongoose Adapter"]
end
subgraph AI["๐ค AI Stack"]
NLP_["๐ง NLP Parser"]
PRICING_["๐ฐ Pricing Agent"]
DEMAND_["๐ Demand Agent"]
REC_["โญ Rec Agent"]
end
FE <-->|REST API| BE
BE <-->|Read/Write| DB
BE --> AI
BE <-->|WebSocket| FE
style FE fill:#0d2137,stroke:#06b6d4,color:#67e8f9
style BE fill:#0a1628,stroke:#10b981,color:#6ee7b7
style DB fill:#1a0d00,stroke:#f59e0b,color:#fcd34d
style AI fill:#1a1040,stroke:#8b5cf6,color:#c4b5fd
PlaySphere/
โ
โโโ backend/ # โ๏ธ Express API Server
โ โโโ config/
โ โ โโโ db.js # Database connection initializer
โ โ โโโ mongooseMock.js # ๐ฅ MongooseโFirebase/JSON adapter (800+ lines)
โ โโโ middleware/
โ โ โโโ authMiddleware.js # JWT verification + role authorization
โ โโโ models/
โ โ โโโ User.js # User schema (bcrypt hashing, roles, preferences)
โ โ โโโ Venue.js # Venue schema (GeoJSON, sports config, amenities)
โ โ โโโ Booking.js # Booking schema (conflict detection, pricing)
โ โ โโโ Review.js # Review schema (star ratings, auto avg calculation)
โ โโโ routes/
โ โ โโโ authRoutes.js # Register, Login, Profile endpoints
โ โ โโโ venueRoutes.js # CRUD + geospatial search + slot availability
โ โ โโโ bookingRoutes.js # Create, list, cancel bookings
โ โ โโโ aiRoutes.js # ๐ค AI Copilot chat + recommendations + pricing
โ โ โโโ analyticsRoutes.js # Dashboard stats, heatmap data, platform metrics
โ โโโ seed/
โ โ โโโ seedData.js # 15 Lucknow venues, 5 users, 30 bookings, reviews
โ โโโ localDb.json # ๐ Auto-generated local database (fallback)
โ โโโ server.js # App bootstrap, Socket.IO, middleware, error handling
โ โโโ .env.example # Environment variable template
โ โโโ package.json
โ
โโโ frontend/ # ๐ฅ๏ธ React + Vite Client
โ โโโ public/
โ โ โโโ favicon.svg # PlaySphere gradient favicon
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ Navbar.jsx # Glassmorphism header with mobile drawer
โ โ โ โโโ Footer.jsx # ๐ฆถ Multi-column footer with social & feature badges
โ โ โ โโโ MapView.jsx # Leaflet dark map with custom DivIcon markers
โ โ โ โโโ VenueCard.jsx # Glass card with sports tags, ratings, pricing
โ โ โ โโโ BookingModal.jsx # Slot grid picker, date selector, price calculator
โ โ โ โโโ AIChatbot.jsx # ๐ค Floating AI chat with suggestion prompts
โ โ โ โโโ StatsCard.jsx # Animated counter with gradient values
โ โ โ โโโ FeatureCard.jsx # Feature showcase with hover glow effects
โ โ โโโ pages/
โ โ โ โโโ Home.jsx # Hero section, stats, features, CTA
โ โ โ โโโ Explore.jsx # Split layout: filters + map + venue grid
โ โ โ โโโ VenueDetail.jsx # Sport tabs, amenities, reviews, mini-map
โ โ โ โโโ Bookings.jsx # Upcoming/past tabs with cancel actions
โ โ โ โโโ Dashboard.jsx # ๐ Enhanced: SVG charts, donut, sparklines, AI insights
โ โ โ โโโ Auth.jsx # Login/Register with role selection + demo buttons
โ โ โโโ App.jsx # Route definitions + AuthContext + Footer
โ โ โโโ index.css # ๐จ Complete design system (600+ lines)
โ โ โโโ main.jsx # React root with BrowserRouter
โ โโโ index.html # SEO tags, Google Fonts, Leaflet CSS
โ โโโ vite.config.js # API proxy to backend
โ โโโ package.json
โ
โโโ .gitignore
โโโ README.md # ๐ This file
| Method | Endpoint | Access | Description |
|---|---|---|---|
POST |
/register |
Public | Create new account (Player or Venue Owner) |
POST |
/login |
Public | Authenticate and receive JWT token |
GET |
/me |
Private | Get current user profile |
| Method | Endpoint | Access | Description |
|---|---|---|---|
GET |
/ |
Public | List venues with filters (sport, area, minPrice, maxPrice, minRating, sort) |
GET |
/nearby?lat=&lng=&radius= |
Public | Geospatial proximity search |
GET |
/:id |
Public | Venue detail with reviews |
GET |
/:id/slots?date=&sport= |
Public | Available time slots for a specific date |
POST |
/ |
Owner | Create new venue |
PUT |
/:id |
Owner | Update venue details |
POST |
/:id/reviews |
Private | Submit star rating and comment |
| Method | Endpoint | Access | Description |
|---|---|---|---|
POST |
/ |
Private | Reserve a court slot (conflict detection included) |
GET |
/my |
Private | Get user's booking history |
PUT |
/:id/cancel |
Private | Cancel booking and trigger refund |
GET |
/venue/:venueId |
Owner | View bookings for owned venue |
| Method | Endpoint | Access | Description |
|---|---|---|---|
POST |
/chat |
Private | AI Sports Copilot โ natural language venue search + booking |
GET |
/recommendations |
Private | Personalized venue suggestions based on user preferences |
GET |
/demand-prediction |
Public | Trending sports, peak hours, busiest days |
GET |
/dynamic-pricing/:venueId |
Owner | AI pricing matrix (peak, off-peak, weekend, rainy day) |
| Method | Endpoint | Access | Description |
|---|---|---|---|
GET |
/dashboard |
Owner | Revenue, bookings, ratings, AI booking share, monthly trends |
GET |
/heatmap |
Public | Venue coordinates with crowd density for map overlay |
GET |
/stats |
Public | Platform-wide aggregate statistics |
sequenceDiagram
participant C as ๐ฅ๏ธ Client
participant A as ๐ Auth Middleware
participant R as ๐ Router
participant D as ๐๏ธ Database
participant S as โก Socket.IO
C->>R: POST /api/bookings
R->>A: Verify JWT Token
A-->>R: โ
User Authenticated
R->>D: Check slot availability
D-->>R: Slot is free
R->>D: Create booking document
D-->>R: Booking saved
R->>S: Emit 'booking:new'
S-->>C: Real-time notification
R-->>C: 201 { success: true, booking }
- Node.js (v18+) โ Download
- Firebase (optional) โ Firebase Console
- The app works without Firebase using a local JSON database fallback
git clone https://github.com/your-username/PlaySphere.git
cd PlaySpherecd backend
cp .env.example .envEdit .env with your configuration:
PORT=5000
JWT_SECRET=your_secure_secret_key
JWT_EXPIRE=30d
CLIENT_URL=http://localhost:5173
# Firebase Configuration (leave blank to use local JSON database)
FIREBASE_PROJECT_ID=
FIREBASE_CLIENT_EMAIL=
FIREBASE_PRIVATE_KEY=๐ก No Firebase? That's fine! Leave the Firebase fields blank and PlaySphere will use
localDb.jsonautomatically.
npm install
npm run seed # Seeds 15 Lucknow venues, 5 users, 30 bookings, reviews
npm run dev # Starts Express server on port 5000Expected seed output:
โ ๏ธ Firebase credentials not provided. Falling back to local JSON Database
โจ PlaySphere Database Adapter Loaded (Firebase Firestore / Local Fallback Active)
๐ฑ Starting PlaySphere database seed...
๐๏ธ Cleared existing data
โ
Created 5 users
โ
Created 15 venues in Lucknow
โ
Created 12 reviews
โ
Created 30 sample bookings
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ PlaySphere seed complete!
๐ Demo Credentials:
Admin: admin@playsphere.in / admin123
Venue Owner: rahul@playsphere.in / password123
Player: arjun@playsphere.in / password123
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Open a new terminal:
cd frontend
npm install
npm run dev # Starts Vite dev server on port 5173Navigate to http://localhost:5173 ๐
| Role | Password | Access | |
|---|---|---|---|
| ๐ Player | arjun@playsphere.in |
password123 |
Explore, Book, AI Chat, Reviews |
| ๐ข Venue Owner | rahul@playsphere.in |
password123 |
Dashboard, Analytics, Pricing |
| ๐ก๏ธ Admin | admin@playsphere.in |
admin123 |
Full platform access |
The database ships with 15 premium sports venues across Lucknow:
| # | Venue | Area | Sports | Rating |
|---|---|---|---|---|
| 1 | Gomti Nagar Sports Arena | Gomti Nagar | Badminton, Table Tennis, Squash | โญ 4.7 |
| 2 | Hazratganj Cricket Ground | Hazratganj | Cricket | โญ 4.5 |
| 3 | Indira Nagar Football Hub | Indira Nagar | Football, Volleyball | โญ 4.8 |
| 4 | Aliganj Aquatic Centre | Aliganj | Swimming | โญ 4.6 |
| 5 | Chinhat Tennis Club | Chinhat | Tennis, Badminton | โญ 4.4 |
| 6 | Jankipuram Fitness Hub | Jankipuram | Gym, Basketball | โญ 4.3 |
| 7 | Mahanagar Multi-Sports | Mahanagar | Badminton, TT, Volleyball | โญ 4.5 |
| 8 | Rajajipuram Cricket Academy | Rajajipuram | Cricket | โญ 4.6 |
| 9 | Eldeco Badminton Academy | Eldeco | Badminton | โญ 4.9 |
| 10 | Vikas Nagar Arena | Vikas Nagar | Football, Basketball | โญ 4.2 |
| 11 | Sahara Sports Village | Sahara | Cricket, Football, Squash, Tennis | โญ 4.7 |
| 12 | Kapoorthala Racket Club | Kapoorthala | Squash, TT, Badminton | โญ 4.4 |
| 13 | Aashiana Swimming & Wellness | Aashiana | Swimming, Gym | โญ 4.5 |
| 14 | Aminabad Basketball Court | Aminabad | Basketball | โญ 4.1 |
| 15 | Cantt Sports Ground | Cantt | Cricket, Football | โญ 4.6 |
graph TD
subgraph LUCKNOW["๐บ๏ธ Lucknow โ 15 Venues Across 15 Areas"]
GN["Gomti Nagar<br/>๐ธ๐๐ช"]
HG["Hazratganj<br/>๐"]
IN["Indira Nagar<br/>โฝ๐"]
AL["Aliganj<br/>๐"]
CH["Chinhat<br/>๐พ๐ธ"]
JK["Jankipuram<br/>๐๏ธ๐"]
MH["Mahanagar<br/>๐ธ๐๐"]
RJ["Rajajipuram<br/>๐"]
EL["Eldeco<br/>๐ธ"]
VN["Vikas Nagar<br/>โฝ๐"]
SH["Sahara<br/>๐โฝ๐ช๐พ"]
KP["Kapoorthala<br/>๐ช๐๐ธ"]
AA["Aashiana<br/>๐๐๏ธ"]
AM["Aminabad<br/>๐"]
CT["Cantt<br/>๐โฝ"]
end
style LUCKNOW fill:#0d2137,stroke:#06b6d4,color:#67e8f9
The Owner Dashboard provides comprehensive business intelligence through interactive visualizations:
graph LR
subgraph Dashboard["๐ Dashboard Components"]
KPI["๐ KPI Cards<br/>6 metrics with sparklines"]
BAR["๐ SVG Bar Chart<br/>Monthly revenue trend"]
DONUT["๐ฉ Donut Chart<br/>Sport distribution"]
TABLE["๐ Booking Table<br/>Recent activity feed"]
AI_INS["๐ค AI Insights<br/>Actionable recommendations"]
PRICING["๐ฐ Pricing Matrix<br/>Peak/off-peak/weekend"]
end
KPI --> BAR
KPI --> DONUT
BAR --> TABLE
DONUT --> AI_INS
AI_INS --> PRICING
style Dashboard fill:#1a1040,stroke:#8b5cf6,color:#c4b5fd
| Component | Description |
|---|---|
| KPI Stat Cards | My Arenas, Total Revenue (with sparkline), Total Bookings, AI Booked %, Avg Rating, Today's Bookings |
| SVG Bar Chart | Gradient bars with grid lines, value labels, month labels, booking counts โ zero external dependencies |
| Donut Chart | Sport-wise booking distribution with colored segments, glow filters, legend with counts and percentages |
| Tab Navigation | Overview / Revenue / Sports / AI Pricing โ organized content sections |
| AI Insights | Weekend surge alerts, peak hour warnings, off-peak opportunities, AI adoption gap tracking |
| Revenue Breakdown | Monthly table with per-booking averages, revenue share bars, MoM growth indicators |
| Booking Feed | Recent bookings with user info, venue, sport badge, date/time, status, amount, and AI/Manual source badge |
| Feature | Description |
|---|---|
| ๐ฑ React Native App | Cross-platform mobile app with push notifications |
| ๐ณ Razorpay Payments | Integrated payment gateway with auto-refunds |
| ๐ค LLM Integration | OpenAI/Gemini-powered natural language understanding |
| ๐ฅ AI Matchmaking | Find nearby players for team sports |
| ๐ Tournament Engine | Auto-generate brackets, fixtures, and leaderboards |
| ๐ Advanced Analytics | Predictive demand modeling with ML pipelines |
| ๐ฌ WhatsApp Bot | Book venues via WhatsApp conversational interface |
| ๐ Voice Assistant | Speech-to-text venue search and booking |
| ๐ฆ๏ธ Weather Integration | Auto-apply rainy day discounts using live weather APIs |
| ๐ Multi-City Expansion | Scale beyond Lucknow to Delhi, Bangalore, Mumbai |
graph LR
subgraph Team["๐จโ๐ป PlaySphere Team"]
SS["๐ Suryansh Singh<br/>Team Lead ยท Architecture"]
SJ["โ๏ธ Shivam Jaiswal<br/>Backend"]
SV["๐จ Suyash Verma<br/>Frontend"]
VP["๐ค Vikas Patel<br/>AI/ML"]
end
SS -->|"System Design"| SJ
SS -->|"UI/UX Direction"| SV
SS -->|"AI Pipeline"| VP
SJ -->|"REST APIs"| SV
VP -->|"Agent Routes"| SJ
style SS fill:#0d2137,stroke:#06b6d4,color:#67e8f9
style SJ fill:#001a0e,stroke:#10b981,color:#6ee7b7
style SV fill:#1a1040,stroke:#8b5cf6,color:#c4b5fd
style VP fill:#1a0d00,stroke:#f59e0b,color:#fcd34d
The production version of the app is live and fully accessible at:
- โก Primary Frontend (Vercel): https://aiplaysphere.vercel.app/
- โก Mirror Frontend (Netlify): https://aiplaysphere.netlify.app/
- ๐ Live Backend (Render): https://playsphere-y1sa.onrender.com
The React frontend can be deployed to Vercel or Netlify with SPA routing support:
cd frontend
npm run build # Produces dist/ folderVercel: Connect your GitHub repo โ Set root directory to frontend โ Framework: Vite โ Deploy.
Netlify: Connect your GitHub repo โ Set build directory to frontend/dist โ Build command: cd frontend && npm run build.
โ ๏ธ Set the environment variableVITE_API_URLto your Render backend URL (e.g.https://playsphere-y1sa.onrender.com).
Deploy the Express API server to Render:
- Create a new Web Service on Render
- Connect your GitHub repository
- Set Root Directory to
backend - Set Build Command to
npm install - Set Start Command to
node server.js - Add Environment Variables:
PORT=5000
JWT_SECRET=your_secure_secret_key
JWT_EXPIRE=30d
CLIENT_URL=https://your-frontend-url.vercel.app
FIREBASE_PROJECT_ID= # Optional
FIREBASE_CLIENT_EMAIL= # Optional
FIREBASE_PRIVATE_KEY= # Optionalgraph TB
subgraph Production["๐ Production Deployment"]
subgraph FE_HOST["Frontend Host"]
VERCEL["โฒ Vercel / Netlify<br/>React + Vite SPA"]
end
subgraph BE_HOST["Backend Host"]
RENDER["๐ Render<br/>Express + Socket.IO"]
end
subgraph DB_HOST["Database"]
FIRE["๐ฅ Firebase Firestore<br/>Cloud NoSQL"]
LOCAL["๐ localDb.json<br/>Dev Fallback"]
end
end
VERCEL -->|"HTTPS API Calls"| RENDER
VERCEL -->|"WebSocket"| RENDER
RENDER -->|"Firebase Admin SDK"| FIRE
RENDER -.->|"If no credentials"| LOCAL
style VERCEL fill:#0d2137,stroke:#06b6d4,color:#67e8f9
style RENDER fill:#001a0e,stroke:#10b981,color:#6ee7b7
style FIRE fill:#1a0d00,stroke:#f59e0b,color:#fcd34d
style LOCAL fill:#1a1040,stroke:#8b5cf6,color:#c4b5fd
- Fork the repository
- Create your feature branch (
git checkout -b feature/ai-matchmaking) - Commit changes (
git commit -m 'Add AI matchmaking agent') - Push to the branch (
git push origin feature/ai-matchmaking) - Open a Pull Request
Distributed under the MIT License. See LICENSE for details.
๐๏ธ PlaySphere โ Where AI Meets the Arena
Built with โค๏ธ by Team PlaySphere for the Agentic Premier League Hackathon 2026
Suryansh Singh ยท Shivam Jaiswal ยท Suyash Verma ยท Vikas Patel
React 18 ยท Node.js ยท Firebase ยท Socket.IO ยท Custom AI Agents ยท SVG Charts ยท Glassmorphism UI
โญ Star this repo if you find it useful! โญ