This repository is part of a group project in program development in virtual team course (Vteam) at Blekinge Institute of Technology. The group project consists of several parts, and this is one of them, which we call The intelligence of the scooter.
There are two ways to get the system running: either you start all components (backend, frontend (admin), mobile app, customer webclient and scooter program) locally, or you use the dockerized version.
Your system must have Docker enabled.
You can run the beta version of the scooter program which is not connected to the API or database. And it is the user mode.
docker run -it ranim04/spark-program:beta
You can run the main or simulation program connected to the API, but you need to run the backend before running the program. This program is part of a large system. You can find all subsystems along with docker-compose.yml in this repository.
# User mode
docker-compose run spark-program
# Simulation
docker-compose run spark-simulation
Path /spark-program
Build and run main program
docker build -f Dockerfile_main -t main-program .
docker run --rm -it main-program
Build and run simulation program
docker build -f Dockerfile_simulation -t simulation-program .
docker run --rm -it simulation-program
To run the scooter program locally, you need Python, Pip and venv installed on your machine. You can install venv by running:
- For Cygwin
apt-cyg install python3-virtualenv
- For Linux
apt-get install python3-venv
- For Brew you don't need to install anything on Mac
Then you can clone this repo, go to spark-program and run:
make venv
source .venv/bin/activate
make install
You can deactivate venv by running: deactivate
Run python3 main.py to start a User mode, which means a menu of options will appear for the user to choose what to do, the program will ask the user to enter the scooter id, if the scooter is available then a menu of options will appear, and the rental time will begin.
Run python3 simulation.py to start a Simulation mode, which means 1000 customers and 1000 scooters will be simulated.
Run all tests in src/ with this command:
make test
You can run pylint with make lint
and to review code coverage you can run make coverage
.
To run all commands above and generate code coverage report in HTML format, run:
make test-all