• Stars
    star
    184
  • Rank 209,187 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ’ต โœ‚๏ธ Track shared expenses in a group of people

Payshare

A web app to track shared expenses in a group of people.

Build Status Codacy Badge

Payshare is the equivalent of a whiteboard in the kitchen of your shared flat where everyone writes down how much they paid for groceries, who paid the cinema ticket or pizza for whom and so on, while it does the math for you to figure out who should buy the next round.

Demo

You can login using the password demo here.

License

MIT, see LICENSE.txt

Screenshots

Terminology

  • Collective: This is basically your shared flat, sports team, whatever
  • User: A person that can be a member of one or more Collectives
  • Membership: The connection of a User to a Collective
  • Purchase: A User bought something and the cost is shared equally in the Collective
  • Liquidation (named "Outlay" in the frontend): Some User gave money to another one and that debt will have to be paid back later

Development Setup

If you want to setup and run the project yourself, follow these steps (assuming you are on a Unix OS):

Backend

  • Make sure you have Python 3.x installed
  • Clone the project and cd into its root directory
  • $ virtualenv venv
  • $ source venv/bin/activate
  • $ pip install pip-tools
  • $ pip-sync
  • $ python manage.py migrate
  • $ python manage.py createsuperuser
  • $ python manage.py runserver

Frontend

Make sure to have npm or yarn installed globally

  • $ cd payshare/purchases/static/client
  • $ yarn/ $ npm install
  • $ npm run serve

Creating initial Data

The project currently relies on the Django admin pages to create new Collectives and Users and add Memberships between them.

Assuming your Django dev-server is running at the default port, go to:

https://localhost:8000/admin

  • Create a Collective and set a password for it
  • Create some Users (username is the only field that is displayed. Django requires us to set a password here, but you can just give any, it isn't used)
  • Create Memberships for those Users in your Collective

The URL for your collective will be e.g. http://localhost:8000/<collective-key>. You can get the key from the admin pages. Send the URL (and the Collective's password of course) to everyone you want to participate, they will be asked to choose a User when logging in for the first time.

You can also assign an avatar for each user by assigning some URL to a hosted image (there is no own upload feature, sorry). You can do that in the User profiles area in the admin pages. There are many avatar generators, I like these:

A Note about Security

The whiteboard metaphor is valid: Anyone with a "key" to your flat (aka password for the Collective) can create and delete content or impersonate other Users. It's based on trust between the people in the group.

Tech Stack

Project is build with Django 2.1, Django-REST-Framework 3, Vue 2.5, vue-cli-3 and the wonderful Vuetify 1.1.0. It is build mainly to be used on a mobile phone, but responsive and very usable on desktop as well. Technically it is a PWA, but right now that is only used to cache the app shell, not any API responses. Uses SQLite as its database, creating a single file for easy backup.

Deployment

Oh the joy of deploying custom web apps to your own server. Our backend can be setup as a systemd service that runs a WSGI app via gunicorn, whereas the frontend is built into a bundle of static files that our nginx webserver can serve.

Building the Frontend

  • $ cd payshare/purchases/static/client
  • Update the src/store.js apiBaseUrl as needed, depending where your API lives on.
  • $ npm run build
  • $ cd -
  • $ python manage.py collectstatic --noinput
  • Copy the results from public to a folder that your webserver knows, e.g. /var/www/payshare
  • Configure your webserver and systemd, see below
  • Don't forget to install gunicorn: $ pip install gunicorn

Please see the following files for examples on simple systemd and nginx configurations:

Notes: We should use https in any case, but it is also a requirement for the service-worker. One specialty about location blocks here is that for some we'll want to pass through the URL path and for others we don't.

Image Hosting (e.g. avatars)

You can upload images within the admin page using Filer which is particularly helpful to upload avatars to use within the UserProfile model. Any URLs that may have been used to create the avatar can be stored in the 'description' field of the image so it can be used later on.

Images are hosted efficiently by making use of Whitenoise, so there is no need to configure your webserver for it in addition.

Paypal.me Integration

Well, integration is a big word. You can set a paypal.me username in the profile of each User and the app will show a button on the cashup page to open a tab in the browser with the correct amount for that payback action.

More Repositories

1

qtnodes

๐Ÿ”€ Node graph visualization and editing with PySide.
Python
149
star
2

sublime3dsmax

๐Ÿ“ž MAXScript support and remote code execution in 3ds Max from Sublime.
Python
77
star
3

imagecomphelper

โœ๏ธ Image composition utility to frame camera shots in 3ds Max.
MAXScript
24
star
4

interactive-universal-renamer

๐Ÿ–Š๏ธ Renaming script for 3ds Max
MAXScript
9
star
5

maxtest

๐Ÿ“ˆ MAXScript unittesting framework.
MAXScript
8
star
6

maxjob

๐Ÿ“ข Whiteboxed maxscript execution from the commandline.
Python
5
star
7

convict_conditioning_training

๐Ÿ’ช Progress tracker for the convict-conditioning exercises by Paul Wade
Elm
4
star
8

mxs_types

๐Ÿ“š MAXScript datatypes for convenient development.
Groff
4
star
9

steamwhat

๐Ÿš‚ Tells you which games are shared between multiple Steam users.
HTML
3
star
10

vscode-toggle-max-editor

TypeScript
2
star
11

catflap

Where is my cat? ๐ŸŒณ ๐Ÿ˜บ ๐Ÿšช
Python
2
star
12

hunt_showdown_outfitter

๐Ÿค ๐ŸŽ›๏ธ Manage and equip loadouts for Hunt: Showdown via UI automation
HTML
2
star
13

hunt_showdown_trait_presets

Python
2
star
14

cbuelter-website

Python
1
star
15

voice_to_text

๐Ÿ“ข ๐Ÿ“„ Transcribe shared voice messages using openai/whisper
Python
1
star
16

vscode-list-opened-files-as-text

TypeScript
1
star
17

booksread

Python
1
star
18

vscode-toggle-nested-html-comments

Like Toggle Line Comment, but preserves nested HTML comments
TypeScript
1
star
19

yt2web

Cache a playlist with a minimal player interface
HTML
1
star
20

the-people-around-you

Vue
1
star
21

weeklygoal

๐Ÿ“† Weekly activity goal tracker
Python
1
star
22

gamedoodle

๐ŸŽฎ โ˜‘๏ธ Web app to vote on games to play
Python
1
star
23

fritzbox-thermostat-triggers

Python
1
star
24

slbsl

๐Ÿ“Ž Convert paths from Windows to UNIX and vice versa.
Python
1
star
25

fritzbox_thermostats

๐Ÿ”ฅ โ›„ Define rules to control the radiators
Python
1
star
26

idaho-journal

๐Ÿ“™ My own private journal
TypeScript
1
star
27

pacer

Android application to calculate distance, time, speed and pace for runners.
Java
1
star