Skip to content

About

A flask Api about WeConnect that uses postgres

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

WeConnect-Api

Build Status Maintainability Coverage Status

DESCRIPTION

WeConnect provides a platform that brings businesses and individuals together. This platform creates awareness for businesses and gives the users the ability to write reviews about the businesses they have interacted with.

WALK-THROUGH OF API

LINK TO API

Project captures the following routes

REQUEST ROUTE FUNCTIONALITY
POST /api/v1/auth/login Logs in a user
POST api/v1/auth/logout Logs out a user
POST api/v1/auth/reset-password Resets a users password
POST api/v1/auth/register Register a new user
GET api/v1/businesses Retrieves all businesses
POST api/v1/businesses Creates a new business
GET api/v1/businesses/filter Filter business by location/category
GET api/v1/businesses/search Search for a business by name
DELETE api/v1/businesses/<businessId> Delete a business
GET api/v1/businesses/<businessId> Get a business by id
PUT api/v1/businesses/<businessId> Update a specific business
GET api/v1/businesses/<businessId>/reviews Get reviews of a business
POST ap1/v1/businesses/<businessId>/reviews Post a review about a business

BUILT WITH

  • Flask - Python Framework used

SETTING UP APPLICATION

  1. Create a folder weconnect-api-with-database

    Clone repository to the folder

    git clone https://github.com/King-Benx/WeConnect-Api-with-database.git

  2. Create a virtual environment that you are going to use while running the application locally

    $ virtualenv weconnect-env

    $ source weconnect-env/bin/activate

NB: More Information on setting up Virtual environments here

  1. Install all project dependencies using

    pip3 install -r requirements.txt

  2. Set up a secret key for security purposes of your application

    SECRET_KEY = '<your_secret_key>'

  3. For testing purposes create a postgresql database and set an environment variable TEST_DATABASE to set your DATABASE URI

    TEST_DATABASE = 'postgres://<db_user_name>:<password>@localhost/<database_name>'

  4. For development purposes create a postgresql database and set an environment variable DEV_DATABASE to set your DATABASE URI

    DEV_DATABASE = 'postgres://<db_user_name>:<password>@localhost/<database_name>'

  5. For staging purposes (stage before production ready) create a postgresql database and set an environment variable STAGING_DATABASE to set your DATABASE URI

    STAGING_DATABASE = 'postgres://<db_user_name>:<password>@localhost/<database_name>'

  6. For production purposes create a postgresql database and set an environment variable WECONNECT_DATABASE to set your DATABASE URI

    WECONNECT_DATABASE = 'postgres://<db_user_name>:<password>@localhost/<database_name>'

NB: More Information on setting up postgresql here

RUNNING APPLICATION

  1. Set the APPLICATION_CONFIG to define your settings. Select from (testing,development,staging,production)

    APPLICATION_CONFIG = <new_config>

  2. To launch the application, run the following command in your terminal

    python manage.py runserver

  3. To launch the shell, run the following command in your terminal

    python manage.py shell

  4. To run tests on the application, run the following command in your terminal

    python manage.py run_test

Author

Asiimwe Benard

About

A flask Api about WeConnect that uses postgres

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages