In Kenya, heavy traffic is experienced around school zones during peak pick-up and drop-off times. This often leads to congestion around these areas as most schools cannot accomodate this large number of vehicles. The project therefore aims to reduce the number of vehicles accessing the school through carpooling.
This carpooling solution is made up of three main components. A client mobile app developed using Flutter which facilitates the process of scheduling carpooling across the parents of a particular school, an administrator panel built with Laravel which allows, and a Flask API for route similarity calculation and matching.
.
│
├── route_similarity_algorithm --> Route Similarity API
│ ├── app.py
│ ├── requirements.txt
├── school_pool_admin --> Admin Side Web Dashboard
│ ├── (Laravel Framework Files)
├── school_pool_mobile --> Client Side Mobile Application
│ ├── (Flutter Framework Files)
This has been built using Laravel and has made use of Jetstream and the AdminLTE template. The Administrator System also exposes an API at /api/verify
which verifies a user is authorized to use the platform.
These instructions will guide you on how to set up and run the API on your local machine.
Before getting started, make sure you have the following software installed on your machine:
- PHP (>= 8.0.0)
- Composer
- MySQL (or any other laravel-supported database SQL database)
- Clone the repository:
git clone https://github.com/AsavaAsava/SchoolPool-CSP1.git
- Navigate to the Laravel directory
cd ./school_pool_admin
- Install Dependencies using Composer
composer install
- Create an
.env
file based on the availed example file.example.env
cp .env.example .env
- Configure the database by filling in the following fields in the
.env
file
DB_CONNECTION=
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
- For Password Reset Email Functionalities, connect the application to an Mail Server by filling in the following fields in the
.env
file
MAIL_MAILER=smtp
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=
- Generate application key
php artisan key:generate
- Run database migrations
php artisan migrate
- (Optional) Seed the database with sample data:
php artisan db:seed
- Start the development server
php artisan serve
The Route Similarity API is a Flask-based RESTful API that compares the similarity between two routes represented by encoded polylines as recieved from the Google Maps Routes API. It calculates the similarity score based on the haversine distance between corresponding points on the routes.
The Route Matching API is currently hosted here
To compare two routes, send a JSON Request containing encoded polylines for the two routes you would like to compare to the /compare_routes
endpoint of the API.(https://routingalgorithm-s2eiekt5ja-ew.a.run.app/compare_routes)
The JSON Request should have the following format:
{
"polyline1": "encoded_polyline_1",
"polyline2": "encoded_polyline_2"
}
The API will respond with a JSON object containing the similarity score as follows:
{
"similarity_score": 0.85
}
These instructions will guide you on how to set up and run the API on your local machine.
- Python 3.6 or higher
- pip package manager
- Clone the repository:
git clone https://github.com/AsavaAsava/SchoolPool-CSP1.git
- Navigate to the API directory
cd ./route_similarity_algorithm
- Create and Activate a virtual environment
python3 -m venv env
source env/bin/activate
- Install the required dependencies
pip install -r requirements.txt
- Run the flask application
flask run
The API will start running on http://localhost:5000
Make a POST request with a JSON Payload to http://localhost:5000/compare_routes
as described in the quickstart section
The client mobile application is available for Android.
- Ride Scheduling The platform allows Drivers to schedule their rides and parents to request for their children to be picked up.
- Live Location Tracking The platform uses the Google Maps API to provide the driver with the most efficient route. The drivers location is tracked and can be viewd by Parents whose children are on the ride during the duration of the trip.
- Live chat Parents can communicate with the driver theough the in-app chat service.
- Automatic Payment Once a ride is complete, the parent's whose children are transported are automatically billed. (Not yet implemented)
🎓 The participants in this project are undergraduate students in the School of Computing and Engineering Sciences at Strathmore University
Wayne Asava
Email: wayne.asava@strathmore.edu
GitHub: @AsavaAsava
Nathan Mbugua
Email: nathan.mbugua@strathmore.edu
GitHub: @some-casual-coder
✤ This was the semester project for the course ICS 2204 - CS Project 1, at Strathmore University