Skip to content

Latest commit

 

History

History
65 lines (44 loc) · 1.08 KB

README.md

File metadata and controls

65 lines (44 loc) · 1.08 KB

backend setup

  • Install all dependencies for backend
pnpm i
  • start local docker database (or use a free one like Supabase)
# you will of course have to install docker beforehand
docker compose up -d
  • setup environment variables
# adjust the values as needed.
cp .env.example .env
  • start the apps
pnpm dev

production setup

  • setup environment variables
# adjust the values as needed.
cp .env.example .env
  • ensure docker is installed
docker build . -t flatshare-backend
docker run -d --publish 3000:3000 --restart always flatshare-backend

tests

the tests are currently mainly focused around the database functions used in the assignment scheduler.

as you probably dont want to run the tests against your main database, the tests are setup to run via a different .env file, e.g. .env.test

  • setup .env.test:

    touch .env.test
    
    # content 
    DB_PASSWORD=postgres://***
  • run the tests:

    pnpm test
    # or pnpm test:watch for "hot-reloaded" tests