/caixa-enginyers-mes-aprop

UAB The Hack - Caixa Enginyers Challenge, 2n prize winners. Challenge: generate a route for some vans to visit some cities in Catalunya with restrictions.

Primary LanguageBladeOtherNOASSERTION

UAB The Hack 👾 - Caixa Enginyers Challenge 🚐 💰

hack

caixa

Our team has participated in the Hackathon hosted by Universitat Autònoma de Barcelona, where we implemented a solution for the project presented by Caixa Enginyers.
Grup Caixa Enginyers is a cooperative credit and financial services entity, offering a wide range of banking, financial, and insurance solutions.

The challenge

Design a software capable of proposing optimized routes for a mobile office (van) which visits a set of municipalities. Everything satisfying some restrictions, like the working day, going to some places on certain days of the month, and having only 4 vans. The routs had to obey some requirements for the contest organized by the Generalitat de Catalunya, which can be found here.

Authors logo

  • Arnau Claramunt
  • Jaume López
  • Pay Mayench

GitHub followers    GitHub followers    GitHub followers



Note

Project Technologies and Tools

Here is the summary of the technologies and tools utilized in our project:

  • Python: Leveraged for the backend development.
  • Laravel (php): Main framework for the web application development.
  • Tailwind (CSS): Used for efficient and flexible styling in the web.
  • Flask: For building the APIs.
  • Pandas: Employed for data manipulation and analysis, and working with .csv files.
  • OpenStreetMap: Integrated for rich mapping functionalities.
  • Leaflet: Employed for the interactive map in our web.
  • ngrok: Utilized for secure tunneling to connect IPs.



Table of Contents

  1. Project Overview
  2. Challenges we ran into
  3. Project Setup
  4. Learning
  5. Next
  6. Screenshots
  7. Licence

Project Overview

We devided the work in forntend and backend. For the forntend we build a web with Laravel (php). And backend with Python and Flask, modeling the Algorithm.

Challenges we ran into

Finding a good modelizations and algorithm. Also the heuristic for calculating the optimal routes. Work with new frameworks, and moreover having to calculate distances from all pairs of cities. And little details like correcting the names of the dataset of small cities so the API recognised them inside Spain.

Project Setup

First of all, we need to run the solver in order to compile its results into a readable json file:

To do that, we'll need to create a virtualenviroment and install all the requirements

cd ./solver
virtualenv env --python=python3.10
source env/bin/activate
pip install -r requirements.txt

Once created, we'll run the solver once and then, enable the FlaskAPI service to allow access to the json computed file (that contains all events in the correct order) to the backend (Laravel).

python3 solver.py

Now, run the FlaskAPI service:

cd ./web_server
python3 app.py

Once having the FlaskAPI service up, we'll need to enable the backend service (Laravel) with PHP 8.3.6

cd ../../web
composer install

Once installed all dependencies, now we can create a .env file by copying the .env.example and configuring all the standard credentials (we'll only need to set up the database section if needed, by default uses Sqlite3)

Don't forget to add the DATA_URI credential with the value of the host of the FlaskAPI e.g. DATA_URI="http://127.0.0.1:5000/" if running in the same machine on port 5000.

If using in different devices, use ngrok. (We used it for the demo)

php artisan migrate
php artisan serve

In another terminal, we'll launch the frontend active CSS compiling service using tailwindcss, (for development purposes)

cd .. && npm install

To recompile every time any file gets changed:

npm run dev

To create a production css-compiled snapshot:

npm run build

Now, you're ready to go and all services are up!

You can enjoy the responsive web-app at 127.0.0.1:8000 (probably), or see the php artisan serve section and check which port is running on.

Learning 🎓

We paractised and learned Technologies and Tools, like Python for all the backend and data processing. Laravel (php): the main framework for the web application development. Tailwind (CSS): Used for efficient and flexible styling in the web. Flask: For building the APIs. Pandas: Employed for data manipulation and analysis, and working with .csv files. OpenStreetMap: Integrated for rich mapping functionalities. Leaflet: Employed for the interactive map in our web. Ngrok: Utilized for secure tunneling to connect IPs. Also working with APIs, and little thinks like improving the quality of the readme in Github.

What's next for Caixa Enginyers mes a prop

Send SMS messages to the users so they can answer the feedback forms. Improve the feedback data collections and improving of the routes.

Screenshots

d b e Screenshot from 2024-05-20 14-49-31

License ⚖️

Creative Commons Attribution Non Commercial No Derivatives 4.0 International