Deploy Sparkz Discord Analytics
Deploy and Host Sparkz Discord Analytics with Railway.
AnalyticsDB
Just deployed
/var/lib/clickhouse
Sparkz-Discord-Analytics
Just deployed
Deploy and Host Sparkz Discord Analytics on Railway
Sparkz Analytics is a Discord analytics stack: a silent bot, ClickHouse for storage, and a password-protected Next.js dashboard. It tracks metadata and events (members, voice, reactions, channel activity)—not message bodies. This template provisions AnalyticsDB (ClickHouse) and Sparkz-Discord-Analytics together. You supply Discord credentials (DISCORD_BOT_TOKEN, DISCORD_GUILD_ID), dashboard ADMIN_USERNAME / ADMIN_PASSWORD, and can use ${{secret(...)}} for NEXTAUTH_SECRET so Railway generates the session signing secret. After deploy, open the public URL, sign in, and use the draggable dashboard tiles.
About Hosting Sparkz Analytics on Railway
The app service runs start:railway: the compiled discord.js bot in the background and Next.js on PORT with 0.0.0.0. Nixpacks builds from the monorepo root (npm ci, npm run build for both workspaces). ClickHouse is reached over the private network (typically HTTP on 8123, CLICKHOUSE_SECURE=false). On first boot the bot can run DDL from clickhouse/migrations/001_init.sql against CLICKHOUSE_DATABASE (unless SKIP_SCHEMA_ENSURE=true). Health checks use /api/health. Message Content Intent stays off in Discord; the stack uses Guilds, GuildMessages, GuildVoiceStates, GuildMessageReactions, and optionally Server Members for larger servers.
Why Deploy Sparkz Analytics on Railway
Railway gives private DNS between services, a public HTTPS URL for the dashboard, and repeatable deploys from GitHub. You avoid operating ClickHouse and Node yourself while keeping analytics data in your project. Template variables can fix ports, database name, and cross-service references (${{AnalyticsDB.*}}) so new projects wire correctly without hand-copying hosts and passwords.
Dependencies for Hosting Sparkz Analytics
- A Discord application with a bot user and the intents your guild needs (see repo README for the full list).
- Node.js 20+ for build/runtime (provided by Nixpacks).
- ClickHouse (
clickhouse/clickhouse-serveror equivalent) with a volume for persistence where you want durable data. - GitHub (or your source) connected to the Sparkz-Discord-Analytics service, root directory = repo root.
Deployment Dependencies
- Monorepo root
nixpacks.toml/railway.tomlandnpm run start:railway. - AnalyticsDB variables: internal PORT 8123, PUBLIC_PORT 443,
CLICKHOUSE_DBaligned withCLICKHOUSE_DATABASEon the app. - Secrets: Discord token and guild ID;
NEXTAUTH_SECRETor${{secret(64, "abcdef0123456789")}}; ClickHouse password via${{AnalyticsDB.CLICKHOUSE_PASSWORD}}(or equivalent service name).
Common Use Cases
- Server owners and moderators who want joins, leaves, voice time, reactions, and per-channel activity without ingesting or storing message bodies.
- Privacy-conscious communities that prefer analytics on metadata only (IDs, timestamps, attachment/embed counts, flags)—no message content stored in ClickHouse.
- Single-guild focus operations: the bot targets one
DISCORD_GUILD_IDand leaves other servers, suitable for a dedicated community or brand server. - Self-hosted analytics on Railway instead of third-party Discord analytics SaaS, with data in your own ClickHouse database.
- Power users and builders who want append-only event data in ClickHouse for custom SQL, exports, or tooling beyond the bundled draggable dashboard.
Template Content
AnalyticsDB
clickhouse/clickhouse-server:25.8Sparkz-Discord-Analytics
ClapFy/Sparkz-Discord-AnalyticsDISCORD_GUILD_ID
Your Discord serverID.
DISCORD_BOT_TOKEN
Your Discord bot token.
