Skip to content

AsavaAsava/SchoolPool

Repository files navigation

SchoolPool

A Carpooling Solution for School Children

About the Project

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.

Table of Contents

Introduction

Folder Structure

Administration Dashboard

Route Similarity API

Client Mobile Application

Contributors

Introduction

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.

Folder Structure

    .
    │
    ├── 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)

Administration Dashboard

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.

Installation

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)
  1. Clone the repository:
   git clone https://github.com/AsavaAsava/SchoolPool-CSP1.git
  1. Navigate to the Laravel directory
   cd ./school_pool_admin
  1. Install Dependencies using Composer
   composer install
  1. Create an .env file based on the availed example file .example.env
  cp .env.example .env
  1. 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=
  1. 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=
  1. Generate application key
php artisan key:generate
  1. Run database migrations
php artisan migrate
  1. (Optional) Seed the database with sample data:
php artisan db:seed
  1. Start the development server
php artisan serve

Route Similarity API

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 lterm

Quick Start

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
}

Installation

These instructions will guide you on how to set up and run the API on your local machine.

Prerequisites

  • Python 3.6 or higher
  • pip package manager
  1. Clone the repository:
   git clone https://github.com/AsavaAsava/SchoolPool-CSP1.git
  1. Navigate to the API directory
   cd ./route_similarity_algorithm
  1. Create and Activate a virtual environment
python3 -m venv env
source env/bin/activate
  1. Install the required dependencies
pip install -r requirements.txt
  1. 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

Client Mobile Application

The client mobile application is available for Android.

Features

  1. Ride Scheduling The platform allows Drivers to schedule their rides and parents to request for their children to be picked up.
  2. 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.
  3. Live chat Parents can communicate with the driver theough the in-app chat service.
  4. Automatic Payment Once a ride is complete, the parent's whose children are transported are automatically billed. (Not yet implemented)

Contributors

🎓 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