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 .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Discord Web Bridge - Environment Variables
# Holo Bridge - Environment Variables

# Discord Bot Token (required)
# Get this from https://discord.com/developers/applications
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Discord Web Bridge
# Holo Bridge

A type-safe TypeScript bridge between websites and Discord bots. Provides a REST API and WebSocket interface for full Discord bot capabilities.

Expand Down Expand Up @@ -103,6 +103,10 @@ socket.on('discord', (event) => {
5. Copy the token to your `.env` file
6. Invite the bot to your server with appropriate permissions

## Documentation

Visit the [documentation](https://holodocs.pages.dev/) for more details.

## License

MIT
811 changes: 811 additions & 0 deletions docs/api-reference.html

Large diffs are not rendered by default.

190 changes: 190 additions & 0 deletions docs/getting-started.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Getting Started - Holo Bridge</title>
<meta name="description" content="Learn how to install, configure, and run Holo Bridge.">
<link rel="stylesheet" href="styles.css">
</head>

<body>
<header>
<div class="container header-content">
<a href="index.html" class="logo">Holo Bridge</a>
<nav>
<a href="index.html">Home</a>
<a href="getting-started.html" class="active">Getting Started</a>
<a href="api-reference.html">API Reference</a>
<a href="websocket.html">WebSocket</a>
<button class="theme-toggle" onclick="toggleTheme()">Toggle Theme</button>
</nav>
</div>
</header>

<main>
<div class="container">
<h1>Getting Started</h1>
<p>This guide will walk you through installing, configuring, and running Holo Bridge.</p>

<h2>Prerequisites</h2>
<ul>
<li>Node.js 18 or higher</li>
<li>npm or yarn package manager</li>
<li>A Discord bot token</li>
</ul>

<h2>Installation</h2>
<h3>1. Clone the Repository</h3>
git clone https://github.com/coder-soft/holobridge.git
cd holobridge

<h3>2. Install Dependencies</h3>
<pre><code>npm install</code></pre>

<h2>Configuration</h2>
<h3>Environment Variables</h3>
<p>Copy <code>.env.example</code> to <code>.env</code> and fill in your values:</p>
<pre><code># Discord Bot Token (required)
# Get this from https://discord.com/developers/applications
DISCORD_TOKEN=your_discord_bot_token_here

# API Configuration
PORT=3000
API_KEY=your_secure_api_key_here

# Optional: Enable debug logging
DEBUG=false</code></pre>

<table>
<thead>
<tr>
<th>Variable</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>DISCORD_TOKEN</code></td>
<td>Yes</td>
<td>Your Discord bot token</td>
</tr>
<tr>
<td><code>API_KEY</code></td>
<td>Yes</td>
<td>API key for authenticating requests</td>
</tr>
<tr>
<td><code>PORT</code></td>
<td>No</td>
<td>Server port (default: 3000)</td>
</tr>
<tr>
<td><code>DEBUG</code></td>
<td>No</td>
<td>Enable debug logging (default: false)</td>
</tr>
</tbody>
</table>

<h2>Running the Server</h2>
<h3>Development Mode</h3>
<pre><code>npm run dev</code></pre>

<h3>Production Mode</h3>
<pre><code>npm run build
npm start</code></pre>

<h2>Discord Bot Setup</h2>
<p>Follow these steps to create a Discord bot and invite it to your server:</p>

<ol>
<li>Go to the <a href="https://discord.com/developers/applications" target="_blank">Discord Developer
Portal</a></li>
<li>Click "New Application" and give it a name</li>
<li>Go to the "Bot" section in the left sidebar</li>
<li>Click "Add Bot" and confirm</li>
<li>Enable the following <strong>Privileged Gateway Intents</strong>:
<ul>
<li>Presence Intent</li>
<li>Server Members Intent</li>
<li>Message Content Intent</li>
</ul>
</li>
<li>Click "Reset Token" to get your bot token and copy it to your <code>.env</code> file</li>
</ol>

<h3>Inviting the Bot</h3>
<ol>
<li>Go to the "OAuth2" → "URL Generator" section</li>
<li>Select the following scopes:
<ul>
<li><code>bot</code></li>
<li><code>applications.commands</code></li>
</ul>
</li>
<li>Select the permissions your bot needs (Administrator for full access)</li>
<li>Copy the generated URL and open it in your browser</li>
<li>Select a server and authorize the bot</li>
</ol>

<div class="alert alert-warning">
<strong>⚠️ Important:</strong> Keep your bot token and API key secret. Never commit them to version
control.
</div>

<h2>Testing the API</h2>
<p>Once the server is running, you can test the API with curl:</p>
<pre><code># List all guilds
curl -H "X-API-Key: your_api_key" http://localhost:3000/api/guilds</code></pre>

<h2>Next Steps</h2>
<div class="cards">
<a href="api-reference.html" class="card">
<h4>📖 API Reference</h4>
<p>Explore all available REST API endpoints.</p>
</a>
<a href="websocket.html" class="card">
<h4>⚡ WebSocket Events</h4>
<p>Learn how to receive real-time Discord events.</p>
</a>
</div>
</div>
</main>

<footer>
<div class="container">
<p>Holo Bridge &copy; 2025 - MIT License</p>
</div>
</footer>

<script>
function toggleTheme() {
const html = document.documentElement;
const current = html.getAttribute('data-theme');
if (current === 'dark') {
html.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
} else if (current === 'light') {
html.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
} else {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const newTheme = prefersDark ? 'light' : 'dark';
html.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
}
}

(function () {
const saved = localStorage.getItem('theme');
if (saved) {
document.documentElement.setAttribute('data-theme', saved);
}
})();
</script>
</body>

</html>
137 changes: 137 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Holo Bridge - Documentation</title>
<meta name="description"
content="A type-safe TypeScript bridge between websites and Discord bots. REST API and WebSocket interface for full Discord bot capabilities.">
<link rel="stylesheet" href="styles.css">
</head>

<body>
<header>
<div class="container header-content">
<a href="index.html" class="logo">Holo Bridge</a>
<nav>
<a href="index.html" class="active">Home</a>
<a href="getting-started.html">Getting Started</a>
<a href="api-reference.html">API Reference</a>
<a href="websocket.html">WebSocket</a>
<button class="theme-toggle" onclick="toggleTheme()">Toggle Theme</button>
</nav>
</div>
</header>

<main>
<div class="container">
<section class="hero">
<h1>Holo Bridge</h1>
<p>A type-safe TypeScript bridge between websites and Discord bots. Provides a REST API and WebSocket
interface for full Discord bot capabilities.</p>
<div class="btn-group">
<a href="getting-started.html" class="btn btn-primary">Get Started</a>
<a href="api-reference.html" class="btn btn-secondary">API Reference</a>
</div>
</section>

<section class="features">
<div class="feature-card">
<h3>🌐 REST API</h3>
<p>Full REST API for all Discord operations including guilds, channels, messages, members, and
roles.</p>
</div>
<div class="feature-card">
<h3>⚡ WebSocket Events</h3>
<p>Real-time event streaming via Socket.IO. Subscribe to guilds and receive Discord events
instantly.</p>
</div>
<div class="feature-card">
<h3>🔒 Type-Safe</h3>
<p>Built with TypeScript and Zod validation. Every request and response is fully typed.</p>
</div>
<div class="feature-card">
<h3>📦 Full Coverage</h3>
<p>Guilds, Channels, Roles, Members, Bans, Timeouts, Messages, Reactions, Pins, and more.</p>
</div>
</section>

<h2>Quick Links</h2>
<div class="cards">
<a href="getting-started.html" class="card">
<h4>📚 Getting Started</h4>
<p>Installation, configuration, and running the server.</p>
</a>
<a href="api-reference.html" class="card">
<h4>📖 API Reference</h4>
<p>Complete REST API endpoint documentation.</p>
</a>
<a href="websocket.html" class="card">
<h4>⚡ WebSocket Events</h4>
<p>Real-time event streaming documentation.</p>
</a>
<a href="https://github.com" class="card" target="_blank">
<h4>💻 Source Code</h4>
<p>View the source code on GitHub.</p>
</a>
Comment on lines +74 to +77
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Link points to generic https://github.com instead of the actual repository

Suggested change
<a href="https://github.com" class="card" target="_blank">
<h4>💻 Source Code</h4>
<p>View the source code on GitHub.</p>
</a>
<a href="https://github.com/coder-soft/holobridge" class="card" target="_blank">
<h4>💻 Source Code</h4>
<p>View the source code on GitHub.</p>
</a>
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/index.html
Line: 74:77

Comment:
**style:** Link points to generic `https://github.com` instead of the actual repository

```suggestion
                <a href="https://github.com/coder-soft/holobridge" class="card" target="_blank">
                    <h4>💻 Source Code</h4>
                    <p>View the source code on GitHub.</p>
                </a>
```

How can I resolve this? If you propose a fix, please make it concise.

</div>

<h2>Features Overview</h2>
<h3>Discord Operations</h3>
<ul>
<li><strong>Guilds</strong> - List guilds, get details, channels, roles, emojis, bans, invites</li>
<li><strong>Channels</strong> - Create, edit, delete channels and threads</li>
<li><strong>Messages</strong> - Send, edit, delete, bulk delete, reactions, pins</li>
<li><strong>Members</strong> - List, search, kick, ban, timeout, role management</li>
<li><strong>Roles</strong> - Create, edit, delete, permissions management</li>
</ul>

<h3>Real-Time Events</h3>
<ul>
<li><strong>Message Events</strong> - messageCreate, messageUpdate, messageDelete</li>
<li><strong>Member Events</strong> - guildMemberAdd, guildMemberRemove, guildMemberUpdate</li>
<li><strong>Channel Events</strong> - channelCreate, channelUpdate, channelDelete</li>
<li><strong>Role Events</strong> - roleCreate, roleUpdate, roleDelete</li>
<li><strong>Voice Events</strong> - voiceStateUpdate</li>
<li><strong>Guild Events</strong> - guildBanAdd, guildBanRemove</li>
</ul>
</div>
</main>

<footer>
<div class="container">
<p>Holo Bridge &copy; 2025 - MIT License</p>
</div>
</footer>

<script>
function toggleTheme() {
const html = document.documentElement;
const current = html.getAttribute('data-theme');
if (current === 'dark') {
html.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
} else if (current === 'light') {
html.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
} else {
// First toggle - check what the current preference is
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const newTheme = prefersDark ? 'light' : 'dark';
html.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
}
}

// Load saved theme
(function () {
const saved = localStorage.getItem('theme');
if (saved) {
document.documentElement.setAttribute('data-theme', saved);
}
})();
</script>
</body>

</html>
Loading