A speedrun event submission manager.

Overview

split-decision

This is a Next.js site for managing speedrun marathon event submissions. It does these things:

  • Allow users to authenticate via Discord, list their availability, and submit games and categories to events currently accepting submissions.
  • Allow users to specify their display name, email, pronouns, and whether or not they want to publicly display their submisisons.
  • Allow admin users to add and customize events, including: start and end time, event submission period, maximum number of games and categories per game each user can submit, and genres accepted by the event.
  • Allow editing of submissions during the event submission period.
  • Display a public list of submissions.
  • Optionally require membership in a Discord server to log in and submit to the event.

Feel free to use it for your event!

Setup

When running locally, you can make a .env file at the root directory to store all of your environment variables. Do not do this in production.

Example:

DISCORD_CLIENT_ID=1234567890
DISCORD_CLIENT_SECRET=awjerio234aJba324542
DISCORD_BOT_TOKEN=bawerja234ja.segj98ioadgwer.aaOIJCAWERWERoawoeirjawoeraw3bAa
NEXTAUTH_SECRET=timeloss
DISCORD_SERVER_ID=0987654321
DATABASE_URL=postgresql://user:password@hostname:port/split-decision?schema=public

Setting up the Discord application

split-decision uses Discord for authentication to avoid requiring users to make yet another account, and because I never want to be responsible with storing passwords ever in my life.

  1. Go to the Discord Developer Portal.
  2. Create a new application and give it a name that makes sense.
  3. Copy the application ID and assign it as the DISCORD_CLIENT_ID environment variable.
  4. Go to the OAuth -> General page from the sidebar and generate a secret ID. Assign it as the DISCORD_CLIENT_SECRET environment variable.
  5. Add a redirect to https://YOUR_DOMAIN_HERE/api/auth/callback/discord. (If running locally, add a redirect to http://localhost:3000/api/auth/callback/discord).
  6. Go to the Bot page from the sidebar and add a bot to your application. Generate a token and assign it as the DISCORD_BOT_TOKEN environment variable.
  7. Navigate to https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID_HERE&permissions=0&scope=bot%20applications.commands and add the bot to your server (note the YOUR_CLIENT_ID_HERE that you need to replace in the URL).

Enabling the Discord membership requirement

If the DISCORD_SERVER_ID environment variable is set, split-decision will not allow users to log in unless they are a member of your server. You can get the server ID by enabling Developer Mode in Discord, right-clicking your server in the sidebar, and selecting "Copy ID".

Setting up the database

By default, split-decision is configured to use PostgreSQL. Other connectors should work fine as long as they're supported by Prisma, but it's up to you to configure them if you don't want to use Postgres.

This setup guide assumes you know how to set up a database in your environment. Once you have your database ready, assign the connection string to the DATABASE_URL environment variable.

In development: Run npx prisma migrate dev

In production: Run npx prisma migrate deploy

Additional production configuration

When running split-decision in production, you need to set the NEXTAUTH_URL environment variable to your domain

NEXTAUTH_URL=https://submissions.mysite.com/

In local development, this environment variable is not required.

Set the NEXTAUTH_SECRET environment variable to anything you like, as long as it's not easily guessable.

Configuration

Various aspects of the site can be configured in the root-level config.json file. You can copy the provided config-base.json provided, rename it to config.json, and edit in your own values.

heroImage (string): The URL of the image to display on the home page. This dimensions of this image should be 600x400px.

embedImage (string): The URL of the image to display in embeds. The dimensions of this image should be 1200x630px. This must be an absolute URL.

favicon (string): The URL of the site favicon. This should be a square .ico.

siteName (string): The name of the site, as displayed in the navbar and embeds. I recommend something like "My Marathon Submissions".

organizationName (string): The name of your organization.

siteDescription (string): A short description of the site for use in embeds. I recommend something like "Event submissions for My Marathon Series".

colors (object): Various configurable hex codes. This is a nested object; the keys will be displayed in path syntax for simplicity, such that a.b.c represents this structure:

