Quantum-35 / Ride_My_Way_Challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ride My Way Challenge2

License: MIT Build Status Coverage Status

Ride-my App is a carpooling application that provides drivers with the ability to create ride offers and passengers to join available ride offers.

You can get the live version in heroku of the backend here

To use it

1.Ensure you have postman installed in your system
2.Just copy the link to post man and start making the requests

Prerequisites

You need to have the Following before getting Started

1. Python - download the latest version [Recommend]
2. Flask
3. Postman

You can get the link to download Latest version the above here:

1.Python here

2.Flask here

  1. Postman here

Quick Start

Be sure to use the same version of the code as the version of the docs you're reading.

  1. Clone the repo
$ git clone https://github.com/Quantum-35/Ride_My_Way.git
$ cd Ride_MY_Way/api/v1
$ git checkout develop

Note There are two version cd into v1 for non-persisting data and v2 for persisting data

Installation and Usage

First

Create a virtualenv and activate it::

On Linux or macos terminal

python3 -m venv venv
. venv/bin/activate

Or on Windows cmd::

py -3 -m venv venv
venv\Scripts\activate.bat

Install the dependencies::

pip install -r requirements.txt 

Run the development server:

$ python run.py

Navigate to http://localhost:5000

User registration.

Send a POST request to /api/v1/auth/register endpoint with the payload in Json

An example would be

{   
  "username":"example",
  "email": "example@gmail.com",
  "address": "122kitale",
  "password": "123456",
  "confirm_password": "123456",
  "role":"driver"
}

All fields above must be in valid format and the password must be atleast six characters. If any of the vields is invalid or empty or the password is empty or less than six character, the response status will be failed with the message correct message explaining where you went wrong e.g

As shown below:

{
    "message": "Failed you cannot submit empty fields",
    "status": "failed"
}

If the user already exists then they wont be registered again, the following response will be returned.

{
    "message": "Failed, User already exists, Please sign In",
    "status": "failed"
}

Running tests with coverage

You can also run tests with coverage by running this command in the terminal

pytest --cov-report term-missing --cov=app

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Contribution

Fork the repo, create a PR to this repository's develop.

About

License:MIT License


Languages

Language:Python 100.0%