dennisdnyce / Questioner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Coverage Status MIT license

QuestionerAPI

Questioner is a mock of a meetup platform where any user is allowed to register for an account and pose questions on scheduled meetups by an admin user that he/she is interested in attending or nonetheless, comment on posted questions relating to meetups. The more a meetup question is upvoted, the more it qualifies to be objectified during the meetup. An admin user can create and delete meetups and a regular user can pose questions on posted meetups and schedule to attend the meetup if possible.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. Watch out for the deployment notes on how to deploy the project on a live system.

NOTE

  • The project's normal user UI can be found here gh-pages
  • The project's admin user UI can be found here admin gh-pages
  • The project is managed by the PivotalTracker software management platform, preview it at PivotalTracker
  • The app is hosted on Heroku
  • The project documentation can be found Here

Implemented V1 Endpoints

Endpoint Prefix Description
[POST /auth/signup] /api/v1 signs up a user
[GET /auth/users] /api/v1 retrieves all registered users
[GET /auth/users/int:userId/] /api/v1 retrieves a single registered user
[POST /meetups] /api/v1 posts a meetup
[GET /meetups/int:meetupId] /api/v1 retrieves a meetup
[GET /meetups/upcoming] /api/v1 gets all upcoming meetups
[POST /meetups/int:meetupId/questions] /api/v1 posts a meetup's question
[POST /meetups/int:meetupId/rsvps] /api/v1 makes an RSVP to a meetup
[PATCH /questions/int:questionId/upvote] /api/v1 upvotes a meetup question
[PATCH /questions/int:questionId/downvote] /api/v1 downvotes a meetup question

Implemented V2 Endpoints

Endpoint Prefix Description
[POST /auth/signup] /api/v2 signs up a user
[POST /auth/login] /api/v2 logs in a user
[GET /auth/users] /api/v2 retrieves registered users
[GET /auth/users/int:userId/] /api/v2 retrieves a single registered user
[POST /meetups] /api/v2 posts a meetup
[GET /meetups/int:meetupId] /api/v2 retrieves a meetup
[DELETE /meetups/int:meetupId] /api/v2 deletes a meetup
[GET /meetups/upcoming] /api/v2 Gets all upcoming meetups
[POST /meetups/int:meetupId/questions] /api/v2 posts a meetup's question
[POST /meetups/int:meetupId/rsvps] /api/v2 makes an RSVP to a meetup
[PATCH /questions/int:questionId/upvote] /api/v2 upvotes a meetup question
[PATCH /questions/int:questionId/downvote] /api/v2 downvotes a meetup question
[POST /meetups/int:meetupId/questions/int:questionId/comments] /api/v2 post a comment

Prerequisites

The things you need to setup the project and its relevant configuration.

1. Python3
2. Flask Microframework
3. Postman for testing the API endpoints

Installation

step 1: git clone http://github.com/dennisdnyce/Questioner.git

step 2: _cd Questioner_
step 3: git checkout develop
step 4: install dependencies :~$ sudo apt install python-pip
step 5: install virtualenv :~$ sudo pip install virtualenv
step 6: create a virtual environment :~$ virtualenv myvenv
step 7: activate the virtual environment :~$ source myvenv/bin/activate
step 8: install project dependencies :~$(myenv) pip install -r requirements.txt
step 9: set up the project running environment from your terminal
                           :~$(myenv)export FLASK_ENV = development
                           :~$(myenv)export FLASK_DEBUG = 1
                           :~$(myenv)export FLASK_APP = run.py
step 10: run the project :~$(myenv)flask run  
Finaly, test the endpoints on Postman                                        

Running Tests

- pytest :~$(myenv)py.test --cov app/ tests/

- checking test coverage :~$(myenv)coverage report -m

Authors

  • Dennis Juma

Acknowledgments

  • The Almighty for the awesome gift of life
  • Andela-Nairobi Cycle-36 Cohorts
  • Endless Motivation from family and friends

Licence

The Questioner project is licenced under the MIT licence

About


Languages

Language:Python 100.0%