This project is a monorepo containing both the frontend and backend for the Agent Games application.
The frontend is built with React and Redux, offering a user interface for game submission, league management, and result viewing. It features code editing capabilities and responsive design.
For more details, see the Frontend README.
The backend is powered by FastAPI, handling game logic, user authentication, and data management. It uses SQLModel for database interactions, Pydantic for data validation, and includes Docker integration for simulations. SQLite is used for data storage.
For more information, check out the Backend README.
For instructions on how to set up and run the project locally, please refer to the respective README files in the frontend and backend directories.
Note: Use separate terminals for running the backend and frontend. Navigate to the respective directories (
cd backend
orcd frontend
) in each terminal before running the commands.
To run the backend locally, follow these steps:
-
Create a Virtual Environment and Install Dependencies:
cd backend python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` pip install -r requirements.txt
-
Build the Docker Image:
After installing the dependencies, build the Docker image:
docker build -t run-with-docker .
-
Set Up the Production Database:
python3 production_database_setup.py
-
Run the Uvicorn Server:
uvicorn api:app --reload
The backend server should now be running locally on http://localhost:8000
.
To run the frontend locally, follow these steps:
-
Update the
.env
File:Ensure your
.env
file is configured to use the local backend:REACT_APP_AGENT_API_URL=http://localhost:8000
-
Install Node.js Dependencies:
cd frontend npm install
-
Run the Application:
If you encounter any issues, you may need to clear the npm cache and remove
node_modules
:npm cache clean --force rm -rf node_modules npm install
Then start the application:
npm start
The frontend should now be running locally and accessible via http://localhost:3000
.
- Make sure you have Python, Docker, Node.js, and npm installed on your machine.
- The commands for setting up the backend and frontend assume you're using a Unix-based system (Linux or macOS). Windows commands may differ slightly, especially for activating the virtual environment.
- The backend server runs on port 8000 by default, and the frontend runs on port 3000.
- Use different terminals for running backend and frontend processes to avoid command conflicts.