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.
| 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 |
- Flask - Python Framework used
-
Create a folder weconnect-api-with-database
Clone repository to the folder
git clone https://github.com/King-Benx/WeConnect-Api-with-database.git -
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
-
Install all project dependencies using
pip3 install -r requirements.txt -
Set up a secret key for security purposes of your application
SECRET_KEY = '<your_secret_key>' -
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>' -
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>' -
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>' -
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
-
Set the APPLICATION_CONFIG to define your settings. Select from (testing,development,staging,production)
APPLICATION_CONFIG = <new_config> -
To launch the application, run the following command in your terminal
python manage.py runserver -
To launch the shell, run the following command in your terminal
python manage.py shell -
To run tests on the application, run the following command in your terminal
python manage.py run_test
Asiimwe Benard