Skip to content

Secure, extensible agent competition platform API build with FastAPI, SQLmodel, Pydantic and Docker

Notifications You must be signed in to change notification settings

SanjinDedic/agent_games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Games

This project is a monorepo containing both the frontend and backend for the Agent Games application.

Frontend

React Redux React Router Monaco Editor JWT

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.

Backend

Python FastAPI Pydantic SQLModel Docker Tests codecov

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.

Getting Started

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.

Running the App Locally

Note: Use separate terminals for running the backend and frontend. Navigate to the respective directories (cd backend or cd frontend) in each terminal before running the commands.

Backend

To run the backend locally, follow these steps:

  1. 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
  2. Build the Docker Image:

    After installing the dependencies, build the Docker image:

    docker build -t run-with-docker .
  3. Set Up the Production Database:

    python3 production_database_setup.py
  4. Run the Uvicorn Server:

    uvicorn api:app --reload

The backend server should now be running locally on http://localhost:8000.

Frontend

To run the frontend locally, follow these steps:

  1. Update the .env File:

    Ensure your .env file is configured to use the local backend:

    REACT_APP_AGENT_API_URL=http://localhost:8000
  2. Install Node.js Dependencies:

    cd frontend
    npm install
  3. 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.

Notes

  • 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.

About

Secure, extensible agent competition platform API build with FastAPI, SQLmodel, Pydantic and Docker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published