docs: fix drift in docs/main.md
Fix web/ -> api/, add missing panel/modules/graphics sections, expand module and utility listings to match actual codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
53
docs/main.md
53
docs/main.md
@@ -14,14 +14,17 @@ aurora-bot-discord/
|
|||||||
│ ├── commands/ # Slash command implementations
|
│ ├── commands/ # Slash command implementations
|
||||||
│ ├── events/ # Discord event handlers
|
│ ├── events/ # Discord event handlers
|
||||||
│ ├── lib/ # Bot core logic (BotClient, utilities)
|
│ ├── lib/ # Bot core logic (BotClient, utilities)
|
||||||
|
│ ├── modules/ # Feature modules (views, interactions per domain)
|
||||||
|
│ ├── graphics/ # Canvas-based image generation
|
||||||
│ └── index.ts # Bot entry point
|
│ └── index.ts # Bot entry point
|
||||||
├── web/ # REST API server
|
├── api/ # REST API server
|
||||||
│ └── src/routes/ # API route handlers
|
│ └── src/routes/ # API route handlers
|
||||||
├── shared/ # Shared code between bot and web
|
├── shared/ # Shared code between bot and API
|
||||||
│ ├── db/ # Database schema and Drizzle ORM
|
│ ├── db/ # Database schema and Drizzle ORM
|
||||||
│ ├── lib/ # Utilities, config, logger, events
|
│ ├── lib/ # Utilities, config, errors, logger, events
|
||||||
│ ├── modules/ # Domain services (economy, admin, quest)
|
│ └── modules/ # Domain services (economy, admin, inventory, quest, etc.)
|
||||||
│ └── config/ # Configuration files
|
├── panel/ # React admin dashboard (Vite + Tailwind)
|
||||||
|
├── scripts/ # Helper scripts
|
||||||
├── docker-compose.yml # Docker services (app, db)
|
├── docker-compose.yml # Docker services (app, db)
|
||||||
└── package.json # Root package manifest
|
└── package.json # Root package manifest
|
||||||
```
|
```
|
||||||
@@ -38,17 +41,20 @@ The bot is built with Discord.js v14 and handles all Discord-related functionali
|
|||||||
- **Commands** (`bot/commands/`): Slash command implementations organized by category:
|
- **Commands** (`bot/commands/`): Slash command implementations organized by category:
|
||||||
- `admin/`: Server management commands (config, prune, warnings, notes)
|
- `admin/`: Server management commands (config, prune, warnings, notes)
|
||||||
- `economy/`: Economy commands (balance, daily, pay, trade, trivia)
|
- `economy/`: Economy commands (balance, daily, pay, trade, trivia)
|
||||||
|
- `feedback/`: Feedback commands
|
||||||
- `inventory/`: Item management commands
|
- `inventory/`: Item management commands
|
||||||
- `leveling/`: XP and level tracking
|
- `leveling/`: XP and level tracking
|
||||||
- `quest/`: Quest commands
|
- `quest/`: Quest commands
|
||||||
- `user/`: User profile commands
|
- `user/`: User profile commands
|
||||||
|
- **Modules** (`bot/modules/`): Feature modules with views and interaction handlers per domain (admin, economy, inventory, moderation, trade, trivia, etc.)
|
||||||
|
- **Graphics** (`bot/graphics/`): Canvas-based image generation (lootdrops, student IDs)
|
||||||
- **Events** (`bot/events/`): Discord event handlers:
|
- **Events** (`bot/events/`): Discord event handlers:
|
||||||
- `interactionCreate.ts`: Command interactions
|
- `interactionCreate.ts`: Command interactions
|
||||||
- `messageCreate.ts`: Message processing
|
- `messageCreate.ts`: Message processing
|
||||||
- `ready.ts`: Bot ready events
|
- `ready.ts`: Bot ready events
|
||||||
- `guildMemberAdd.ts`: New member handling
|
- `guildMemberAdd.ts`: New member handling
|
||||||
|
|
||||||
### 2. REST API (`web/`)
|
### 2. REST API (`api/`)
|
||||||
|
|
||||||
A headless REST API built with Bun's native HTTP server for bot administration and data access.
|
A headless REST API built with Bun's native HTTP server for bot administration and data access.
|
||||||
|
|
||||||
@@ -56,10 +62,15 @@ A headless REST API built with Bun's native HTTP server for bot administration a
|
|||||||
|
|
||||||
- **Stats** (`/api/stats`): Real-time bot metrics and statistics
|
- **Stats** (`/api/stats`): Real-time bot metrics and statistics
|
||||||
- **Settings** (`/api/settings`): Configuration management endpoints
|
- **Settings** (`/api/settings`): Configuration management endpoints
|
||||||
|
- **Guild Settings** (`/api/guild-settings`): Per-guild configuration
|
||||||
- **Users** (`/api/users`): User data and profiles
|
- **Users** (`/api/users`): User data and profiles
|
||||||
- **Items** (`/api/items`): Item catalog and management
|
- **Items** (`/api/items`): Item catalog and management
|
||||||
- **Quests** (`/api/quests`): Quest data and progress
|
- **Quests** (`/api/quests`): Quest data and progress
|
||||||
- **Economy** (`/api/transactions`): Economy and transaction data
|
- **Economy** (`/api/transactions`): Economy and transaction data
|
||||||
|
- **Moderation** (`/api/moderation`): Moderation case data
|
||||||
|
- **Classes** (`/api/classes`): RPG class data
|
||||||
|
- **Lootdrops** (`/api/lootdrops`): Lootdrop data
|
||||||
|
- **Health** (`/api/health`): Health check endpoint
|
||||||
|
|
||||||
**API Features:**
|
**API Features:**
|
||||||
|
|
||||||
@@ -69,9 +80,13 @@ A headless REST API built with Bun's native HTTP server for bot administration a
|
|||||||
- Real-time event streaming via WebSocket
|
- Real-time event streaming via WebSocket
|
||||||
- Zod validation for all requests
|
- Zod validation for all requests
|
||||||
|
|
||||||
### 3. Shared Core (`shared/`)
|
### 3. Admin Panel (`panel/`)
|
||||||
|
|
||||||
Shared code accessible by both bot and web applications.
|
A React-based admin dashboard built with Vite and Tailwind CSS for managing the bot through a web interface.
|
||||||
|
|
||||||
|
### 4. Shared Core (`shared/`)
|
||||||
|
|
||||||
|
Shared code accessible by both the bot and API.
|
||||||
|
|
||||||
**Database Layer (`shared/db/`):**
|
**Database Layer (`shared/db/`):**
|
||||||
|
|
||||||
@@ -86,19 +101,36 @@ Shared code accessible by both bot and web applications.
|
|||||||
|
|
||||||
**Modules (`shared/modules/`):**
|
**Modules (`shared/modules/`):**
|
||||||
|
|
||||||
- **economy/**: Economy service, lootdrops, daily rewards, trading
|
- **economy/**: Economy service, lootdrops, daily rewards
|
||||||
- **admin/**: Administrative actions (maintenance mode, cache clearing)
|
- **admin/**: Administrative actions (maintenance mode, cache clearing)
|
||||||
|
- **inventory/**: Inventory management
|
||||||
|
- **items/**: Item catalog and management
|
||||||
|
- **trade/**: Trading system
|
||||||
|
- **trivia/**: Trivia game logic
|
||||||
- **quest/**: Quest creation and tracking
|
- **quest/**: Quest creation and tracking
|
||||||
- **dashboard/**: Dashboard statistics and real-time event bus
|
- **class/**: RPG class system
|
||||||
- **leveling/**: XP and leveling logic
|
- **leveling/**: XP and leveling logic
|
||||||
|
- **moderation/**: Moderation case management
|
||||||
|
- **user/**: User profile management
|
||||||
|
- **dashboard/**: Dashboard statistics and real-time event bus
|
||||||
|
- **guild-settings/**: Per-guild configuration
|
||||||
|
- **game-settings/**: Game-wide settings
|
||||||
|
- **feature-flags/**: Feature flag management
|
||||||
|
- **system/**: System-level utilities
|
||||||
|
|
||||||
**Utilities (`shared/lib/`):**
|
**Utilities (`shared/lib/`):**
|
||||||
|
|
||||||
- `config.ts`: Application configuration management
|
- `config.ts`: Application configuration management
|
||||||
- `logger.ts`: Structured logging system
|
- `logger.ts`: Structured logging system
|
||||||
- `env.ts`: Environment variable handling
|
- `env.ts`: Environment variable handling
|
||||||
|
- `errors.ts`: Error classes (UserError, SystemError)
|
||||||
- `events.ts`: Event bus for inter-module communication
|
- `events.ts`: Event bus for inter-module communication
|
||||||
|
- `eventWiring.ts`: Event bus wiring
|
||||||
- `constants.ts`: Application-wide constants
|
- `constants.ts`: Application-wide constants
|
||||||
|
- `types.ts`: Shared TypeScript types
|
||||||
|
- `utils.ts`: General utility functions
|
||||||
|
- `rarity.ts`: Item rarity definitions
|
||||||
|
- `assets.ts`: Asset path utilities
|
||||||
|
|
||||||
## Main Use-Cases
|
## Main Use-Cases
|
||||||
|
|
||||||
@@ -145,6 +177,7 @@ Shared code accessible by both bot and web applications.
|
|||||||
| Web Framework | Bun HTTP Server (REST API) |
|
| Web Framework | Bun HTTP Server (REST API) |
|
||||||
| Database | PostgreSQL 17 |
|
| Database | PostgreSQL 17 |
|
||||||
| ORM | Drizzle ORM |
|
| ORM | Drizzle ORM |
|
||||||
|
| Admin Panel | React + Vite + Tailwind CSS |
|
||||||
| UI | Discord embeds and components |
|
| UI | Discord embeds and components |
|
||||||
| Validation | Zod |
|
| Validation | Zod |
|
||||||
| Containerization | Docker |
|
| Containerization | Docker |
|
||||||
|
|||||||
Reference in New Issue
Block a user