FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
mrojas54
mrojas54rust-nyc-talk-submissions
Remix of colel/rust-nyc-talk-submissions
Public
Like
1
rust-nyc-talk-submissions
Home
Code
9
backend
1
frontend
3
shared
1
.vtignore
AGENT.md
BRAND_STYLE_GUIDE.md
README.md
deno.json
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
7
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ€“ all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://mrojas54--3f6059cc0e004da8a0ab1ccd7bc3e7ec.web.val.run
README.md

Talk Submission System

A complete talk submission system with Discord integration for event organizers.

Features

  • Talk Submission Form: Collects speaker name, talk context, and submission type
  • Discord Integration: Automatically creates channels and sends notifications
  • Database Storage: Tracks all submissions with SQLite
  • Responsive UI: Clean, modern interface built with React and TailwindCSS

How It Works

  1. Form Submission: Users fill out the talk submission form
  2. Database Storage: Submission is saved to SQLite database
  3. Discord Channel Creation: A dedicated channel is created for the talk discussion
  4. Organizer Notification: A message is posted to the organizers' channel
  5. Invite Link: User receives a Discord invite link to join the discussion

Project Structure

โ”œโ”€โ”€ backend/
โ”‚   โ””โ”€โ”€ index.ts              # Main API server with Hono
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ index.html           # Main HTML template
โ”‚   โ”œโ”€โ”€ index.tsx            # React app entry point
โ”‚   โ””โ”€โ”€ components/
โ”‚       โ”œโ”€โ”€ App.tsx          # Main app component
โ”‚       โ”œโ”€โ”€ TalkSubmissionForm.tsx  # Form component
โ”‚       โ””โ”€โ”€ SubmissionSuccess.tsx   # Success page component
โ”œโ”€โ”€ shared/
โ”‚   โ””โ”€โ”€ types.ts             # Shared TypeScript types
โ””โ”€โ”€ README.md

Setup

Environment Variables

You'll need to set up the following environment variables for Discord integration:

  • DISCORD_BOT_TOKEN: Your Discord bot token
  • DISCORD_GUILD_ID: Your Discord server ID
  • DISCORD_ORGANIZERS_CHANNEL_ID: Channel ID where organizer notifications are sent
  • DISCORD_CATEGORY_ID (optional): Category ID for organizing talk channels
  • DISCORD_TEST_CATEGORY_ID (optional): Category ID for organizing test channels
  • DISCORD_TEST_ORGANIZERS_CHANNEL_ID (optional): Channel ID for test announcements

Testing Environment Variables

The following environment variables are used for testing the Discord integration without affecting production channels:

  • ENABLE_TEST_API: Set to "true" to enable the test API endpoint (required for testing)
  • DISCORD_TEST_CATEGORY_ID: Separate category for test channels to keep them organized
  • DISCORD_TEST_ORGANIZERS_CHANNEL_ID: Separate channel for test notifications to avoid spamming production organizers

Testing the Discord Integration:

curl -X POST https://rustnyc-talks.val.run/api/discord/test \ -H "Content-Type: application/json" \ -d '{"channelName": "my-test-channel", "firstMessage": "Hello from test endpoint!"}'

Parameters:

  • channelName (required): Name for the test channel (will be sanitized for Discord)
  • firstMessage (required): First message to send to the channel

This will create a test channel with the specified name, send the first message, and return an invite link. If test environment variables are configured, it will also notify the test organizers channel.

Testing Discord Invite Creation Directly:

You can also test the Discord invite creation process directly using Discord's API:

curl -X POST https://discord.com/api/v10/channels/CHANNEL_ID/invites \ -H "Authorization: Bot YOUR_BOT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "max_age": 0, "max_uses": 0, "unique": true }'

Replace CHANNEL_ID with an existing channel ID and YOUR_BOT_TOKEN with your Discord bot token. This matches exactly how the bot creates invitation links internally.

Discord Bot Setup

  1. Create a Discord application at https://discord.com/developers/applications
  2. Create a bot and copy the token
  3. Invite the bot to your server with the following permissions:
    • Manage Channels
    • Send Messages
    • Create Instant Invite
    • View Channels

Database

The system uses SQLite with the following schema:

CREATE TABLE talk_submissions_1 ( id INTEGER PRIMARY KEY AUTOINCREMENT, speaker_name TEXT NOT NULL, talk_context TEXT NOT NULL, is_on_behalf BOOLEAN NOT NULL, discord_channel_id TEXT, discord_invite_link TEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP );

API Endpoints

  • POST /api/submissions - Submit a new talk proposal
  • GET /api/submissions - Get all submissions (admin)
  • POST /api/discord/test - Test Discord integration (creates test channel and sends message)

Discord Integration Status

โœ… Discord integration is fully implemented with comprehensive logging

The system will automatically:

  • Create Discord channels for each talk submission
  • Generate invite links for the channels
  • Post notifications to the organizers channel

Comprehensive Logging: The system includes detailed logging throughout the Discord integration process:

  • ๐Ÿ” Environment variable checks on startup
  • ๐ŸŽฏ API request tracking with submission details
  • ๐Ÿ”ง Discord channel creation with API responses
  • ๐Ÿ”— Invite link generation with full details
  • ๐Ÿ“ข Organizer notifications with message content
  • ๐Ÿ’ฅ Detailed error logging with stack traces and specific Discord error codes
  • ๐Ÿ“Š Final result summaries

Fallback behavior: If Discord credentials are not provided, the system will use placeholder values and log what would have been done, allowing the form to still function for testing.

Debugging: Use the requests tool to view detailed logs of each submission, including all Discord API interactions and any errors that occur.

Usage

  1. Fill out the talk submission form
  2. Submit the form
  3. Receive a Discord invite link
  4. Join the Discord channel to discuss your talk with organizers

Tech Stack

  • Backend: Hono (API framework)
  • Frontend: React 18.2.0 with TypeScript
  • Database: SQLite
  • Styling: TailwindCSS
  • Platform: Val Town (Deno runtime)
HTTP
  • index.ts
    mrojas54--3fโ€ฆec.web.val.run
Code
backendfrontendshared.vtignoreAGENT.mdBRAND_STYLE_GUIDE.mdREADME.mddeno.jsonmain.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
ยฉ 2025 Val Town, Inc.