The Oakville and Milton Humane Society is a non-profit organization dedicated to protecting and improving the life of animals within the community and connecting them to the communities that care about them in Oakville and Milton. We will be developing a web application that allows volunteers to sign up for pet-sitting tasks, enabling volunteers to efficiently care for multiple animals.
- Akishai Sabaratnasarma (Project Lead)
- Harry He (Developer)
- Anne Sun (Developer)
- Angela Li (Developer)
- Amanda Xi (Developer)
- Victor Chan (Developer)
- Wilson Chen (Developer)
- Daphne Huang (Developer)
Backend Language: TypeScript (Express.js on Node.js)
Backend API: REST
Database: PostgreSQL
User Auth: Opt-in
File Storage: Opt-in
- π Documentation
- π· Getting Started
- βοΈ Prerequisites
- βοΈ Set up
- π§° Useful Commands
- π³ Version Control Guide
- Starter Code
- Dev Cheatsheat (adapted from Children's Aid Society team)
- Dev Guidelines
- Install Docker Desktop (MacOS | Windows (Home) | Windows (Pro, Enterprise, Education) | Linux) and ensure that it is running
- Clone this repository and
cdinto the project folder
git clone https://github.com/uwblueprint/humane-society.git
cd humane-society- Follow steps in the Secrets section (below) to ensure that you have the following files added to your repository, with the correct environment variables set:
.envfrontend/.env
- Run the application
docker compose up --builddocker exec -it humane_society_backend /bin/bash -c "node migrate up"- Ask Project Leads for environment secrets
docker ps# run a bash shell in the container
docker exec -it humane_society_db /bin/bash
# in container now
psql -U postgres -d humane_society_dev
# in postgres shell, some common commands:
# display all table names
\dt
# quit
\q
# you can run any SQL query, don't forget the semicolon!
SELECT * FROM <table-name>;# linting & formatting warnings only
docker exec -it humane_society_backend /bin/bash -c "yarn run lint"
docker exec -it humane_society_frontend /bin/bash -c "yarn run lint"
# linting with fix & formatting
docker exec -it humane_society_backend /bin/bash -c "yarn run fix"
docker exec -it humane_society_frontend /bin/bash -c "yarn run fix"docker exec -it humane_society_backend /bin/bash -c "yarn test"We have deployed our Postgres DB on Supabase which you can connect your local application to, which can be useful for testing.
- Ask your Project Lead for the
DATABASE_URLenvironment variable which stores our Supabase connection URL and add it to.envat the root of this project.- Optionally, you can also be added to the OMHS organization on Supabase if you need to do some admin work on the deployed DB.
- Run the app against the Supabase DB
NODE_ENV=production docker compose upNote: Currently, the
humane_society_dbcontainer is also run even when you run against Supabase. You should be able to stop it if the application is correctly connected to Supabase. Additional changes can be made to stop it from running when you want to run against Supabase, involving setting another environment variable (see this PR).
- Branch off of
mainfor all feature work and bug fixes, creating a "feature branch". Prefix the feature branch name with your name. The branch name should be in kebab case and it should be short and descriptive. E.g.annie/readme-update - To integrate changes on
maininto your feature branch, use rebase instead of merge
# currently working on feature branch, there are new commits on main
git pull origin main --rebase
# if there are conflicts, resolve them and then:
git add .
git rebase --continue
# force push to remote feature branch
git push -f- Commits should be atomic (guideline: the commit is self-contained; a reviewer could make sense of it even if they viewed the commit diff in isolation)
- Trivial commits (e.g. fixing a typo in the previous commit, formatting changes) should be squashed or fixup'd into the last non-trivial commit
# last commit contained a typo, fixed now
git add .
git commit -m "fixes typo"
# fixup into previous commit through interactive rebase
# x in HEAD~x refers to the last x commits you want to view
git rebase -i HEAD~2
# text editor opens, follow instructions in there to fixup
# force push to remote feature branch
git push -f- Commit messages and PR names are descriptive and written in imperative tense1. E.g. "create user REST endpoints", not "created user REST endpoints"
- PRs can contain multiple commits, they do not need to be squashed together before merging as long as each commit is atomic. Our repo is configured to only allow squash commits to
mainso the entire PR will appear as 1 commit onmain, but the individual commits are preserved when viewing the PR.