Initial Setup
- fork https://git.sc07.company/sc07/canvas
- boot up wsl in windows terminal running ubuntu
- clone the fork into wsl
- run npm i --include=dev in the base of the cloned repo to download dependencies (requires node) (ideally node 20)
- Setup redis following this: https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-windows/
Database
- Install postgres using sudo apt-get install postgresql
- Navigate to /etc/postgresql/[VERSION (probably 14)]/main/pg_hba.conf and open it up for editing
- Add host all canvas 127.0.0.1/32 trust to the file above the other rules
- Start postgres using sudo service postgresql start
- Enter psql using psql -U postgres
- In psql mode create the database using CREATE DATABASE canvas;
- 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
- IN psql mode run GRANT ALL PRIVILEGES ON DATABASE canvas TO canvas; to give the canvas user permissions in the canvas db
- Exit psql mode using \q
Server
- Create a file called .env.local in wherever you cloned to/packages/server.
- 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
- 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
- run npx -w packages/server prisma generate
- 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
- Create a file called .env in wherever you cloned to/packages/client.
- 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
- Change the ownership of the /data folder in your cloned repo to yourself. e.g. sudo chown -R youruser:youruser ./data
- Seed the palette with npm -w packages/server run tool seed_palette
- 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