The users can perform the following functions:
- Register
- Login
- Reset Password
- Register a business
- Update business profile
- Get businesses
- Get business by id
- Delete a business
To run the Api endpoint use either of the following software:
- Postman/Curl - Testing the endpoints
- Text Editor - Making changes in the code base
- Terminal - Run the api file
To Access the enpoint follow the directory.
- To access the endpoints clone the repo and cd into the following directory
- $ cd WeConnect/source/api
api.py
- To access the models
- $ cd WeConnect/source/models
business.py
reviews.py
users.py
- To acess the tests
- $ cd WeConnect/tests
test_business.py
test_reviews.py
test_users.py
1. Users
- POST /api/v1/auth/register Creates user account
- POST /api/v1/auth/login Log in user
- POST /api/v1/auth/logout Logout user
- PUT /api/v1/auth/reset-password Resets user password
2. Businesses
- POST /api/v1/businesses Register new business
- GET /api/v1/businesses List all available businesses
- PUT /api/v1/businesses/<business_id> Update business
- DELETE /api/v1/businesses/<business_id> Remove business
3. Reviews
- POST /api/v1/businesses/<business_id>/reviews Review a business
- GET /api/v1/businesses/<business_id>/reviews Get business' reviews
4. Pagination and Limit
- POST /api/v1/businesses Add new business
- GET /api/v1/businesses?page=?&limit=?
5. Filter by category or location
- POST /api/v1/businesses Post a business
- GET /api/v1/businesses?category=?&location=? add category and location
6. Search Business
- POST /api/v1/businesses Add new business
- GET /api/v1/businesses?q=? Add business of choice
- To run the API cd into
$ cd WeConnect
- Create a virtual environment to install your dependencies.
virtualenv -p python3 venv
for mac and linux usersvirtualenv venv
for windows users
- Activate the virtual environment to install dependecies.
source venv/bin/activate
for mac and linux userssource venv/scripts/activate
for windows users
- Install the requirements
pip -r requirements.txt
use the command to install dependecies.(mac,linux,windows) - Finally write the following command in your terminal
python run.py
To run the tests assert that the virtual environment is activated:
- Activate virtual env
- Install pip requirements -
pip -r requirements.txt
- Run the following command in your terminal
nosetests
- Flask
- Json {}
- Version 0.0.1
- Contributing to the development of this app is allowed just fork it!!! do changes and create a pull request...
- James Muriuki
- Andela kenya
- Flavian
- PMusonye
- Georgreen