7.9 KiB
7.9 KiB
Project Checklist (tidy & current)
Below are implemented features and pending items, grouped by area.
Backend
- Express API: OAuth, server settings, channel/role endpoints, leave
- Invite endpoints (GET/POST/DELETE) and invite-token issuance
- Per-command toggles persistence and management
- Config endpoints for welcome/leave and autorole
Frontend
- Login, Dashboard, Server Settings pages
- Login redirects to Dashboard after OAuth and user/guilds are persisted in localStorage
- Dashboard is protected: user must be logged in to view (redirects to login otherwise)
- MUI components, responsive layout, mobile fixes
- Theme switching (persist local) and user settings UI
- Invite UI: create form, list, copy, delete with confirmation
- Commands UI (per-command toggles)
- Live Notifications UI (per-server toggle & config)
- Channel selection, watched-user list, live status with Watch Live button
- Real-time updates: adding/removing users via frontend or bot commands publishes SSE
twitchUsersUpdateand pushes settings to bot - Bot commands (
/add-twitchuser,/remove-twitchuser) refresh local cache immediately after backend success - Message mode: toggle between Default and Custom; Apply sends
message/customMessage(default fallback if empty); no longer dual free-form fields - Collapsible accordion interface: separate Twitch and Kick tabs (Kick tab disabled)
Discord Bot
- discord.js integration (events and commands)
- Slash commands:
/create-invite,/list-invites,/manage-commands,/help - Bot used by backend to fetch live guild data and manage invites
- Bot reads/writes per-guild command toggles via backend/Postgres
- Backend immediately notifies bot of toggle changes (pushes updated settings to bot cache) so frontend toggles take effect instantly
- New slash command:
/setup-liveto enable/disable Twitch live notifications for the server (preserves other settings) - Frontend: Confirm dialog and working Delete action for Twitch watched users in Live Notifications
- Live Notifications: bot posts message to configured channel with stream title and link when a watched Twitch user goes live
- Live Notifications: bot posts rich embed to channel when a watched Twitch user goes live (thumbnail, clickable title, bio/description, category/game, viewers, footer with "ehchadservices" and start datetime)
- Live Notifications polling frequency set to 5 seconds (configurable via
TWITCH_POLL_INTERVAL_MS) - On bot restart, sends messages for currently live watched users; then sends for new streams once per session
- Frontend: show "Watch Live" button next to watched user when they are live (links to Twitch)
- Bi-directional sync: backend POST/DELETE for twitch-users now also pushes new settings to bot process (when
BOT_PUSH_URLconfigured) - Bot adds/removes users via backend endpoints ensuring single source of truth (Postgres)
- Live notifications toggle on site enables/disables watching and publishes SSE for real-time updates
- /manage-commands command has enable/disable buttons that sync with frontend via backend API and SSE for live updating
- All Twitch-related commands (add, remove, list) and frontend actions communicate with backend and Postgres database
- Bi-directional sync: backend POST/DELETE for twitch-users now also pushes new settings to bot process (when
- Welcome/Leave messages: bot sends configured messages to channels when users join/leave
- Welcome messages with {user} and {server} placeholders
- Leave messages with {user} placeholder
- Autorole assignment on member join
- All settings managed through Server Settings UI
- Event handlers properly integrated with API settings
- Kick live notifications bot integration (temporarily disabled)
- New slash commands:
/add-kickuser,/remove-kickuser,/list-kickusers(commands exist but watcher disabled) - Kick API polling and notification posting (watcher removed, API endpoints remain)
- Per-server Kick user management via backend API (endpoints functional)
- Frontend tabs: separate Twitch and Kick tabs in Live Notifications accordion (Kick tab disabled)
- Bot watcher temporarily disabled in index.js startup
- New slash commands:
- Dev command filtering: commands marked with
dev: trueare hidden from UI, help, and Discord registration
Database
- Postgres support via
DATABASE_URL(backend auto-createsservers,invites,users) - Legacy encrypted
backend/db.jsonretained (migration planned) - Kick.com live notifications: backend API, frontend UI, bot integration
- Database schema: kickUsers table with userId, username, guildId
- API endpoints: GET/POST/DELETE /api/servers/:guildId/kick-users
- Bot commands: /add-kickuser, /remove-kickuser, /list-kickusers
- Frontend tabs: separate Twitch and Kick tabs in Live Notifications accordion
- Kick API integration: polling for live status, stream metadata, web scraping fallback for 403 errors
- Per-server configuration: all settings scoped by guildId
- Schema: live notification settings stored in server settings (via
liveNotificationsJSON)- Fields:
enabled,channelId,users[],kickUsers[],message,customMessage(custom overrides default if non-empty) - Users list preserved when updating other live notification settings (fixed: kickUsers now also preserved)
- Fields:
Security & Behavior
- Invite DELETE requires short-lived HMAC token (
x-invite-token) - Frontend confirmation dialog for invite deletion
- Harden invite-token issuance (require OAuth + admin check)
- Template variables for messages (planned): support
{user},{title},{category},{viewers}replacement inmessage/customMessage
- Template variables for messages (planned): support
Docs & Deployment
- README and CHANGELOG updated with setup steps and Postgres guidance
- Core env vars:
DATABASE_URL,DISCORD_CLIENT_ID,DISCORD_CLIENT_SECRET,DISCORD_BOT_TOKEN,INVITE_TOKEN_SECRET,ENCRYPTION_KEY,HOST,PORT,CORS_ORIGIN - Frontend: set
REACT_APP_API_BASEto backend URL before build - Tailscale: bind backend to your tailnet IP (100.x.y.z) and set
DATABASE_URLto a Postgres reachable over the tailnet
Notes:
backend/.env.exampleandfrontend/.env.exampleare templates — copy to.envand fill values.- Postgres / pgAdmin: create DB & user, set
DATABASE_URL; backend auto-creates tables on startup.
UI tweaks applied:
-
Server cards: uniform sizes, image cropping, name clamping
-
Mobile spacing and typography adjustments
-
Dashboard action buttons repositioned (Invite/Leave under title)
-
Live Notifications: collapsible accordion with tabbed interface for Twitch and Kick tabs (Kick tab disabled)
-
Browser tab now shows
ECS - <Page Name>(e.g., 'ECS - Dashboard') -
Dashboard duplicate title fixed; user settings (avatar/themes) restored via NavBar
-
Maintenance page
-
Frontend displays a maintenance page with a loading indicator when the backend is offline; it polls the backend and reloads UI immediately when the backend is available.
- Global backend health & SSE
- Added
BackendContextto centralize health polling and a single shared EventSource - Pages (including
ServerSettings) use the shared event bus for live updates so the whole site receives changes in real-time - Frontend file re-organization
- Verify guild-scoped SSE payloads include guildId and frontend filters events by guild (in-progress)
- Add debug SSE publish endpoint to help validate real-time flows (done, guarded by DEBUG_SSE)
- Created
frontend/src/lib/api.jsand refactored some modules to use it - Created
frontend/src/components/commonandfrontend/src/components/server - Moved
ConfirmDialogandMaintenancePagetocomponents/common - Moved
ServerSettingsandHelpPagetocomponents/server - Fixed ESLint warnings: removed unused imports and handlers, added proper dependency management
- Remove legacy top-level duplicate files (archival recommended)
- Created
- Added
- Global backend health & SSE