{"id":17034855,"url":"https://github.com/almet/copanier","last_synced_at":"2025-04-12T12:52:31.480Z","repository":{"id":39390681,"uuid":"247129494","full_name":"almet/copanier","owner":"almet","description":"A minimalist collective buying software.","archived":false,"fork":false,"pushed_at":"2023-10-20T11:49:04.000Z","size":1240,"stargazers_count":24,"open_issues_count":34,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T07:36:33.481Z","etag":null,"topics":["community-buying","delivery","food-hubs","joint-buying-association","pay","purchasing","purchasing-system","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/almet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-03-13T17:43:51.000Z","updated_at":"2024-09-11T13:47:49.000Z","dependencies_parsed_at":"2023-09-07T21:45:33.305Z","dependency_job_id":"bcaca5fc-524d-49d8-8247-8b7af978809c","html_url":"https://github.com/almet/copanier","commit_stats":null,"previous_names":["almet/copanier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almet%2Fcopanier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almet%2Fcopanier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almet%2Fcopanier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almet%2Fcopanier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/almet","download_url":"https://codeload.github.com/almet/copanier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571608,"owners_count":21126520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["community-buying","delivery","food-hubs","joint-buying-association","pay","purchasing","purchasing-system","python"],"created_at":"2024-10-14T08:44:46.576Z","updated_at":"2025-04-12T12:52:31.461Z","avatar_url":"https://github.com/almet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Copanier\n\nCopanier is a software to make grouped orders. It's generally used by small groups\nwho want to buy food supplies directly from producers, without requiring each\nindividual to see each producer.\n\nIt helps people to order a set of defined products, and provide a few helpers\nto ease the life of everyone involved :-)\n\n## How does it work?\n\n1. A new delivery is created ;\n2. Producers and products are created in the software (or copied from a past delivery) ;\n3. (Optional : prices are checked with the producers to be sure they are still okay) ;\n4. Individuals place their orders for their groups ;\n5. Referents ask their producers for the products and pay them ;\n6. There is a delivery - the tool provides summary of who ordered what ;\n7. A dispatch of who has to pay whom is done ;\n8. XXX\n9. ... Profit !\n\n## Features\n\n- Handles groups of people (useful for people sharing a house) ;\n- Handles multiple producers in one delivery ;\n- Intelligent dispatching of payments, without any central bank account ;\n- Support for shipping fees ;\n\n## Screenshots\n\n![Login screen](/screenshots/login.png?raw=true)\n![Login screen](/screenshots/groups.png?raw=true)\n![Login screen](/screenshots/place-order.png?raw=true)\n![Login screen](/screenshots/order-confirmation.png?raw=true)\n![Login screen](/screenshots/payments.png?raw=true)\n\n## Philosophy\n\n- Keep things simple.\n- Do not rely on JavaScript (or the less possible)\n- Lower the cost of maintainance of the project\n\n## FAQ\n\n### How files are stored? Does this rely on a database?\n\nThe current implementation of copanier doesn't need an external database, and relies on YAML files instead. It's done to keep things simple and easy to work with / backup, and we believe the needs for a database are very little, since we would very rarely have multiple writes at the same time.\n\n### How is it different from cagette?\n\n[Cagette](https://www.cagette.net) is a free software which aims at solving a larger problem that what we're solving. Cagette has a more general approach, providing a tool that can be used by groups of producers, AMAPs, people having a physical store, and group of consumers.\n\nIn copanier, we only focus on groups of consumers. We want to keep things as straightforward and effective as possible, by keeping the problem small. We do one thing and we try to do it the best way we can! We believe copanier is better suited for people who want to organise the way we do, but if copanier doesn't fit your needs, cagette might :-)\n\n## Install copanier locally\n\n### Get the system dependencies\n\nYou might need to install some system dependencies. On\n[Debian-based](https://www.debian.org) systems, you can install the\ndependencies with this command:\n\n```bash\nsudo apt install python3-dev python3-venv python3-pip libcairo-dev libpango1.0-dev\n```\n\nThe project relies on Python 3.7+, so if you don't have it yet, here's your\nchance!\n\nOne way to install it is to use [pyenv](https://github.com/pyenv/pyenv):\n\n```bash\npyenv install 3.7.1\npyenv global 3.7.1\n```\n\n### Install copanier\n\nWe recommend to use virtualenv so everything is installed separately from the\nrest of the system:\n\n```bash\n# Get the source code locally\ngit clone https://github.com/spiral-project/copanier.git\ncd copanier\n\n# Create the virtualenv\npython -m venv venv\n# On some systems, you might need to specify \"python3.7 -m venv venv\"\n\n# Activate it!\nsource venv/bin/activate\n\n# install everything!\npip install -e .\n```\n\n### Running in docker\n\nFor this, you need to have [docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/) installed.\n\nTo give a try to Copanier quickly, you can use docker:\n\n```bash\ncd docker\nsudo docker-compose -p copanier up\n```\n\nThe app will be available at http://localhost:2244.\n\nDatabase is saved under `db` folder. This folder is mounted in `app` container to persist data changes on host disk.\n\nFor development purpose, you can use both `docker-compose.yml` and `docker-compose-dev.yml` which allows you to work on copanier source code and make gunicorn automatically reload workers when code changes:\n\n```bash\nsudo docker-compose -p copanier -f docker-compose.yml -f docker-compose-dev.yml up\n```\n\n## Run local server\n\nOnce everything is installed, you can use the `copanier` command to run the server.\n\nMake sure venv is active, then:\n\n```bash\ncopanier serve\n```\n\nOptionally autoreload the server when you change a python file (needs `hupper`):\n\n```bash\ncopanier serve --reload\n```\n\nThen browse to [http://localhost:2244](http://localhost:2244)\n\n## Run the tests\n\nIf you want to contribute, don't hesitate! In this case, it might be helpful to\ninstall a few other dependencies.\n\n```bash\npip instal -e .[test]\n```\n\nThen, to run the tests:\n\n```bash\n# install the required dependencies for dev\npip install -r requirements-dev.txt\n# run the tests\npy.test tests\n```\n\n## Configuration\n\nCopanier uses environment variables to configure its behaviour. All the configuration flags are specified in [this config.py file](https://github.com/spiral-project/copanier/blob/master/copanier/config.py) and in order to use them, you will need to set them, considering their name starts with `COPANIER_`.\n\nOne simple way to handle this behaviour, is to have a `config.env` file and source it (with `source config.env`) before starting the server. Here is how this file could look like:\n\n```bash\nexport COPANIER_SITE_URL=\"https://yourdomain.com\"\nexport COPANIER_SITE_NAME=\"Your site name\"\nexport COPANIER_SITE_DESCRIPTION=\"Site long description\"\nexport COPANIER_XLSX_FILENAME=\"crac-produits\"\nexport COPANIER_SEND_EMAILS=True\nexport COPANIER_SMTP_HOST=\"mail.gandi.net\"\nexport COPANIER_SMTP_PASSWORD=\"something\"\nexport COPANIER_SMTP_LOGIN=\"yourlogin\"\nexport COPANIER_FROM_EMAIL=\"youremail@tld.com\"\nexport COPANIER_DOMAIN=\"tld.com\"\nexport COPANIER_EMAIL_SIGNATURE=\"The team\"\nexport COPANIER_STAFF=\"staff@email.com another@staff.com\"\n```\n\n## Deployment\n\nIf you're running the application locally, then just running it with `copanier serve` might be enough, but if you want to deploy it in production, the best way to make this run is to rely on a WSGI server. One good option is [gunicorn](https://gunicorn.org).\n\nYou can run it with this command:\n\n```bash\ngunicorn -k roll.worker.Worker copanier:app --bind [$IP]:$PORT\n```\n\n## Installation on AlwaysData\n\n[AlwaysData](https://alwaysdata.net) has a free plan capable of hosting copanier. Here are the steps to install there :\n\n1. Create a free account\n1. Connect via ssh\n1. `git clone https://github.com/spiral-project/copanier.git`\n1. Create the venv with `python3.9 -m venv venv` (using python 3.9 right now to avoid issues with cython)\n1. Create a `copanier.env` and `runserver.sh` file with the contents below\n\n```env\nexport COPANIER_SITE_NAME=\"Copanier\"\nexport COPANIER_SITE_URL=\"https://xxx.alwaysdata.net\"\nexport COPANIER_SITE_DESCRIPTION=\"Copanier\"\nexport COPANIER_XLSX_FILENAME=\"produits\"\nexport COPANIER_SEND_EMAILS=True\n\nexport COPANIER_SMTP_HOST=\"xxx\"\nexport COPANIER_SMTP_PASSWORD=\"xxx\"\nexport COPANIER_SMTP_LOGIN=\"xxx\"\n\nexport COPANIER_FROM_EMAIL=\"xxx\"\nexport COPANIER_EMAIL_SIGNATURE=\"Copanier\"\nexport COPANIER_STAFF=\"\"\n```\n\n```bash\n#!/bin/bash\nsource copanier.env \u0026\u0026 /home/copanier/venv/bin/gunicorn -k roll.worker.Worker copanier:app --bind [$IP]:$PORT\n```\n\nThen in the admin pannel create a website with a custom script that runs\n`/runserver.sh` and another site which points to the static files. You should\nbe good to go.\n\n## Fork\n\nThis project is a continuation of the work done by [Yohan](https://framagit.org/ybon/copanier),\non top of which we added the notion of groups, multiple producers, payment repartition etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmet%2Fcopanier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falmet%2Fcopanier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmet%2Fcopanier/lists"}