Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.
/ the-button Public archive

A simple multiplayer browser game inspired by Reddit's own Button, hosted at button.quest. When players press the button, they get points proportional to how long it's been since the button has been pressed.

Notifications You must be signed in to change notification settings

dylancdavis/the-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

184 Commits
 
 
 
 
 
 

Repository files navigation

A simple multiplayer browser game inspired by Reddit's own Button, previously hosted at button.quest. When players press the button, they get points proportional to how long it's been since the button has been pressed.

The application is built on React and Express and uses WebSockets to provide realtime updates on other player's presses. Supabase provides easy access to a PostgreSQL database to store player data, with Fly.IO for easy deployment. While the frontend can be run independently, the backend expects it to be built and stored in a build/ folder that it can then serve from, and the frontend expects to be able to make API requests to the same server it's hosted from.

Development

First, build the frontend:

  • cd frontend
  • npm install
  • cd ../backend
  • npm run build:ui

Then, run the backend:

  • Create the file backend/.env (if it does not already exist)
  • Add the database's key as SUPABASE_KEY=<key> to .env
  • npm install
  • npm run start

To reload changes, re-run npm run build:ui and npm run start

Deployment

  • Install flyctl: curl -L https://fly.io/install.sh | sh and follow directions in the prompt
  • Build and deploy: npm run deploy:full
  • Or, individually: npm run build:ui and then npm run deploy

Useful Fly.io commands:

  • Connect to the deployed instance: fly ssh console
  • Get the current database file: fly sftp get ./data/db.json

About

A simple multiplayer browser game inspired by Reddit's own Button, hosted at button.quest. When players press the button, they get points proportional to how long it's been since the button has been pressed.

Resources

Stars

Watchers

Forks

Packages

No packages published