Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ManagerX basiert auf einem modernen und erweiterbaren Tech-Stack:
- **Core**: Python 3.10+ & [Pycord](https://pycord.dev)
- **Framework**: [Ezcord](https://github.com/ezcord-dev/ezcord) für schnelles Cog-Management
- **UI Components**: Discord Container & DesignerView (v2)
- **Database**: SQLite3 mit optimierter Index-Struktur
- **Database**: MariaDB (MxMariaDB) für hohe Skalierbarkeit und Performance
- **API/Dashboard**: FastAPI & React/Vite (TailwindCSS)

<br>
Expand Down
43 changes: 43 additions & 0 deletions docs/source/dev_guide/architecture.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
==========================
🏗️ System Architecture
==========================

ManagerX is built with a modern, decoupled architecture to ensure scalability and ease of development.

1. High-Level Overview
======================

The system consists of three main components:

- **Discord Bot (The Core):** Written in Python using `py-cord`. It handles all interactions with Discord servers, manages the local/MariaDB database, and executes commands.
- **REST API (The Bridge):** A FastAPI server integrated directly into the bot process. It provides live data (Uptime, Stats, Guild settings) to the web dashboard.
- **Web Dashboard (The Interface):** A React-based Single Page Application (SPA) that communicates with the API to provide a visual configuration interface.

2. Component Breakdown
======================

Bot Core
--------
- **Cogs (Plugins):** Features are modularly organized in ``src/bot/cogs``. This allows for easy hot-reloading and independent development of features.
- **Database Layer:** Supports both SQLite (for local dev) and MariaDB (for production).
- **EzCord:** A framework wrapper that simplifies UI components (Embeds, Buttons) and provides automatic logging.

API (FastAPI)
-------------
- **Real-time Data:** Uses the bot's internal loop to fetch live shard status and server metrics.
- **Authentication:** Uses Discord OAuth2 to verify user identity and permissions.

Frontend (React)
----------------
- **Framework:** Vite for fast builds and HMR.
- **Styling:** Tailwind CSS with a "Glassmorphism" design system.
- **Components:** Radix UI for accessible primitives and Framer Motion for smooth animations.

3. Execution Flow
=================

1. **User Action:** A user clicks "Save" on the Dashboard.
2. **Frontend:** Sends a POST request to the API with the new configuration.
3. **API:** Validates the authentication token and role permissions.
4. **Bot:** Updates the internal database and applies changes (e.g., updating a welcome message or clearing the warning list).
5. **Discord:** The next time a member joins, the bot retrieves the updated data from the database and executes the new logic.
36 changes: 24 additions & 12 deletions docs/source/dev_guide/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
Welcome to the Developer Guide for ManagerX.
==========================================================

learn about the API, the Dashboard, the Bot and more.

.. toctree::
:maxdepth: 2
:caption: API:

Getting Started <api/getting_started>
Public Endpoints <api/publics_endpoints>

===========================
👨‍💻 Developer Guide
===========================

Welcome to the development section of ManagerX. This guide is intended for developers who want to self-host the bot, extend its functionality, or contribute to the core codebase.

.. toctree::
:maxdepth: 2
:caption: Content:

architecture
installation
api/index
contributing/index

---

💡 Core Technology Stack
========================

- **Backend:** Python 3.11+ using `py-cord` and `ezcord`.
- **API:** FastAPI with Uvicorn.
- **Frontend:** React + TypeScript + Vite + Tailwind CSS.
- **Database:** MariaDB (Recommended) or SQLite.
79 changes: 79 additions & 0 deletions docs/source/dev_guide/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
=========================
💻 Installation Guide
=========================

This guide explains how to set up a self-hosted instance of ManagerX.

Prerequisites
=============

- **Python:** 3.11 or higher.
- **Node.js:** v18 or higher (for the frontend).
- **Database:** MariaDB (Recommended) or SQLite.
- **Discord Developer Account:** To create your bot application.

1. Clone the Repository
=======================

.. code-block:: bash

git clone https://github.com/ManagerX-Development/ManagerX.git
cd ManagerX

2. Backend Setup
================

1. Create a virtual environment:

.. code-block:: bash

python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate

2. Install dependencies:

.. code-block:: bash

pip install -r requirements/base.txt

3. Configure environment variables:
Copy ``config/.env.example`` to ``config/.env`` and fill in your:
- ``TOKEN`` (Discord Bot Token)
- ``DB_TYPE`` (mariadb or sqlite)
- ``DB_HOST``, ``DB_USER``, etc.

3. Frontend Setup
=================

1. Install Node dependencies:

.. code-block:: bash

npm install

2. Build the production bundle:

.. code-block:: bash

npm run build

4. Starting the Bot
===================

Run the main entry point:

.. code-block:: bash

python main.py

The bot will start, and the FastAPI webserver for the dashboard will run on the configured port (default: 8000).

---

🚀 Production Deployment
========================

For production, we recommend using:
- **PM2** or **Systemd** to keep the bot process alive.
- **Nginx** or **Traefik** as a reverse proxy for the API and static frontend files.
- **MariaDB** for reliable data storage.
Loading
Loading