-
Notifications
You must be signed in to change notification settings - Fork 1
Testingbranch #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Testingbranch #19
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| # Getting Started | ||
|
|
||
| This guide will walk you through installing, configuring, and running HoloBridge. | ||
|
|
||
| **Navigation:** [Home](index.md) | Getting Started | [API Reference](api-reference.md) | [WebSocket](websocket.md) | [Plugins](plugins.md) | [Security](security.md) | [Network](network.md) | ||
|
|
||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Node.js 18 or higher | ||
| - npm or yarn package manager | ||
| - A Discord bot token | ||
|
|
||
| ## Installation | ||
|
|
||
| ### 1. Clone the Repository | ||
|
|
||
| ```bash | ||
| git clone https://github.com/coder-soft/holobridge.git | ||
| cd holobridge | ||
| ``` | ||
|
|
||
| ### 2. Install Dependencies | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| Copy `.env.example` to `.env` and fill in your values: | ||
|
|
||
| ```env | ||
| # Discord Bot Token (required) | ||
| # Get this from https://discord.com/developers/applications | ||
| DISCORD_TOKEN=your_discord_bot_token_here | ||
|
|
||
| # API Configuration | ||
| PORT=3000 | ||
| HOST=0.0.0.0 | ||
| API_KEY=your_secure_api_key_here | ||
|
|
||
| # Optional: Enable debug logging | ||
| DEBUG=false | ||
|
|
||
| # Optional: Plugin configuration | ||
| PLUGINS_ENABLED=true | ||
| PLUGINS_DIR=plugins | ||
|
|
||
| # Optional: Rate limiting | ||
| RATE_LIMIT_ENABLED=true | ||
| RATE_LIMIT_WINDOW_MS=60000 | ||
| RATE_LIMIT_MAX=100 | ||
| ``` | ||
|
|
||
| ### Configuration Reference | ||
|
|
||
| | Variable | Required | Default | Description | | ||
| |----------|----------|---------|-------------| | ||
| | `DISCORD_TOKEN` | Yes | - | Your Discord bot token | | ||
| | `API_KEY` | Yes | - | API key for authenticating requests | | ||
| | `PORT` | No | `3000` | Server port | | ||
| | `HOST` | No | `0.0.0.0` | Host to bind to (see [Network Configuration](network.md)) | | ||
| | `DEBUG` | No | `false` | Enable debug logging | | ||
| | `PLUGINS_ENABLED` | No | `true` | Enable/disable the plugin system | | ||
| | `PLUGINS_DIR` | No | `plugins` | Directory for plugins | | ||
| | `RATE_LIMIT_ENABLED` | No | `true` | Enable rate limiting | | ||
| | `RATE_LIMIT_WINDOW_MS` | No | `60000` | Rate limit window in milliseconds | | ||
| | `RATE_LIMIT_MAX` | No | `100` | Max requests per window | | ||
|
|
||
| ## Running the Server | ||
|
|
||
| ### Development Mode | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| ### Production Mode | ||
|
|
||
| ```bash | ||
| npm run build | ||
| npm start | ||
| ``` | ||
|
|
||
| ### Using Docker | ||
|
|
||
| ```bash | ||
| docker-compose up -d | ||
| ``` | ||
|
|
||
| ## Discord Bot Setup | ||
|
|
||
| Follow these steps to create a Discord bot and invite it to your server: | ||
|
|
||
| 1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) | ||
| 2. Click "New Application" and give it a name | ||
| 3. Go to the "Bot" section in the left sidebar | ||
| 4. Click "Add Bot" and confirm | ||
| 5. Enable the following **Privileged Gateway Intents**: | ||
| - Presence Intent | ||
| - Server Members Intent | ||
| - Message Content Intent | ||
| 6. Click "Reset Token" to get your bot token and copy it to your `.env` file | ||
|
|
||
| ### Inviting the Bot | ||
|
|
||
| 1. Go to the "OAuth2" → "URL Generator" section | ||
| 2. Select the following scopes: | ||
| - `bot` | ||
| - `applications.commands` | ||
| 3. Select the permissions your bot needs (Administrator for full access) | ||
| 4. Copy the generated URL and open it in your browser | ||
| 5. Select a server and authorize the bot | ||
|
|
||
| > ⚠️ **Important:** Keep your bot token and API key secret. Never commit them to version control. | ||
|
|
||
| ## Testing the API | ||
|
|
||
| Once the server is running, you can test the API with curl: | ||
|
|
||
| ```bash | ||
| # Health check (no auth required) | ||
| curl http://localhost:3000/health | ||
|
|
||
| # List all guilds | ||
| curl -H "X-API-Key: your_api_key" http://localhost:3000/api/guilds | ||
| ``` | ||
|
|
||
| ## Server Endpoints | ||
|
|
||
| When the server starts, it will display all available endpoints: | ||
|
|
||
| ``` | ||
| 🌐 API server listening on 0.0.0.0:3000 | ||
| Local: http://localhost:3000/api | ||
| Network: http://192.168.1.100:3000/api | ||
| API Docs: http://192.168.1.100:3000/api/docs | ||
| Plugin API: http://192.168.1.100:3000/api/plugins | ||
| WebSocket: ws://192.168.1.100:3000 | ||
| Health: http://192.168.1.100:3000/health | ||
| ``` | ||
|
|
||
| - **Local** - Access from the same machine | ||
| - **Network** - Access from other devices on your network (see [Network Configuration](network.md)) | ||
| - **API Docs** - Interactive Swagger UI documentation | ||
| - **Plugin API** - Endpoints registered by plugins | ||
| - **WebSocket** - Socket.IO endpoint for real-time events | ||
| - **Health** - Health check endpoint for monitoring | ||
|
|
||
| ## Next Steps | ||
|
|
||
| - [API Reference](api-reference.md) - Explore all available REST API endpoints | ||
| - [WebSocket Events](websocket.md) - Learn how to receive real-time Discord events | ||
| - [Network Configuration](network.md) - Expose the API on your local network | ||
| - [Plugins](plugins.md) - Extend HoloBridge with custom functionality | ||
| - [Security](security.md) - Configure API scopes and rate limiting | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Recommending Administrator permissions is a security concern - consider suggesting minimal required permissions instead.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI