Safi is a web-based utility designed to simplify and automate shared expense calculations for small groups.
The application is built to eliminate the confusion and manual effort involved when groups of people (like roommates, friends, or coworkers) share costs. Users log expenses they have paid for the group, and the application calculates the most efficient way to settle all debts so that each member has contributed their equal share.
The primary goal is to provide a clear, accurate, and simple solution that prevents financial disagreements and makes living or working together easier. The key benefit is transforming a complex calculation mess into a simple clear set of who-pays-whom instructions.
Before you start, ensure you have the following installed:
- WSL (for windows)
- Docker
- MiniConda
- Python 3.13+
- black formatter
- flake8
- isort
Follow these steps to get the app running on your local machine
$ git clone https://github.com/OsamaAshraf01/Safi.git
$ cd SafiCreate your Secret .env file:
$ cp .env.example .envAction: Open .env and fill in any missing secrets (ask the Team Lead for keys).
Download and install MiniConda from here
Create a new environment using the following command:
$ conda create -n safi python=3.13Activate the environment:
$ conda activate safiInstall the requirements:
$ pip install -r requirements.txtInstall hooks
$ pre-commit installNow, Git will automatically fix your formatting when you commit code.
$ cd docker
$ cp .env.example .env- Update
.envwith your credentials.
$ cd docker
$ sudo docker compose up -d- Backend: http://localhost:5000
Check your terminal for Flask logs when running the container.
Or access through the terminal
$ docker logs safi_devWe run tests inside the Docker container to match the environment using the following commands:
- Run all tests
$ docker-compose -f docker/docker-compose.yml run --rm test_runner- Run only unit tests
$ docker-compose -f docker/docker-compose.yml run --rm test_runner pytest tests/unitIf requirements.txt gets updated you need to Rebuild the container as follows:
$ docker-compose up -d --buildif you use vscode for development, you may need to download the following extensions:
- GitHub Actions
- black formatter
- flake8
- isort