This repository contains a MySQL database and a FastAPI API for the Discord Bot Detector. You can use Docker Compose to set up your local development environment with ease.
Before you begin, ensure that you have the following installed on your machine:
- Docker: Installation Guide
- Docker Compose: Installation Guide
- Python: Installation Guide
- Git: Installation Guide
To set up your local development environment, follow these steps:
-
Clone this repository to your local machine
-
Configure the environment variables for the API:
- Rename the file
src/.env-example
tosrc/.env
- Rename the file
-
Set up Python and install dependencies:
- Create a virtual environment:
python -m venv .venv
- if you are using vscode, you should see a popup after this command, you should set the .venv as your default interpreter for this workspace.
- Activate the virtual environment:
- On Windows:
.venv\Scripts\activate
- On macOS/Linux:
source .venv/bin/activate
- Upgrade pip:
python -m pip install --upgrade pip
- Install the required packages:
pip install -r src/requirements.txt
- Create a virtual environment:
-
Start the development environment using Docker Compose:
docker-compose up --build
Note: The
--build
flag is used to ensure that any changes are incorporated into the container. -
Wait until the MySQL server is ready to accept connections.
- You will see a message in the terminal that says
*/usr/sbin/mysqld: ready for connections.*
. - This may take a few moments.
- You will see a message in the terminal that says
-
Test the development environment by accessing the following URL in your web browser: http://localhost:3000/docs.
- Use the bearer token provided in the
src/.env
file for authentication.
- Use the bearer token provided in the