/Bot-Detector-Core-Files

The server and processing files for the Bot Detector Plugin

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

The Bot Detector Plugin Core Files

GitHub GitHub top language Website Discord Twitter Follow

How does it work?

The project is broken into 7 separate pieces:

  • API ← You are here
  • Database
  • Hiscore scraper
  • Machine Learning (ML)
  • Discord Bot
  • Twitter Bot
  • Website
  • Plugin

The API (core files) links all components with the database.

image

How can I request a new feature or report a bug?

To request a new feature or report a bug you should open an issue on github. This way we can track new and interesting features recommended by users and developers of the plugin.

How can I join the plugin community?

If you would like to join our community, get involved in development, join our clan, participate in events, and more -- you can join us on our discord!

Can I get involved with development?

Yes. We're always welcoming new talent to the team. Many new faces like to join our discord to have a bit of guidance, however if that's not your cup of tea -- we've listed all of the steps necessary to start a development environment, and to help contribute to banning bots, below:

Core Files Setup

This guide will take you through the necessary steps to start contributing to the server side components. This will include the following repositories:

You can find other relevant repositories in our organization's github.

Install:

setup pre-commit

pre-commit is used to format your commit before committing it.

pre-commit --version
pre-commit install

pre-commit runs automatically when you commit, but if it doesn't work.

pre-commit run --all-files

Setup:

  1. Open a terminal cmd
  2. Navigate cd to where you want to save our code.
  3. The command below will Create a folder bot-detector with two sub folders remote & local & download the remote repositories in the remote folder.
    • To add the repositories in github desktop, select File on the top left than click Add local repository, and navigate to the cloned repositories.

Windows

mkdir bot-detector\remote bot-detector\local && cd bot-detector\remote
git clone https://github.com/Bot-detector/Bot-Detector-Core-Files.git
git clone https://github.com/Bot-detector/bot-detector-mysql.git

Linux

mkdir -p bot-detector/{remote,local}
git clone https://github.com/Bot-detector/Bot-Detector-Core-Files.git
git clone https://github.com/Bot-detector/bot-detector-mysql.git
  1. Now you can start the project, the command below will create the necessary docker containers, the first time might take a couple minutes. Make sure docker desktop is running!
cd Bot-Detector-Core-Files
docker-compose up --build
  1. In the terminal you will now see /usr/sbin/mysqld: ready for connections. this means the database is ready.
  2. Test the api's:
    • Core api: http://localhost:5000/

adding /docs at the end will give return the swagger documentation for the components /docs

What contributions are needed?

Features, and bugs are documented as issues in each repository. The project owners, review these, and select some as part of a github project.

Merging your changes

Changes to the project will have to submitted through the process of Merge Requests. Github has good documentation outlining this process and how it works, but to summarize it here briefly:

  1. Go to our repository and click Fork. image
  2. Clone your newly created repository to your local machine (into the bot-detector\local folder)
  3. Make your local changes. Test. Commit. And push to your own repo
  4. Open a Merge Request

The Development Workflow:

  1. Make sure you are working in your fork. This will be a copy of the repository.
    • In github desktop, in the top left, you can click Current repository, select the repository under your name.
  2. Create a branch, with a relative name, related to the issue.
    • In github desktop, on the top click branch or current branch than new branch.
  3. Publish your branch.
    • In github desktop, blue button on the middle of your screen Publish branch
  4. Create your commits (changes).
    • Small commits, defined scope are preferred.
    • Commit messages are desired.
  5. Push your commits.
  6. Create a Pull Request (PR)
    • In github desktop, blue button on the middle of your screen Create Pull Request
    • This will open your browser, make sure the base repository: Bot-detector/ and base: develop

What are the coding standards?

General

Code must be well-understood by those willing to review it. Please add comments where necessary, if you find that the method used may be difficult to decipher in the future.

Linting

Code must be linted prior to merging. We use black.

Tests

Tests must be written where applicable.

Naming conventions

  • File: snake_case
  • Class: camelCase
  • Function: snake_case
  • Variable: snake_case
  • Table: camelCase
  • Route: kebab-case

How is my code approved?

We have automated workflows setup for assigning approvers based on their knowledge in each repository - this person will be the owner of Issue/Merge Request. If we have not seen your pull request in a 24 hour period, please notify us via our our discord or on github.