Skip to content

Latest commit

 

History

History
102 lines (67 loc) · 2.44 KB

File metadata and controls

102 lines (67 loc) · 2.44 KB

Setup Guide

This guide covers local installation, required environment variables, and third-party configuration.

1) Requirements

Install and prepare the following before starting:

  • Bun 1.1 or later
  • MySQL 8+ (or a MySQL-compatible provider)
  • Redis 6+
  • A Discord application (OAuth client)
  • A FiveM server for integration testing

2) Install the project

git clone https://github.com/rojinc/softora-queue.git
cd softora-queue
bun install
cp .env.example .env

After copying .env, fill in values from the sections below.

3) Database bootstrap

bunx prisma generate
bunx prisma db push

This creates or updates schema objects from prisma/schema.prisma.

4) Run locally

bun run dev

Open http://localhost:3000.

5) Environment variables

Core services

  • DATABASE_URL (required): MySQL connection string.
  • REDIS_URL (required): Redis connection string.

Auth.js / app host

  • AUTH_SECRET (required): session encryption/signing secret.
  • AUTH_URL (required): public URL of this app.

Discord OAuth

  • DISCORD_CLIENT_ID (required)
  • DISCORD_CLIENT_SECRET (required)

Discord role sync (optional)

  • DISCORD_BOT_TOKEN
  • DISCORD_GUILD_ID
  • DISCORD_ADMIN_ROLE_ID
  • DISCORD_MODERATOR_ROLE_ID (optional, if used in your workflow)

These are needed only if you want automatic role-based admin/moderator syncing.

Steam (optional)

  • STEAM_API_KEY

Runtime/network

  • PORT (default 3000)
  • HOSTNAME (default localhost)
  • ALLOWED_ORIGIN (recommended in production; used for CORS/WebSocket origin handling)

6) Discord configuration

  1. Create an application in Discord Developer Portal.
  2. Configure OAuth redirect URI:
    • local: http://localhost:3000/api/auth/callback/discord
    • production: https://your-domain/api/auth/callback/discord
  3. Create a bot and copy the token if role sync is needed.
  4. Enable Server Members Intent for role lookups.
  5. Invite the bot to your Discord server.

7) First admin access

For first-time bootstrap, either:

  • set isAdmin=true directly on your user record in the database, or
  • configure DISCORD_ADMIN_ROLE_ID and log in with a Discord account that has that role.

8) Next steps

After local setup is complete: