This repository is home to @vscubing's fullstack app.
vscubing.com: The platform for competing in virtual speedcubing: the art of solving twisty puzzles (like the Rubik's Cube) via a computer emulator controlled from the keyboard as fast as possible. For more detailed information refer to the landing page.
- Add environment variables to
.env
(see.env.example
) - You need a local DB to run the project locally. Run
bun run db:local
to create a docker container for it. This script automatically sources.env
. Make sure to have started a docker daemon, e.g.Docker Desktop
. After spinning up a local database you can runbun run db:migrate-no-legacy
for the initial migrations. - (Optional) Alternatively you can migrate with
bun run db:migrate
, but you would have to import a database backup first:psql $DATABASE_URL -f path/to/backup.sql
- (Optional) vscubing/vscubing-tnoodle is required for scramble generation. Alternatively, you could opt into "easy scrambles" on scramble creation
- (Optional) vscubing/vscubing-cron is required for cron jobs (e.g. scheduled contest creation).
- Run the project:
bun run dev
The application is hosted on a DigitalOcean
Droplet with Dokploy
.
-
production: deployed from
main
(pushing directly is restricted, only PRs are allowed, which require CI checks to pass)- Next.js app
- postgres db
- S3 backups (daily)
- vscubing/vscubing-tnoodle
- vscubing/vscubing-cron
- automatic publishing of new weekly contests
-
staging: deployed from
dev
- Next.js app
- postgres db
- vscubing/vscubing-tnoodle
- apparently, ghcr.io doesn't support fine-grained access tokens, so you have to create a "Classic" token
- when setting up a S3 Destination in Dockploy, use the format "region.digitaloceanspaces.com" for the endpoint
- when setting up Provider (docker image) with ghcr in Dockploy, set Docker Image to
ghcr.io/vscubing/vscubing-next
and registry url toghcr.io
- when setting up a staging db next to the production one, make sure to use different ports
- use
ssh -L REMOTE_PORT:localhost:LOCAL_PORT user@remote
to port to local a port from staging/production (for example, to debug a db via drizzle studio)