An AI-powered stadium discovery, event booking, ticketing, and management platform with a context-aware stadium assistant.
StadiumGenie-AI is a full-stack web application designed to simplify the stadium and live-event experience for visitors while providing management capabilities for administrators.
The platform combines stadium discovery, event exploration, booking, simulated payments, QR-based ticketing, ticket verification, and administration with a context-aware AI assistant powered by Google Gemini.
The AI assistant can use the user's current stadium or event context to provide more relevant guidance about venues, events, facilities, accessibility, transportation, navigation, ticket assistance, and stadium-related queries.
Chosen Vertical: Smart Stadium & Event Experience
StadiumGenie-AI focuses on improving the experience of people attending stadium events by bringing multiple parts of the visitor journey into a single platform.
The solution is designed around two primary personas:
A visitor can:
- Discover stadiums
- Browse upcoming events
- View detailed stadium and event information
- Search and filter available options
- Register and authenticate securely
- Book an event
- Complete a simulated payment
- Receive a digital ticket
- Access QR-based ticket information
- Verify tickets
- Ask the AI assistant stadium and event-related questions
An administrator can access protected management functionality for:
- Stadium management
- Event management
- Booking oversight
- User management
- Administrative dashboards
Attending a large stadium event often requires users to interact with fragmented sources of information.
A visitor may need to separately search for:
- Stadium information
- Event schedules
- Ticket availability
- Venue facilities
- Accessibility information
- Transportation options
- Stadium rules
- Booking details
- Ticket verification
Generic AI assistants can answer broad questions but often lack the context of the specific stadium or event a visitor is currently viewing.
StadiumGenie-AI addresses this problem by combining the event journey with a context-aware AI assistant in one application.
Instead of functioning only as a generic chatbot, the assistant can receive stadium and event context from the application and use data retrieved from MongoDB to construct a more relevant prompt for the generative AI model.
StadiumGenie-AI combines three major capabilities:
Users can browse stadiums and events through a React-based interface and access detailed information about each venue or event.
Authenticated users can move through a booking workflow, complete a simulated payment, and receive ticket information with QR generation.
The integrated AI assistant uses Google Gemini and can be supplied with the stadium or event currently being viewed.
The backend retrieves relevant information from MongoDB and includes that context when communicating with the AI model.
This enables the assistant to provide responses that are better grounded in the application's available stadium and event information.
The AI assistant is a core part of StadiumGenie-AI.
It is designed to behave as a digital stadium concierge rather than a disconnected general-purpose chatbot.
When available, the application passes context such as:
stadiumIdeventId
The backend can then retrieve relevant stadium or event data from MongoDB.
- Stadium name
- City
- State or region
- Country
- Address
- Seating capacity
- Description
- Facilities
- Amenities
- Supported sports
- Geographic coordinates
- Event title
- Sport
- Organizer
- Description
- Start time
- End time
- Event status
- Available seats
- Ticket price
- Venue information
- Venue facilities
- Venue amenities
This information is used to construct contextual instructions for the Gemini model.
The assistant follows a context-first workflow.
User opens StadiumGenie-AI
โ
โผ
User navigates to a stadium or event
โ
โผ
Application detects available context
(stadiumId / eventId)
โ
โผ
User sends a question to StadiumGenie AI
โ
โผ
Backend receives the request
โ
โโโ Stadium context available?
โ โโโ Retrieve stadium data from MongoDB
โ
โโโ Event context available?
โ โโโ Retrieve event + venue data from MongoDB
โ
โผ
Construct contextual AI instructions
โ
โผ
Send request to Google Gemini
โ
โผ
Return relevant response to the user
This approach allows the same assistant to adapt its response according to where the user is in the application.
If contextual data cannot be retrieved, the service is designed to handle the failure gracefully rather than allowing a database context lookup to crash the assistant workflow.
The StadiumGenie assistant is designed to help with questions such as:
- How do I navigate to my seating section?
- What accessibility services are available?
- How can I reach the stadium using public transport?
- What facilities or amenities are available?
- Where can I find food courts or washrooms?
- What items may be restricted inside the stadium?
- How can I verify my ticket?
- What information is available about this event?
- What is the seating capacity of this stadium?
The frontend also provides quick assistance categories to make common stadium questions easier to access.
- Browse available stadiums
- Search stadium information
- Filter stadium listings
- View detailed stadium pages
- Display facilities and amenities
- Access venue-specific information
- Browse events
- Search and filter events
- View detailed event information
- Access venue information associated with events
- View ticket-related event details
- User registration
- User login
- JWT-based authentication
- Protected application routes
- Authentication middleware
- Role-aware authorization
- Authenticated booking workflow
- Booking management through backend APIs
- User-specific booking operations
- Integration with payment and ticket workflows
The project uses a simulated payment workflow for demonstration purposes.
Supported application logic includes simulated payment processing without requiring users to provide real payment credentials to a third-party gateway.
Payment references are generated by the backend and payment records are stored in MongoDB.
For demo reliability:
- Digital payment methods can be simulated as successful
- Cash payments can remain pending while reserving the booking
- Successful payment can confirm the associated booking
Note: This is a demonstration payment system and should not be treated as a production financial transaction system.
- Ticket generation following eligible payment flows
- QR-based ticket functionality
- Ticket retrieval
- Ticket verification route
- Digital ticket workflow integrated with bookings
The application includes a public ticket verification route:
/verify-ticket/:ticketNumber
This allows ticket information to be verified using its ticket identifier.
Role-protected administration functionality includes pages for:
- Dashboard overview
- Stadium management
- Add stadium
- Edit stadium
- Event management
- Add event
- Edit event
- Booking management
- User management
Admin routes are protected separately from normal authenticated user routes.
- Google Gemini integration
- Context-aware stadium assistance
- Event-aware assistance
- MongoDB-backed context retrieval
- Quick question categories
- Multilingual-oriented frontend assistant interface
- Graceful handling when AI configuration or contextual information is unavailable
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React + Vite Client โ
โ โ
โ Stadiums โ Events โ Booking โ Admin โ
โ Tickets โ Profile โ AI Chat Widget โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โ
โ REST API
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Node.js + Express API โ
โ โ
โ Routes โ Controllers โ Services โ
โ โ โ
โ Models โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ MongoDB โ โ Google Gemini โ
โ + Mongoose โ โ API โ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
Discover Stadium / Event
โ
โผ
View Details
โ
โโโโโโโโโโโโโโโโบ Ask StadiumGenie AI
โ โ
โ โผ
โ Context-aware response
โ
โผ
Authenticate
โ
โผ
Create Booking
โ
โผ
Simulated Payment
โ
โผ
Booking Confirmation
โ
โผ
Ticket Generation
โ
โผ
QR / Ticket Verification
- React
- Vite
- React Router
- JavaScript
- Component-based UI architecture
- Context API for authentication state
- Node.js
- Express
- ES Modules
- REST API architecture
- MongoDB
- Mongoose
- Google Gemini
@google/generative-ai
- JSON Web Tokens (JWT)
- bcrypt
- Helmet
- CORS
- Express Rate Limit
- express-validator
- Morgan
- Cookie Parser
- Nodemailer
- QR Code generation
- Swagger UI
StadiumGenie-AI/
โ
โโโ client/
โ โโโ src/
โ โ โโโ api/
โ โ โ โโโ axios.js
โ โ โ
โ โ โโโ assets/
โ โ โ
โ โ โโโ components/
โ โ โ โโโ common/
โ โ โ โ โโโ Button.jsx
โ โ โ โ โโโ ChatWidget.jsx
โ โ โ โ โโโ EmptyState.jsx
โ โ โ โ โโโ LoadingSpinner.jsx
โ โ โ โ โโโ Pagination.jsx
โ โ โ โ
โ โ โ โโโ event/
โ โ โ โโโ layout/
โ โ โ โโโ stadium/
โ โ โ โโโ ui/
โ โ โ
โ โ โโโ config/
โ โ โโโ context/
โ โ โ โโโ AuthContext.jsx
โ โ โ
โ โ โโโ hooks/
โ โ โโโ layouts/
โ โ โ โโโ AdminLayout.jsx
โ โ โ โโโ AuthLayout.jsx
โ โ โ โโโ MainLayout.jsx
โ โ โ
โ โ โโโ pages/
โ โ โ โโโ Home.jsx
โ โ โ โโโ Login.jsx
โ โ โ โโโ Register.jsx
โ โ โ โโโ Stadiums.jsx
โ โ โ โโโ StadiumDetails.jsx
โ โ โ โโโ Events.jsx
โ โ โ โโโ EventDetails.jsx
โ โ โ โโโ Booking.jsx
โ โ โ โโโ Payment.jsx
โ โ โ โโโ Tickets.jsx
โ โ โ โโโ VerifyTicket.jsx
โ โ โ โโโ Profile.jsx
โ โ โ โโโ Admin*.jsx
โ โ โ
โ โ โโโ routes/
โ โ โ โโโ AppRouter.jsx
โ โ โ โโโ ProtectedRoute.jsx
โ โ โ โโโ AdminRoute.jsx
โ โ โ
โ โ โโโ services/
โ โ โ โโโ admin.service.js
โ โ โ โโโ ai.service.js
โ โ โ โโโ auth.service.js
โ โ โ โโโ booking.service.js
โ โ โ โโโ event.service.js
โ โ โ โโโ payment.service.js
โ โ โ โโโ stadium.service.js
โ โ โ โโโ ticket.service.js
โ โ โ
โ โ โโโ App.jsx
โ โ โโโ main.jsx
โ โ
โ โโโ package.json
โ
โโโ server/
โ โโโ config/
โ โโโ controllers/
โ โโโ middleware/
โ โโโ models/
โ โโโ routes/
โ โ โโโ admin.routes.js
โ โ โโโ ai.routes.js
โ โ โโโ auth.routes.js
โ โ โโโ booking.routes.js
โ โ โโโ event.routes.js
โ โ โโโ payment.routes.js
โ โ โโโ stadium.routes.js
โ โ โโโ ticket.routes.js
โ โ
โ โโโ services/
โ โ โโโ admin.service.js
โ โ โโโ ai.service.js
โ โ โโโ auth.service.js
โ โ โโโ booking.service.js
โ โ โโโ email.service.js
โ โ โโโ event.service.js
โ โ โโโ payment.service.js
โ โ โโโ stadium.service.js
โ โ โโโ ticket.service.js
โ โ
โ โโโ validators/
โ โโโ seeds/
โ โโโ scripts/
โ โโโ app.js
โ โโโ index.js
โ โโโ swagger.js
โ โโโ package.json
โ
โโโ docs/
โโโ scripts/
โโโ .env.example
โโโ .gitignore
โโโ IMPLEMENTATION_PLAN.md
โโโ README.md
The backend exposes REST API modules under /api/v1.
| Module | Endpoint |
|---|---|
| Authentication | /api/v1/auth |
| Stadiums | /api/v1/stadiums |
| Events | /api/v1/events |
| Bookings | /api/v1/bookings |
| Payments | /api/v1/payments |
| Tickets | /api/v1/tickets |
| Administration | /api/v1/admin |
| AI Assistant | /api/v1/ai |
Additional endpoints:
GET /health
API documentation is configured through Swagger UI when available.
/api-docs
StadiumGenie-AI uses JWT-based authentication.
Protected API requests use a bearer token:
Authorization: Bearer <token>
The application separates authorization into different levels.
Examples include:
- Home
- Stadium browsing
- Stadium details
- Event browsing
- Event details
- Ticket verification
- Privacy page
Protected functionality includes:
- Booking
- Payment
- Tickets
- User profile
Administrator-only functionality includes:
- Admin dashboard
- Stadium management
- Event management
- Booking management
- User management
The frontend uses protected route components, while the backend applies authentication and administrative authorization middleware.
The project includes several security-oriented practices:
- Password hashing using bcrypt
- JWT-based authentication
- Role-based access control
- Helmet security headers
- CORS middleware
- API rate limiting support
- Input validation using
express-validator - Protected administrator routes
- Environment-based secret configuration
- MongoDB ObjectId validation in service logic
- Booking ownership validation during payment processing
Sensitive values should always be stored in environment variables.
Never commit the following to GitHub:
.env
MongoDB credentials
GEMINI_API_KEY
JWT secrets
Email credentials
Private API keys
The repository should contain only .env.example files with placeholder values.
Create a .env file inside the server directory based on:
server/.env.example
Example configuration:
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>/<database>?retryWrites=true&w=majority
PORT=5000
GEMINI_API_KEY=your_gemini_api_key_here
GEMINI_MODEL=gemini-1.5-flashAdditional environment variables may be required depending on the authentication and email configuration used in your environment.
Never expose real credentials in the repository.
Install:
- Node.js 18+
- npm
- Git
You will also need:
- A MongoDB database, such as MongoDB Atlas
- A Google Gemini API key for AI functionality
git clone https://github.com/Rerishabh/StadiumGenie-AI.git
cd StadiumGenie-AIcd server
npm installCreate:
server/.env
Use server/.env.example as the template and provide your own credentials.
Development mode:
npm run devProduction-style start:
npm startBy default, the server is configured to use the port defined by the PORT environment variable.
Open another terminal:
cd client
npm installnpm run devOpen the local URL displayed by Vite in your browser.
StadiumGenie-AI uses MongoDB with Mongoose.
The application stores data related to core entities such as:
- Users
- Stadiums
- Events
- Bookings
- Payments
- Tickets
MongoDB Atlas can be used as the hosted database for development and deployment.
Developer seed scripts are available under:
server/seeds/
These can be used to populate development data when required.
The current implementation intentionally uses a simulated payment gateway.
This design was chosen to:
- Keep the demonstration self-contained
- Avoid processing real financial information
- Allow evaluators to test the complete booking workflow
- Demonstrate payment-to-ticket application logic without requiring paid third-party infrastructure
The backend generates unique payment references and maintains payment state in MongoDB.
This implementation is intended for demonstration and development purposes only.
A typical ticket workflow is:
User selects event
โ
User creates booking
โ
Payment is processed through simulator
โ
Booking status is updated
โ
Ticket is generated
โ
User accesses ticket
โ
QR / ticket number can be verified
Ticket creation is designed to integrate with eligible successful or confirmed payment flows.
The project contains development and verification scripts under:
server/scripts/
These include utilities for areas such as:
- AI endpoint testing
- Gemini connectivity testing
- Booking inspection
- Model inspection
- Image verification
Example scripts present in the project include:
test-ai-endpoint.js
test-gemini-live.js
check-bookings.js
check-model.js
verify-images.js
In addition to script-based checks, the application should be manually validated across the following workflows:
- User registration
- User login
- Stadium discovery
- Event discovery
- Stadium detail navigation
- Event detail navigation
- AI assistant interaction
- Booking creation
- Simulated payment
- Ticket generation
- Ticket verification
- Protected-route access
- Administrator authorization
StadiumGenie-AI aims to provide an accessible and understandable user experience through:
- Clear navigation
- Consistent application layouts
- Loading states
- Empty states
- Search and filtering
- Pagination components
- Dedicated accessibility-related AI quick questions
- Responsive component-oriented frontend design
- Separation of public, authenticated, and administrative workflows
Accessibility remains an area for continued improvement and should be validated with automated accessibility tools and keyboard/screen-reader testing before production use.
The project uses a modular architecture to separate responsibilities.
Backend logic is organized into:
Routes
โ
Controllers
โ
Services
โ
Models / Database
Frontend logic is separated into:
Pages
Components
Layouts
Routes
Services
Context
Hooks
Configuration
This separation helps make the application easier to:
- Maintain
- Debug
- Test
- Extend
- Refactor
Database queries use Mongoose, and contextual AI data is retrieved only when relevant stadium or event identifiers are available.
The current implementation makes the following assumptions:
- Users have internet connectivity to access the application and AI service.
- MongoDB is available through either MongoDB Atlas or another configured MongoDB instance.
- The Gemini API key is configured for AI functionality.
- AI responses may occasionally be inaccurate and should not replace official venue or emergency instructions.
- Payment functionality is simulated and does not represent real financial processing.
- Ticket generation and verification are demonstration implementations and would require additional anti-fraud controls for production use.
- Stadium and event information is dependent on the accuracy of data stored in the application database.
- Administrative users are trusted to manage stadium and event data responsibly.
- Production deployment would require stricter CORS configuration, monitoring, secret management, logging policies, and infrastructure hardening.
The project was structured with the challenge evaluation criteria in mind.
- Modular frontend and backend architecture
- Separation of routes, controllers, services, and models
- Reusable React components
- Dedicated service layers
- Clear separation between user and administrator functionality
- JWT authentication
- bcrypt password hashing
- Role-based access control
- Helmet
- CORS
- Input validation
- Environment-based secret handling
- Protected user and admin routes
- Context is retrieved only when relevant identifiers are available
- Mongoose is used for structured database interaction
- Service-oriented architecture reduces duplicated business logic
- AI context is assembled dynamically rather than hardcoding individual venue responses
- Development verification scripts
- AI endpoint testing utilities
- Gemini connectivity testing
- Booking and model inspection utilities
- Manual end-to-end workflow validation
- Clear navigation structure
- Loading and empty states
- Search/filter functionality
- Accessibility assistance as an AI use case
- Component-based frontend suitable for continued accessibility improvements
The application directly addresses the challenge expectation of building a:
- Smart assistant
- Dynamic assistant
- Context-aware system
- Logically adaptive experience
- Practical real-world solution
The AI assistant is integrated into the actual stadium and event experience rather than existing as an isolated chatbot.
Live Application: Deployment link will be added here
GitHub Repository:
https://github.com/Rerishabh/StadiumGenie-AI
The deployment URL will be updated after production deployment is completed.
Screenshots or demonstrations of the following can be added here:
- Home page
- Stadium discovery
- Stadium details
- Event discovery
- Event details
- StadiumGenie AI assistant
- Booking workflow
- Digital ticket
- Ticket verification
- Admin dashboard
Potential future enhancements include:
- Production payment gateway integration
- Real-time seat selection
- Interactive stadium maps
- Turn-by-turn indoor stadium navigation
- Live event updates
- Real-time crowd information
- Push notifications
- Parking availability integration
- Public transport integration
- Advanced AI recommendations
- Voice-based stadium assistant
- Improved multilingual support
- Enhanced accessibility auditing
- Automated unit and integration test suites
- CI/CD pipeline
- Production analytics and monitoring
- Stronger production ticket anti-fraud mechanisms
StadiumGenie AI responses are generated using artificial intelligence and may occasionally contain inaccurate or incomplete information.
For emergencies, security incidents, medical situations, or official stadium policies, users should always follow instructions from stadium staff, event organizers, emergency services, and official venue information.
Rishabh Paira
Developed as an AI-powered full-stack solution for the PromptWars coding challenge.
Discover. Book. Attend. Ask.
A smarter digital companion for the stadium experience.