Git Product home page Git Product logo

business-connect-v2's Introduction

Build Status Coverage Status 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.

API installation

To set up WeConnect API, make sure that you have python 3.6 or more, postman and pip installed.

  • Clone the Repo into your local directory.
$ git clone https://github.com/cosmas28/business-connect-v2.git
  • create a virtual environment.
$ virtualenv <your_virtualenv>
  • Activate your virtual environment

Navigate to the API directory.

$ cd business-connect-v2

To install the packages run pip install -r requirements.txt

Database setup instructions

  • Install PostgreSQL.
  • Create a new database.
  • Change Database configuration at SQLALCHEMY_DATABASE_URI environment variable to include your database name, password and user name i.e SQLALCHEMY_DATABASE_URI = 'postgresql://<username>:<password>@localhost/database_name'

How to make migrations

  • Run migrations initialization using this command $ python manage.py db init
  • Run actual migrations using $ python manage.py db migrate
  • Finally apply migrations using $ python manage.py db upgrade
  • Then each time the database models change repeat the migrate and upgrade commands.

Usage

$ python manage.py runserver

How to view API documentation

Run the endpoints on Postman

Test

Run the test using bash

$ pytest

Run the API endpoints using the following URLs

HTTP Method URL Functionality
POST /api/v2/auth/register Creates a new user account
POST /api/v2/auth/login logs in a user
POST /api/v2/auth/logout logs in a user
POST /api/v2/auth/reset-password Password Reset
POST /api/v2/businesses Registers a business
GET /api/v2/businesses Retrieves all businesses
GET /api/v2/businesses/int:business_id get a business
DELETE /api/v2/businesses/int:business_id Remove a business
PUT /api/v2/businesses/int:business_id Update a business profile
POST /api/v2/businesses/int:business_id/reviews Add a review for a business
GET /api/v2/businesses/int:business_id/reviews Get all reviews for a business
GET /api/v2/businesses/location?q=&start=&limit= Filter businesses based on location
GET /api/v2/businesses/location?q=&start=&limit= Filter businesses based on category
GET /api/v2/businesses/search?q=<business_name>&start=&limit= Search for a business

Acknowledgements

  • Andela Kenya Recruitment team for inspiration

business-connect-v2's People

Contributors

cosmas28 avatar

Watchers

James Cloos avatar

business-connect-v2's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.