Skip to content

facttic/coopcycle-web

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoopCycle

Build Status

CoopCycle is a self-hosted platform to order meals in your neighborhood and get them delivered by bike couriers. The only difference with proprietary platforms as Deliveroo or UberEats is that this software is reserved to co-ops.

The main idea is to decentralize this kind of service and to allow couriers to own the platform they are working for. In each city, couriers are encouraged to organize into co-ops, and to run their very own version of the software.

The software is under active development. If you would like to contribute we will be happy to hear from you! All instructions are in the Contribute file.

Coopcycle-web is the main repo, containing the web API, the front-end for the website and the dispatch algorithm : Technical Overview. You can see it in action & test it here : https://demo.coopcycle.org

You can find a comprehensive list of our repos here : Our repos comprehensive list.

How to run a local instance

Prerequisites

Install Docker and Docker Compose.

OSX

Use Docker for Mac which will provide you both docker and docker-compose.

Windows

Use Docker for Windows which will provide you both docker and docker-compose. Depending on your platform, Docker could be installed as Native or you have to install Docker toolbox which use VirtualBox instead of Hyper-V causing a lot a differences in implementations. If you have the luck to have a CPU that supports native Docker you can share your hard disk as a virtual volume for your appliances.

Linux

Follow the instructions for your distribution. docker-compose binary is to be installed independently. Make sure:

Setup Google Maps API (optional)

CoopCycle uses the Google Maps API for Geocoding, as well as the Places API. You will need to create a project in the Google Cloud Platform Console, and enable the Google Maps API. GCP will give you an API token that you will need later. By default, the Geocoding and Places API will not be enabled, so you need to enable them as well (Maps API dashboard > APIs > Geocoding API > Enable, and Maps API dashboard > APIs > Places API for Web > Enable).

Run the application

Configure the environment

Copy the .env.dist file and rename it to .env. Then, a few mandatory environment variables must be declared before continuing configuring a development environment.

  • GOOGLE_API_KEY
    • A Google API key that supports Geocoding API and Places API.
  • COOPCYCLE_COUNTRY
    • Options: be, ca-bc, de, es, fr, gb, pl, ar.
  • COOPCYCLE_LOCALE
    • Options: cs, en, es, fr, pt, ca.
  • COOPCYCLE_REGION
    • Options: be, ca-bc, de, es, fr, gb, pl, ar.
  • COOPCYCLE_REGION_LAT_LNG
    • This latitude/longitude value will be used to generate restaurant seeds around that area.
  • COOPCYCLE_LEGACY_TAXES
    • When activated (1), default (french) values will be used.
    • If deactivated, taxations according to COOPCYCLE_COUNTRY will be used.

Start the Docker containers

docker-compose up

At this step, the platform should be up & running, but the database is still empty. To create the schema & initialize the platform with demo data, run:

make install

Open the platform in your browser

open http://localhost

Testing

Create the test database

docker-compose run php bin/console doctrine:schema:create --env=test

Launch the PHPUnit tests

make phpunit

Launch the Behat tests

make behat

Launch the Mocha tests

make mocha

Running migrations

When pulling change from the remote, the database models may have changed. To apply the changes, you will need to run a database migration.

make migrations-migrate

License

The code is licensed under the Coopyleft License, meaning you can use this software provided:

  • You are matching with the social and common company’s criteria as define by their national law, or by the European Commission in its October 25th, 2011 communication, or by default by the Article 1 of the French law n°2014-856 of July 31st, 2014 “relative à l’économie sociale et solidaire”
  • You are using a cooperative model in which workers are employees

About

Open source logistics platform. Only for worker-owned business.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 66.8%
  • JavaScript 14.2%
  • Twig 9.0%
  • Gherkin 6.8%
  • SCSS 2.3%
  • CSS 0.7%
  • Other 0.2%