{
  "a": {
    "b": {
      "c": "value"
    }
  }
}

These are kind of a mess, sorry!

colors.primary - The primary background color. This needs to be a dark color, as a lot of text is white. (again, sorry that this configurability is a disaster ight now.)

colors.accents.control - The color used for control elements, like toggles and some buttons.

colors.accents.eventItem - The color used the background of events in listings.

colors.accents.separator - The color used for form section separators. This is also sometimes used as a background color when alternating table rows.

colors.accents.alert - The background color of alerts. This should be some shade of blue for consistency with other elements that use this color.

colors.accents.link - The color for links. This should be some shade of blue for consistency with other elements that use this color.

colors.accents.activeTimeslot - The color used to show that a user has listed themselves as available during a timeslot.

colors.accents.hover.control - The background color used for control elements when they are hovered over or active.

colors.text.primary - The primary text color.

colors.text.light - A light text color for use on dark backgrounds.

colors.text.dark - A dark text color for use on light backgrounds.

colors.error.background - The background color of error alerts.

colors.error.text - The color of error description text.

colors.error.dark.background - The background color of "danger" buttons, such as those for deleting submissions.

FAQ

How do I add an admin user?

In the User table in the database, set the isAdmin field to true.

How do I export the submissions from an event?

Right now, you need to grab them from the database manually. I plan to add a CSV export shortly.

You might also like...

Work around some mobile browser's 300ms delay on the click event.

jQuery fastClick plugin Work around the 300ms delay for the click event in some mobile browsers (e.g. Android and iOS). Code based on http://code.goog

Jul 6, 2020

A lightweight normalized tap event

A lightweight normalized tap event

🚫 Retired: Tappy! Per our unmaintained repository status documentation this repository is now retired and is no longer accepting issue reports or pul

Dec 9, 2022

An event emitter that allows you to manage your global state

Thor Event Emitter Event emitter to manage your state. An event emitter that allows you to manage your global state. Instead of using global giant obj

Apr 18, 2022

Event scheduler is a simple app for viewing the events happening around you

Event scheduler is a simple app for viewing the events happening around you. User can also create their event and include a location. Location can also be marked as hidden(strictly by IV). Built with React and Styled Components

Mar 29, 2022

The invoker based on event model provides an elegant way to call your methods in another container via promisify functions

The invoker based on event model provides an elegant way to call your methods in another container via promisify functions. (like child-processes, iframe, web worker etc).

Dec 29, 2022

🏳️‍🌈 event calendar

alman-akka :rainbow-flag: event calendar Frontend The frontend of this app uses NextJS and Node 16 together with Yarn 1.x as a package manager. Develo

Mar 10, 2022

An event-driven architecture wrapper for Wechaty that applies the CQS principle by using separate Query and Command messages to retrieve and modify the bot state, respectively.

An event-driven architecture wrapper for Wechaty that applies the CQS principle by using separate Query and Command messages to retrieve and modify the bot state, respectively.

CQRS Wechaty An event-driven architecture wrapper for Wechaty that applies the CQS principle by using separate Query and Command messages to retrieve

Mar 23, 2022

Real-time event collaborating

Smartlist Collaborate Collaborate on your events in real-time! An product by Smartlist 🧪 This product is still in development, and some features mig

Mar 17, 2022

Timers for Lost Ark bosses, islands, events, wandering merchants and more! Never miss an event again.

Timers for Lost Ark bosses, islands, events, wandering merchants and more! Never miss an event again.

Timers for Lost Ark bosses, islands, events, wandering merchants and more! Never miss an event again. LostArkTimer.app Website Website Features Event

