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.
The API has been built with:
- Flask micro-framework (Python 3.6)
- Postgresql Database
- JSON Web Tokens
- To preview the UI, proceed to https://alexmochu.github.io .
- The UI Templates have been hosted on Github Pages
- To access the API hosted on the Heroku cloud platform -->> https://weconnect-v2-heroku.herokuapp.com/
- Access the API documentation at "https://weconnectv2.docs.apiary.io"
- Users can be able to register and create an account
- Registered users can be able to log in
- Ensure you have installed Python3.6+, created and an activated a virtual environment.
- Clone the repo in your local machine inside the virtual environment you have created.
- Navigate to the project folder(WeConnect-API-v2)
- Install all the requirements of the project by typing:
pip install -r requirements.txt
- Create this folder and file inside the main folder
/instance/config.py
add this two lines
SECRET_KEY = 'your_secret_key_here'
SQLALCHEMY_DATABASE_URI = 'your_postgres_database_uri'
-
Type in terminal:
flask db init
flask db migrate
flask db upgrade
-
NOTE: While on development uncomment line 20 and comment line 19
/app/__init__.py
file. Reverse this while on production. -
Type in terminal:
export FLASK_CONFIG=developmemt
export FLASK_APP=run.py
flask run
Resource URL | Methods | Description |
---|---|---|
/api/v2/auth/register | POST | User Registration |
/api/v2/auth/login | POST | User Login |
/api/v2/auth/reset-password | PUT | User can be able to reset password |
/api/v2/auth/logout | DELETE | Logs out User |
/api/v2/category | POST | Create a business category |
/api/v2/category/all | GET | Retrieve all created categories |
/api/v2/category/<category_id> | PUT | Updates a business category |
/api/v2/category/<category_id> | DELETE | Deletes a business category |
/api/v2/<category_id>/business | POST | Create a business with unique ID and business name |
/api/v2/business/all | GET | Retrive all business created |
/api/v2/business/<business_id> | GET | Retrive a business by ID |
/api/v2/business/<business_id> | DELETE | Remove a business |
/api/v2/<business_id>/review | POST | Add a review for a business |
/api/v2/reviews/all | GET | Get all reviews |
/api/v2/reviews/all/page=int:page | GET | (Paginantion)Get all reviews |
/api/v2/reviews/all/page=int:page&limit=int:limit | GET | (Paginantion)Get all reviews |
Resource URL | Methods | Description |
---|---|---|
/api/v2/category/all/page=int:page | GET | (Paginantion)Retrieve all created categories |
/api/v2/category/all/page=int:page&limit=int:limit | GET | (Paginantion)Retrieve all created categories |
/api/v2/business/all/page=int:page | GET | (Paginantion)Retrive all business created |
/api/v2/business/all/page=int:page&limit=int:limit | GET | (Paginantion)Retrive all business created |
Resource URL | Methods | Description |
---|---|---|
/api/v2/search?q= | GET | Search Business by q |
Resource URL | Methods | Description |
---|---|---|
/api/v2/search?q=&location=&category= | GET | Filter Business by Location and Category |