feat: Implement core Discord clone functionality including Convex backend, Electron frontend, and UI components for chat, voice, and settings.

This commit is contained in:
Bryan1029384756
2026-02-10 04:41:10 -06:00
parent 516cfdbbd8
commit 47f173c79b
63 changed files with 4467 additions and 5292 deletions

34
convex/voice.ts Normal file
View File

@@ -0,0 +1,34 @@
"use node";
import { action } from "./_generated/server";
import { v } from "convex/values";
import { AccessToken } from "livekit-server-sdk";
// Generate LiveKit token for voice channel
export const getToken = action({
args: {
channelId: v.string(),
userId: v.string(),
username: v.string(),
},
returns: v.object({ token: v.string() }),
handler: async (_ctx, args) => {
const apiKey = process.env.LIVEKIT_API_KEY || "devkey";
const apiSecret = process.env.LIVEKIT_API_SECRET || "secret";
const at = new AccessToken(apiKey, apiSecret, {
identity: args.userId,
name: args.username,
});
at.addGrant({
roomJoin: true,
room: args.channelId,
canPublish: true,
canSubscribe: true,
});
const token = await at.toJwt();
return { token };
},
});