Oct 17, 2022
Comments
  • Suggestion: Increase Estimate Limit for Category Submissions

    Suggestion: Increase Estimate Limit for Category Submissions

    Currently category estimates can only go up to <24 hour runs, but for some marathons like RRLAT it may be ideal to allow for higher estimate times to be submitted.

    opened by EpicYoshiMaster 1
  • Bug: Runner Availability does not persist once the page is left

    Bug: Runner Availability does not persist once the page is left

    Reproduce Steps:

    1. Go to your Submission page for a Marathon, and select some availability times
    2. Select Return to my profile
    3. Go back to the Submission page

    Result: Availability times are reset and not saved. Expected: Availability times are saved from previous selection.

    This happens regardless of if you save games for the submission in the same session.

    opened by EpicYoshiMaster 1
  • Suggestion: Add Dedicated Submit or Update Submission Button

    Suggestion: Add Dedicated Submit or Update Submission Button

    Currently, the run submission page only allows you to save the current game you're editing (which is equivalent to updating/submitting entirely).

    It might be a good idea to consider a dedicated button for the whole submission, that way runners can tentatively create parts of their submission and have those saved, then submit everything when they are ready / update their submission later.

    opened by EpicYoshiMaster 0
Owner
May
senior speedrun overlay unreliability engineer
May
'event-driven' library aims to simplify building backends in an event driven style

'event-driven' library aims to simplify building backends in an event driven style(event driven architecture). For message broker, light weight Redis Stream is used and for event store, the well known NoSQL database, MongoDB, is used.

Sihoon Kim 11 Jan 4, 2023
A devtool improve your pakage manager use experience no more care about what package manager is this repo use; one line, try all.

pi A devtool improve your pakage manager use experience no more care about what package manager is this repo use; one line, try all. Stargazers over t

tick 11 Nov 1, 2022
Meogic-tab-manager is an extensible, headless JavaScript tab manager framework.

MeogicTabManager English document MeogicTabManager是一个有可拓展性的、headless的JavaScript标签页管理框架。 MeogicTabManager旨在提供可自由组装页面框架、自定义页面组件、甚至覆盖框架自带事件响应的开发体验。 Meogi

meogic-tech 5 Oct 8, 2022
womenify - Submission for HackViolet '22

?? Inspiration There are several websites dedicated to fashion, beauty, health care, and other topics. However, there is no dedicated website for wome

Sahil Jain 2 Feb 13, 2022
Astro 1.0 Hackathon submission

title published description tags cover_image Trying out Astro SSR & Astro 1.0 Hackaton false astro, ssr, webcomponents, hackathon https://imgur.com/lV

Pascal Schilp 26 Jan 2, 2023
Calculates dependencies for a Go build-target and submits the list to the Dependency Submission API

Go Dependency Submission This GitHub Action calculates dependencies for a Go build-target (a Go file with a main function) and submits the list to the

GitHub Actions 33 Dec 7, 2022
This is for homework submission of Filecoin Chinese Education Series - Coding with Filecoin.

Coding-with-Filecoin-Homework 课程简介 随着互联网和大数据技术的发展,我们正愈发依赖中心化的服务来存储和处理相关数据。但这背后有两个潜在的问题:用户不能完全控制自身数据的使用与传播,且很难验证公开数据的完整性与可靠性。为了解决这两个问题,新一代的协议和点对点网络已经问世

IPFS & Filecoin 15 Jul 14, 2022
Using Webpack and external API, this website saves and shows players' scores and allows the submission of new scores.

Microverse Students Leaderboard Microverse Students Leaderboard project that displays scores submitted by different students. All data is preserved in

Romina Patiño 5 Aug 19, 2022
👌A useful zero-dependencies, less than 434 Bytes (gzipped), pure JavaScript & CSS solution for drop an annoying pop-ups confirming the submission of form in your web apps.

Throw out pop-ups confirming the submission of form! A useful zero-dependencies, less than 434 Bytes (gzipped), pure JavaScript & CSS solution for dro

Vic Shóstak 35 Aug 24, 2022
Examples of how to do query, style, dom, ajax, event etc like jQuery with plain javascript.

You (Might) Don't Need jQuery Frontend environments evolve rapidly nowadays and modern browsers have already implemented a great deal of DOM/BOM APIs

NEFE 20.3k Dec 24, 2022