Skip to content

MuchokiDavid/psvqpy

Repository files navigation

PSVQ - Vehicle Queuing System (Backend)

PSVQ is a modern digital solution for managing PSV (Public Service Vehicle) queues at pickup stations in Kenya. The app streamlines the process of vehicle queuing and fee payment, ensuring efficiency and transparency.


Features

  • Digital Queuing: Manage vehicle queues in a first-come, first-served order.
  • Queue Payments: Vehicles can make queue payments directly through the app.
  • Sacco Management: Saccos can manage vehicles and queues for their stations.
  • Real-Time Updates: Track queue status and payment confirmations in real-time.
  • Role-Based Access: Separate accounts for Sacco admins and vehicle owners.
  • Secure Payments: Integration with M-Pesa, card, and other payment methods.

Tech Stack

Backend

  • Framework: Django (Python)
  • Database: PostgreSQL/SQLite
  • Authentication: OAUTH2 Tokens
  • API Design: RESTful API using Flask-RESTful

Hosting

  • Backend: Deployed on AWS/GCP/CPanel

Installation

Prerequisites

  • Python 3.8+
  • PostgreSQL/SQLite
  • Virtual Environment

Backend Setup

  1. Clone the repository:

    git clone https://github.com/muchokidavid/psvq.git
    cd psvq/backend
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate   # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up environment variables: Create a .env file in the backend directory and add:

    DJANGO_ENV=development
    DATABASE_URL=postgresql://user:password@localhost:5432/psvq
    SECRET_KEY=your_secret_key
  5. Run database migrations:

    python manage.py migrate
  6. Start the server:

    python manage.py runserver

Usage

  1. Sign Up: Create an account as a Sacco admin or vehicle owner.
  2. Add Vehicles: Sacco admins can register vehicles to their Sacco.
  3. Make Payments: Vehicle owners can pay queue fees through the app.
  4. Join Queue: Once payment is complete, vehicles can join the queue in a first-come, first-served order.
  5. Track Queue: Monitor the real-time status of the queue and get notifications when served.

API Endpoints

Endpoint Method Description
/api/saccos GET List all Saccos
/api/saccos POST Create a new Sacco
/api/vehicles GET List vehicles for a Sacco
/api/queue POST Add a vehicle to the queue
/api/payments POST Make a queue payment
/api/queue/status GET Get current queue status

Future Enhancements

  • SMS, Whatsapp and Email Notifications for queue updates.
  • Advanced analytics and reporting for Sacco performance.
  • GPS-based station mapping.
  • Integration with NTSA databases for vehicle verification.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (feature/your-feature-name).
  3. Commit your changes.
  4. Submit a pull request.

Contact

For questions or support, contact:

About

PSVQ is a modern digital solution for managing PSV (Public Service Vehicle) queues at pickup stations in Kenya. The app streamlines the process of vehicle queuing and fee payment, ensuring efficiency and transparency.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors