UOA-CS732-SE750-Students-2024 / project-group-golden-giraffes

Blurple Canvas, but on the web!
https://canvas.projectblurple.com
Other
1 stars 1 forks source link

Blurple Canvas Web

Project Blurple

Project Blurple is an annual, week-long, community-run event which celebrates Discord’s anniversary. Part of this is Blurple Canvas where people in participating servers create pixel art on a shared canvas.

Blurple Canvas Web is a web alternative to the existing Discord bot Discord bot, which brings canvas to the web!

If you’d like a bit more context, we have a wiki!

🧚 Features

Viewing canvases

Placing pixels

[!NOTE] Pixel placement is only enabled for active canvases that are part of an ongoing event. Once that event ends, the canvas is locked.

Statistics

🥪 Tech stack & repo structure

This is a monorepo, with three packages:

All packages are written in TypeScript. backend talks to the same PostgreSQL as the Blurple Canvas Discord bot. Prisma serves as the ORM layer. frontend uses Axios and TanStack Query to query the backend API. Realtime canvas updates are pushed to clients with Socket.IO. Testing is conducted with Vitest. GitHub Actions handles CI.

🌱 Getting started

[!TIP] We suggest opening this project as a Visual Studio Code multi-root workspace: just open the blurple-canvas-web.code-workspace file. The workspace is configured to use the right linter and formatter, and recommends a few extensions. But, you’re welcome to use your preferred editor.

☑️ Prerequisites

[!WARNING] Windows users, these instructions assume you use WSL. You’re welcome to use PowerShell—things still work—but you’ll have to “translate” these steps for yourself.

Install Node Version Manager. If you don’t use Homebrew, see github.com/nvm-sh/nvm for other ways to install.

brew install nvm

Use the appropriate version of Node. You may be prompted to run nvm install. (If for whatever reason you aren’t using nvm, make sure to install and use the Node version specified in /.nvmrc.)

nvm use

Enable Corepack. We use pnpm to manage dependencies. We recommend using Corepack to manage your pnpm version, but if you’d prefer installing pnpm a different way, go ahead.

corepack enable pnpm

Verify pnpm is working. By now the package manager should be good to go. Double check with this command, and make sure it matches the version number specified in the root manifest file.

pnpm --version

🤫 Secrets & environment variables

The backend and frontend packages need to have some environment variables set work correctly (in /packages/backend/.env and /packages/frontend/.env, respectively). Consult the .env.example files in each of those packages to see what variables are needed, and contact one of the contributors if you need any secrets.

🚀 Build & deploy

Install dependencies. Run this from the monorepo root, and it will install dependencies for all packages.

pnpm install

Deploy! With hot-reloading:

pnpm dev

Or without:

pnpm build && pnpm start

If you want to run the front- and back-ends in different terminals[^filter]:

[^filter]: These are shorthand for pnpm --filter @blurple-canvas-web/backend dev and pnpm --filter @blurple-canvas-web/frontend dev.

# Start the back-end
pnpm -F backend dev
# Start the front-end
pnpm -F frontend dev

🤓 Contributors

Blurple Canvas Web started as a SOFTENG 750 project at Waipapa Taumata Rau. We are Team Golden Giraffes.[^teamname]

[^teamname]: Not sure we would’ve chosen this name for ourselves, though…

💌 Acknowledgements

Blurple Canvas Web wouldn’t exist without these lovely people and projects. Thanks to:

[^samuel]: Pretty sure Samuel isn’t happy about me putting him on this list. Tough cookies. —Jasper

📜 Licence

The code for Blurple Canvas Web is licensed under the Apache License, Version 2.0.