Skip to content
Draft
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
618 changes: 618 additions & 0 deletions IMPLEMENTATION_PLAN.md

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
DISCORD_BOT_TOKEN=your_bot_token_here
DISCORD_CLIENT_ID=your_client_id_here
DISCORD_CLIENT_SECRET=your_client_secret_here
DISCORD_REDIRECT_URI=http://localhost:5173/auth/callback
DISCORD_REDIRECT_URI=http://localhost:3002/auth/discord/callback

# Server Configuration
PORT=3002
NODE_ENV=development

# JWT Configuration
JWT_SECRET=your-jwt-secret-change-in-production

# RallyRound Integration
RALLYROUND_API_URL=http://localhost:8765/api
RALLYROUND_URL=http://localhost:8765
RALLYROUND_WEBHOOK_SECRET=your-webhook-secret

# Webhook Configuration (for session creation)
WEBHOOK_BASE_URL=http://localhost:3002
30 changes: 22 additions & 8 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,37 @@
"scripts": {
"dev": "tsx watch --env-file=.env src/index.ts",
"build": "tsc",
"start": "node dist/index.js"
"start": "node dist/index.js",
"register-commands": "tsx --env-file=.env src/commands/register.ts"
},
"keywords": ["discord", "stats", "api"],
"keywords": [
"discord",
"stats",
"api"
],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2",
"@discordjs/builders": "^1.13.1",
"@discordjs/rest": "^2.6.0",
"@discordjs/voice": "^0.19.0",
"axios": "^1.6.2",
"better-sqlite3": "^12.5.0",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"discord.js": "^14.14.1",
"axios": "^1.6.2"
"dotenv": "^16.3.1",
"drizzle-orm": "^0.45.1",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.3"
},
"devDependencies": {
"@types/express": "^4.17.21",
"@types/better-sqlite3": "^7.6.13",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jsonwebtoken": "^9.0.10",
"@types/node": "^20.10.5",
"typescript": "^5.3.3",
"tsx": "^4.7.0"
"drizzle-kit": "^0.31.8",
"tsx": "^4.7.0",
"typescript": "^5.3.3"
}
}
186 changes: 186 additions & 0 deletions server/src/commands/definitions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
import { SlashCommandBuilder } from 'discord.js';

/**
* Define all RallyRound slash commands
*/
export const rrCommand = new SlashCommandBuilder()
.setName('rr')
.setDescription('RallyRound live session commands')

// Session Management
.addSubcommand((sub) =>
sub
.setName('start')
.setDescription('Start a new RallyRound session')
.addStringOption((opt) =>
opt.setName('title').setDescription('Session title').setRequired(true)
)
)
.addSubcommand((sub) =>
sub.setName('end').setDescription('End the current session')
)
.addSubcommand((sub) =>
sub.setName('pause').setDescription('Pause the current session')
)
.addSubcommand((sub) =>
sub.setName('resume').setDescription('Resume the paused session')
)
.addSubcommand((sub) =>
sub.setName('status').setDescription('Show current session status')
)
.addSubcommand((sub) =>
sub.setName('link').setDescription('Post the session dashboard URL')
)

// Mode and Recording
.addSubcommand((sub) =>
sub
.setName('mode')
.setDescription('Change session mode')
.addStringOption((opt) =>
opt
.setName('mode')
.setDescription('Session mode')
.setRequired(true)
.addChoices(
{ name: 'Structured', value: 'structured' },
{ name: 'Unstructured', value: 'unstructured' }
)
)
)
.addSubcommand((sub) =>
sub
.setName('record')
.setDescription('Control session recording')
.addStringOption((opt) =>
opt
.setName('action')
.setDescription('Recording action')
.setRequired(true)
.addChoices(
{ name: 'Start Recording', value: 'start' },
{ name: 'Stop Recording', value: 'stop' }
)
)
)

// Speaker Management
.addSubcommand((sub) =>
sub.setName('next').setDescription('Move to the next speaker in queue')
)
.addSubcommand((sub) =>
sub
.setName('speaker')
.setDescription('Set a specific user as the current speaker')
.addUserOption((opt) =>
opt.setName('user').setDescription('User to set as speaker').setRequired(true)
)
)
.addSubcommand((sub) =>
sub.setName('clear').setDescription('Clear the current speaker')
)
.addSubcommand((sub) =>
sub.setName('queue').setDescription('Display the speaker queue')
)

// Signals
.addSubcommand((sub) =>
sub.setName('hand').setDescription('Raise or lower your hand')
)
.addSubcommand((sub) =>
sub
.setName('point')
.setDescription('Raise a parliamentary point')
.addStringOption((opt) =>
opt
.setName('type')
.setDescription('Type of point')
.setRequired(true)
.addChoices(
{ name: 'Point of Order', value: 'order' },
{ name: 'Point of Clarification', value: 'clarify' },
{ name: 'Point of Information', value: 'info' }
)
)
)
.addSubcommand((sub) =>
sub.setName('question').setDescription('Signal that you have a question')
)
.addSubcommand((sub) =>
sub.setName('agree').setDescription('Signal agreement')
)
.addSubcommand((sub) =>
sub.setName('disagree').setDescription('Signal disagreement')
)
.addSubcommand((sub) =>
sub.setName('away').setDescription('Mark yourself as away')
)
.addSubcommand((sub) =>
sub.setName('back').setDescription('Mark yourself as back')
)

// Agenda
.addSubcommand((sub) =>
sub.setName('agenda').setDescription('Display the session agenda')
)
.addSubcommand((sub) =>
sub
.setName('agenda-add')
.setDescription('Add an item to the agenda')
.addStringOption((opt) =>
opt.setName('item').setDescription('Agenda item title').setRequired(true)
)
)
.addSubcommand((sub) =>
sub.setName('agenda-next').setDescription('Advance to the next agenda item')
)
.addSubcommand((sub) =>
sub.setName('agenda-done').setDescription('Mark the current agenda item as complete')
)
.addSubcommand((sub) =>
sub.setName('agenda-skip').setDescription('Skip the current agenda item')
)

// Sound Effects
.addSubcommand((sub) =>
sub
.setName('sfx')
.setDescription('Control sound effects')
.addStringOption((opt) =>
opt
.setName('action')
.setDescription('Sound effect action')
.setRequired(true)
.addChoices(
{ name: 'Enable', value: 'on' },
{ name: 'Disable', value: 'off' },
{ name: 'List Sounds', value: 'list' }
)
)
)
.addSubcommand((sub) =>
sub
.setName('sfx-play')
.setDescription('Play a specific sound effect')
.addStringOption((opt) =>
opt
.setName('sound')
.setDescription('Sound to play')
.setRequired(true)
.addChoices(
{ name: 'Chime', value: 'chime' },
{ name: 'Gavel', value: 'gavel' },
{ name: 'Swoosh', value: 'swoosh' },
{ name: 'Ding', value: 'ding' },
{ name: 'Bell', value: 'bell' },
{ name: 'Notification', value: 'notification' }
)
)
);

/**
* Get all commands as JSON for registration
*/
export function getCommandsJSON() {
return [rrCommand.toJSON()];
}
Loading