FLATLINE is a retro/arcade style medical simulation/game that teaches its players to solve realistic patient cases by giving them the ability to run medical tests and select diagnoses.
- Frontend: JavaScript, React (Vite), HTML, Tailwind CSS
- Backend: Python, FastAPI, RestAPI, and Pydantic
- AI Engine: Google Gemini API (gemini-2.5-flash)
Before running the game, ensure you have the following installed:
- Node.js (v16 or higher)
- Python (v3.9 or higher)
- A Google Gemini API Key (Get one here)
Follow these steps to get the system running locally. You will need two terminal windows open: one for the backend and one for the frontend.
git clone https://github.com/Adiii581/FLATLINE.git
cd flatlineNavigate to the backend directory:
cd backendCreate a virtual environment:
# Windows
python -m venv venv
venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activateInstall dependencies:
pip install fastapi uvicorn google-generativeai python-dotenv pydanticConfigure Environment Variables:
Create a file named .env inside the backend folder and add your API key:
GEMINI_API_KEY=your_actual_api_key_here
Start the Server:
python -m uvicorn main:app --reloadThe backend should now be running at http://localhost:8000.
Navigate to the project root:
cd frontendInstall Node dependencies:
npm installStart the React Application:
npm run devOpen your browser and navigate to the Localhost URL shown in the terminal (usually http://localhost:5173).
- Select Difficulty: Choose Easy, Medium, or Hard.
- Review the Case: Read the patient's initial symptoms and vitals.
- Order Tests: Select diagnostic tests from the menu.
- Diagnose: Once you have enough information, submit a diagnosis. Be careful, if the diagnosis is wrong then the patient's condition worsens.
- Flatline: If the patient's vitality hits 0, the game is over.