Skip to content

Commit 35ff513

Browse files
authored
Merge pull request #1 from Coder-soft/Testingbranch
Added docs and multiple event types to the application including threads and bulk messages and some more
2 parents 3f3d7ce + 420d626 commit 35ff513

14 files changed

Lines changed: 4229 additions & 10 deletions

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Discord Web Bridge - Environment Variables
1+
# Holo Bridge - Environment Variables
22

33
# Discord Bot Token (required)
44
# Get this from https://discord.com/developers/applications

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Discord Web Bridge
1+
# Holo Bridge
22

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

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

106+
## Documentation
107+
108+
Visit the [documentation](https://holodocs.pages.dev/) for more details.
109+
106110
## License
107111

108112
MIT

docs/api-reference.html

Lines changed: 811 additions & 0 deletions
Large diffs are not rendered by default.

docs/getting-started.html

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Getting Started - Holo Bridge</title>
8+
<meta name="description" content="Learn how to install, configure, and run Holo Bridge.">
9+
<link rel="stylesheet" href="styles.css">
10+
</head>
11+
12+
<body>
13+
<header>
14+
<div class="container header-content">
15+
<a href="index.html" class="logo">Holo Bridge</a>
16+
<nav>
17+
<a href="index.html">Home</a>
18+
<a href="getting-started.html" class="active">Getting Started</a>
19+
<a href="api-reference.html">API Reference</a>
20+
<a href="websocket.html">WebSocket</a>
21+
<button class="theme-toggle" onclick="toggleTheme()">Toggle Theme</button>
22+
</nav>
23+
</div>
24+
</header>
25+
26+
<main>
27+
<div class="container">
28+
<h1>Getting Started</h1>
29+
<p>This guide will walk you through installing, configuring, and running Holo Bridge.</p>
30+
31+
<h2>Prerequisites</h2>
32+
<ul>
33+
<li>Node.js 18 or higher</li>
34+
<li>npm or yarn package manager</li>
35+
<li>A Discord bot token</li>
36+
</ul>
37+
38+
<h2>Installation</h2>
39+
<h3>1. Clone the Repository</h3>
40+
git clone https://github.com/coder-soft/holobridge.git
41+
cd holobridge
42+
43+
<h3>2. Install Dependencies</h3>
44+
<pre><code>npm install</code></pre>
45+
46+
<h2>Configuration</h2>
47+
<h3>Environment Variables</h3>
48+
<p>Copy <code>.env.example</code> to <code>.env</code> and fill in your values:</p>
49+
<pre><code># Discord Bot Token (required)
50+
# Get this from https://discord.com/developers/applications
51+
DISCORD_TOKEN=your_discord_bot_token_here
52+
53+
# API Configuration
54+
PORT=3000
55+
API_KEY=your_secure_api_key_here
56+
57+
# Optional: Enable debug logging
58+
DEBUG=false</code></pre>
59+
60+
<table>
61+
<thead>
62+
<tr>
63+
<th>Variable</th>
64+
<th>Required</th>
65+
<th>Description</th>
66+
</tr>
67+
</thead>
68+
<tbody>
69+
<tr>
70+
<td><code>DISCORD_TOKEN</code></td>
71+
<td>Yes</td>
72+
<td>Your Discord bot token</td>
73+
</tr>
74+
<tr>
75+
<td><code>API_KEY</code></td>
76+
<td>Yes</td>
77+
<td>API key for authenticating requests</td>
78+
</tr>
79+
<tr>
80+
<td><code>PORT</code></td>
81+
<td>No</td>
82+
<td>Server port (default: 3000)</td>
83+
</tr>
84+
<tr>
85+
<td><code>DEBUG</code></td>
86+
<td>No</td>
87+
<td>Enable debug logging (default: false)</td>
88+
</tr>
89+
</tbody>
90+
</table>
91+
92+
<h2>Running the Server</h2>
93+
<h3>Development Mode</h3>
94+
<pre><code>npm run dev</code></pre>
95+
96+
<h3>Production Mode</h3>
97+
<pre><code>npm run build
98+
npm start</code></pre>
99+
100+
<h2>Discord Bot Setup</h2>
101+
<p>Follow these steps to create a Discord bot and invite it to your server:</p>
102+
103+
<ol>
104+
<li>Go to the <a href="https://discord.com/developers/applications" target="_blank">Discord Developer
105+
Portal</a></li>
106+
<li>Click "New Application" and give it a name</li>
107+
<li>Go to the "Bot" section in the left sidebar</li>
108+
<li>Click "Add Bot" and confirm</li>
109+
<li>Enable the following <strong>Privileged Gateway Intents</strong>:
110+
<ul>
111+
<li>Presence Intent</li>
112+
<li>Server Members Intent</li>
113+
<li>Message Content Intent</li>
114+
</ul>
115+
</li>
116+
<li>Click "Reset Token" to get your bot token and copy it to your <code>.env</code> file</li>
117+
</ol>
118+
119+
<h3>Inviting the Bot</h3>
120+
<ol>
121+
<li>Go to the "OAuth2" → "URL Generator" section</li>
122+
<li>Select the following scopes:
123+
<ul>
124+
<li><code>bot</code></li>
125+
<li><code>applications.commands</code></li>
126+
</ul>
127+
</li>
128+
<li>Select the permissions your bot needs (Administrator for full access)</li>
129+
<li>Copy the generated URL and open it in your browser</li>
130+
<li>Select a server and authorize the bot</li>
131+
</ol>
132+
133+
<div class="alert alert-warning">
134+
<strong>⚠️ Important:</strong> Keep your bot token and API key secret. Never commit them to version
135+
control.
136+
</div>
137+
138+
<h2>Testing the API</h2>
139+
<p>Once the server is running, you can test the API with curl:</p>
140+
<pre><code># List all guilds
141+
curl -H "X-API-Key: your_api_key" http://localhost:3000/api/guilds</code></pre>
142+
143+
<h2>Next Steps</h2>
144+
<div class="cards">
145+
<a href="api-reference.html" class="card">
146+
<h4>📖 API Reference</h4>
147+
<p>Explore all available REST API endpoints.</p>
148+
</a>
149+
<a href="websocket.html" class="card">
150+
<h4>⚡ WebSocket Events</h4>
151+
<p>Learn how to receive real-time Discord events.</p>
152+
</a>
153+
</div>
154+
</div>
155+
</main>
156+
157+
<footer>
158+
<div class="container">
159+
<p>Holo Bridge &copy; 2025 - MIT License</p>
160+
</div>
161+
</footer>
162+
163+
<script>
164+
function toggleTheme() {
165+
const html = document.documentElement;
166+
const current = html.getAttribute('data-theme');
167+
if (current === 'dark') {
168+
html.setAttribute('data-theme', 'light');
169+
localStorage.setItem('theme', 'light');
170+
} else if (current === 'light') {
171+
html.setAttribute('data-theme', 'dark');
172+
localStorage.setItem('theme', 'dark');
173+
} else {
174+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
175+
const newTheme = prefersDark ? 'light' : 'dark';
176+
html.setAttribute('data-theme', newTheme);
177+
localStorage.setItem('theme', newTheme);
178+
}
179+
}
180+
181+
(function () {
182+
const saved = localStorage.getItem('theme');
183+
if (saved) {
184+
document.documentElement.setAttribute('data-theme', saved);
185+
}
186+
})();
187+
</script>
188+
</body>
189+
190+
</html>

docs/index.html

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Holo Bridge - Documentation</title>
8+
<meta name="description"
9+
content="A type-safe TypeScript bridge between websites and Discord bots. REST API and WebSocket interface for full Discord bot capabilities.">
10+
<link rel="stylesheet" href="styles.css">
11+
</head>
12+
13+
<body>
14+
<header>
15+
<div class="container header-content">
16+
<a href="index.html" class="logo">Holo Bridge</a>
17+
<nav>
18+
<a href="index.html" class="active">Home</a>
19+
<a href="getting-started.html">Getting Started</a>
20+
<a href="api-reference.html">API Reference</a>
21+
<a href="websocket.html">WebSocket</a>
22+
<button class="theme-toggle" onclick="toggleTheme()">Toggle Theme</button>
23+
</nav>
24+
</div>
25+
</header>
26+
27+
<main>
28+
<div class="container">
29+
<section class="hero">
30+
<h1>Holo Bridge</h1>
31+
<p>A type-safe TypeScript bridge between websites and Discord bots. Provides a REST API and WebSocket
32+
interface for full Discord bot capabilities.</p>
33+
<div class="btn-group">
34+
<a href="getting-started.html" class="btn btn-primary">Get Started</a>
35+
<a href="api-reference.html" class="btn btn-secondary">API Reference</a>
36+
</div>
37+
</section>
38+
39+
<section class="features">
40+
<div class="feature-card">
41+
<h3>🌐 REST API</h3>
42+
<p>Full REST API for all Discord operations including guilds, channels, messages, members, and
43+
roles.</p>
44+
</div>
45+
<div class="feature-card">
46+
<h3>⚡ WebSocket Events</h3>
47+
<p>Real-time event streaming via Socket.IO. Subscribe to guilds and receive Discord events
48+
instantly.</p>
49+
</div>
50+
<div class="feature-card">
51+
<h3>🔒 Type-Safe</h3>
52+
<p>Built with TypeScript and Zod validation. Every request and response is fully typed.</p>
53+
</div>
54+
<div class="feature-card">
55+
<h3>📦 Full Coverage</h3>
56+
<p>Guilds, Channels, Roles, Members, Bans, Timeouts, Messages, Reactions, Pins, and more.</p>
57+
</div>
58+
</section>
59+
60+
<h2>Quick Links</h2>
61+
<div class="cards">
62+
<a href="getting-started.html" class="card">
63+
<h4>📚 Getting Started</h4>
64+
<p>Installation, configuration, and running the server.</p>
65+
</a>
66+
<a href="api-reference.html" class="card">
67+
<h4>📖 API Reference</h4>
68+
<p>Complete REST API endpoint documentation.</p>
69+
</a>
70+
<a href="websocket.html" class="card">
71+
<h4>⚡ WebSocket Events</h4>
72+
<p>Real-time event streaming documentation.</p>
73+
</a>
74+
<a href="https://github.com" class="card" target="_blank">
75+
<h4>💻 Source Code</h4>
76+
<p>View the source code on GitHub.</p>
77+
</a>
78+
</div>
79+
80+
<h2>Features Overview</h2>
81+
<h3>Discord Operations</h3>
82+
<ul>
83+
<li><strong>Guilds</strong> - List guilds, get details, channels, roles, emojis, bans, invites</li>
84+
<li><strong>Channels</strong> - Create, edit, delete channels and threads</li>
85+
<li><strong>Messages</strong> - Send, edit, delete, bulk delete, reactions, pins</li>
86+
<li><strong>Members</strong> - List, search, kick, ban, timeout, role management</li>
87+
<li><strong>Roles</strong> - Create, edit, delete, permissions management</li>
88+
</ul>
89+
90+
<h3>Real-Time Events</h3>
91+
<ul>
92+
<li><strong>Message Events</strong> - messageCreate, messageUpdate, messageDelete</li>
93+
<li><strong>Member Events</strong> - guildMemberAdd, guildMemberRemove, guildMemberUpdate</li>
94+
<li><strong>Channel Events</strong> - channelCreate, channelUpdate, channelDelete</li>
95+
<li><strong>Role Events</strong> - roleCreate, roleUpdate, roleDelete</li>
96+
<li><strong>Voice Events</strong> - voiceStateUpdate</li>
97+
<li><strong>Guild Events</strong> - guildBanAdd, guildBanRemove</li>
98+
</ul>
99+
</div>
100+
</main>
101+
102+
<footer>
103+
<div class="container">
104+
<p>Holo Bridge &copy; 2025 - MIT License</p>
105+
</div>
106+
</footer>
107+
108+
<script>
109+
function toggleTheme() {
110+
const html = document.documentElement;
111+
const current = html.getAttribute('data-theme');
112+
if (current === 'dark') {
113+
html.setAttribute('data-theme', 'light');
114+
localStorage.setItem('theme', 'light');
115+
} else if (current === 'light') {
116+
html.setAttribute('data-theme', 'dark');
117+
localStorage.setItem('theme', 'dark');
118+
} else {
119+
// First toggle - check what the current preference is
120+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
121+
const newTheme = prefersDark ? 'light' : 'dark';
122+
html.setAttribute('data-theme', newTheme);
123+
localStorage.setItem('theme', newTheme);
124+
}
125+
}
126+
127+
// Load saved theme
128+
(function () {
129+
const saved = localStorage.getItem('theme');
130+
if (saved) {
131+
document.documentElement.setAttribute('data-theme', saved);
132+
}
133+
})();
134+
</script>
135+
</body>
136+
137+
</html>

0 commit comments

Comments
 (0)