Skip to content

Tensor-Amrita-Coimbatore/Mission-to-Mars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

🚀 AI Arena:Mission-to-Mars

AI Arena is a competitive, multi-round, elimination-style web game where teams of players race to solve logic puzzles presented by a sentient Mars colony AI. This project demonstrates a full-stack application built with a Python/FastAPI backend, a React frontend, and a cloud-hosted MongoDB database, featuring real-time state management and dynamic content generation via the Groq LLM API.


✨ Key Features

  • Real-time Multiplayer Lobby: Players can join a lobby and see other connected players in real-time.
  • Team-Based Gameplay: An admin can dynamically create teams from the lobby to start the game.
  • Dynamic Round System: A multi-round, elimination-style game where the lowest-scoring team is removed after each round.
  • Live Game Dashboard: A main screen for players and admins to view a live leaderboard and a round countdown timer.
  • AI-Powered Hints: Players can request hints for challenging subtasks, which are dynamically generated by the Groq LLM.
  • AI-Generated Reports: At the end of the game, players receive a personalized "After-Action Report" narrated by the LLM, summarizing their performance.
  • Full Admin Control Panel: A dedicated admin view to manage the entire game flow: resetting the game, creating teams, and starting rounds.
  • Role-Based Access: A clear distinction between Player and Admin roles, with protected routes and conditional UI elements.

📸 Videolink

https://youtu.be/UeJvo70lnJw?feature=shared


🛠️ Technology Stack

Backend (Command & Control)

  • Framework: FastAPI
  • Server: Uvicorn with Gunicorn for production
  • Database: MongoDB (hosted on MongoDB Atlas)
  • AI / LLM: Groq API (Llama 3)
  • Libraries: Pydantic, PyMongo, python-dotenv

Frontend (Visual Interface)

  • Framework: React.js
  • Styling: Tailwind CSS
  • State Management: React Context API for global player state
  • Routing: React Router
  • Animations: Framer Motion

Deployment

  • Frontend: Vercel
  • Backend: Render
  • Database: MongoDB Atlas

⚙️ Getting Started: Local Setup

Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js and npm/yarn
  • Python 3.10+ and pip
  • MongoDB installed locally or a free MongoDB Atlas account
  • A Groq API Key

1. Backend Setup

# Navigate to the backend directory
cd backend

# Create and activate a virtual environment
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

# Install the required packages
pip install -r requirements.txt

# Create a .env file and add your credentials
# (rename .env.example to .env and fill it out)

backend/.env file:

MONGO_URI="your_mongodb_connection_string"
GROQ_API_KEY="your_groq_api_key"
# Run the backend server
uvicorn main:app --reload

The backend will be running at http://127.0.0.1:8000.

2. Frontend Setup

# Navigate to the frontend directory
cd frontend-2.0

# Install dependencies
npm install

# Create a .env file for the frontend

frontend-2.0/.env file:

REACT_APP_API_URL="http://127.0.0.1:8000"
# Run the frontend development server
npm start

The frontend will be running at http://localhost:3000.


🌐 Deployment Workflow (Future)

This application is configured for a seamless deployment process:

  1. Database: A free cluster is created on MongoDB Atlas.
  2. Backend: The backend folder is deployed as a Web Service on Render. The MONGO_URI and GROQ_API_KEY are set as environment variables.
  3. Frontend: The frontend-2.0 folder is deployed on Vercel. The REACT_APP_API_URL environment variable is set to the live URL of the Render backend.
  4. CORS: The live Vercel URL is added to the origins list in the FastAPI backend to allow communication.

🔮 Future Enhancements

  • WebSocket Integration: Replace HTTP polling with WebSockets for instant, real-time updates.
  • Persistent Player Profiles: Allow users to create accounts and track their game history and stats.
  • Expanded Content: Add more scenarios and more complex, varied subtask types.
  • Time-Based Scoring: Introduce bonuses for finishing rounds quickly.

Made with ❤️ by Tensor Club R&D

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors