https://github.com/alexmochu/weconnect-api-v2
(Data Persistence - API {Back-end}) 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.
https://github.com/alexmochu/weconnect-api-v2
flask jwt-tokens postgresql-database python-3-6 restful-api
Last synced: about 1 month ago
JSON representation
(Data Persistence - API {Back-end}) 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.
- Host: GitHub
- URL: https://github.com/alexmochu/weconnect-api-v2
- Owner: alexmochu
- Created: 2018-03-31T11:17:01.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:05:43.000Z (over 3 years ago)
- Last Synced: 2025-10-08T13:40:29.777Z (9 months ago)
- Topics: flask, jwt-tokens, postgresql-database, python-3-6, restful-api
- Language: Python
- Homepage: https://weconnect-v2-heroku.herokuapp.com/
- Size: 104 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://www.codacy.com/app/alexmochu/weConnect-API-v2?utm_source=github.com&utm_medium=referral&utm_content=alexmochu/weConnect-API-v2&utm_campaign=Badge_Grade)
[](https://codeclimate.com/github/alexmochu/weConnect-API-v2/maintainability)
[](https://travis-ci.org/alexmochu/weConnect-API-v2)
[](https://coveralls.io/github/alexmochu/weConnect-API-v2?branch=master)
# weConnect-API-v2
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.
# Technology Used
The API has been built with:
- Flask micro-framework (Python 3.6)
- Postgresql Database
- JSON Web Tokens
# UI templates and API Documentation
- 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"
# Features
1. Users can be able to register and create an account
2. Registered users can be able to log in
# Installation
1. Ensure you have installed Python3.6+, created and an activated a virtual environment.
2. Clone the repo in your local machine inside the virtual environment you have created.
3. Navigate to the project folder(WeConnect-API-v2)
4. Install all the requirements of the project by typing:
`pip install -r requirements.txt`
# Running the API
## Make Migrations
- 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`
# Running the Tests
# API Endpoints
| 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/ | PUT | Updates a business category |
| /api/v2/category/ | DELETE | Deletes a business category |
| /api/v2//business | POST | Create a business with unique ID and business name |
| /api/v2/business/all | GET | Retrive all business created |
| /api/v2/business/ | GET | Retrive a business by ID |
| /api/v2/business/ | DELETE | Remove a business |
| /api/v2//review | POST | Add a review for a business |
| /api/v2/reviews/all | GET | Get all reviews |
| /api/v2/reviews/all/page= | GET | (Paginantion)Get all reviews |
| /api/v2/reviews/all/page=&limit= | GET | (Paginantion)Get all reviews |
# Pagination
| Resource URL | Methods | Description |
| ------------------------------------------------------ | ------- | -------------------------------------------- |
| /api/v2/category/all/page= | GET | (Paginantion)Retrieve all created categories |
| /api/v2/category/all/page=&limit= | GET | (Paginantion)Retrieve all created categories |
| /api/v2/business/all/page= | GET | (Paginantion)Retrive all business created |
| /api/v2/business/all/page=&limit= | GET | (Paginantion)Retrive all business created |
# Searching
| Resource URL | Methods | Description |
| --------------------------- | ------- | -------------------- |
| /api/v2/search?q= | GET | Search Business by q |
# Searching and Filtering
| Resource URL | Methods | Description |
| ------------------------------------------------------------------- | ------- | ---------------------------------------- |
| /api/v2/search?q=&location=&category= | GET | Filter Business by Location and Category |