You are now viewing a rendered version of the markdown file.

Initial Setup

  1. fork https://git.sc07.company/sc07/canvas
  2. boot up wsl in windows terminal running ubuntu
  3. clone the fork into wsl
  4. run npm i --include=dev in the base of the cloned repo to download dependencies (requires node) (ideally node 20)
  5. Setup redis following this: https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-windows/

Database

  1. Install postgres using sudo apt-get install postgresql
  2. Navigate to /etc/postgresql/[VERSION (probably 14)]/main/pg_hba.conf and open it up for editing
  3. Add host all canvas 127.0.0.1/32 trust to the file above the other rules
  4. Start postgres using sudo service postgresql start
  5. Enter psql using psql -U postgres
  6. In psql mode create the database using CREATE DATABASE canvas;
  7. In psql mode create the user canvas using CREATE USER canvas WITH PASSWORD 'INSERTPASSWORDHERE';. Replace insertpasswordhere with an actual password and save it to reenter for another step
  8. IN psql mode run GRANT ALL PRIVILEGES ON DATABASE canvas TO canvas; to give the canvas user permissions in the canvas db
  9. Exit psql mode using \q

Server

  1. Create a file called .env.local in wherever you cloned to/packages/server.
  2. Give it the following text replacing INSERTPASSWORDHERE with your password from earlier
export NODE_ENV=development
export SESSION_SECRET=somesecret
export INHIBIT_LOGIN=true
export REDIS_HOST=redis://localhost:6379
export DATABASE_URL=postgresql://canvas:INSERTPASSWORDHERE@localhost/canvas
export CLIENT_ORIGIN=http://localhost:5173
export VITE_API_HOST=http://localhost:3000
export LOG_LEVEL=debug
export PIXEL_LOG_PATH=log.txt```
export PORT=3000
  1. run what you put for the database_url line in your command prompt itself for use for prisma. e.g.
export DATABASE_URL=postgresql://canvas:INSERTPASSWORDHERE@localhost/canvas
  1. run npx -w packages/server prisma generate
  2. run the server with npm -w packages/server run dev (when your cwd is set to the base of your cloned repo). Thats all you have to do to start up the server in the future now

Client

  1. Create a file called .env in wherever you cloned to/packages/client.
  2. Give it the following text
VITE_API_HOST=http://localhost:3000

# what homeserver hosts the matrix users
VITE_MATRIX_HOST=aftermath.gg

# what hostname does the element instance run on
VITE_ELEMENT_HOST=https://chat.fediverse.events
  1. Change the ownership of the /data folder in your cloned repo to yourself. e.g. sudo chown -R youruser:youruser ./data
  2. Seed the palette with npm -w packages/server run tool seed_palette
  3. Start up the client with npm -w packages/client run dev. Thats all you have to do to start up the client in the future now