/QuestionerAPI-Version2

REST API for questioner application using PostgreSQL for persistence of data

Primary LanguagePython

Questioner

Questioner API using Python Flask and PostgreSQL
Build Status Coverage Status Maintainability

Project Overview

Questioner is an application used by meetup organizers to plan well for meetups and to prioritize what to discuss during the meetup.

Required Features

  1. A user should be able to sign up to Questioner
  2. A user with an account should be able to log into Questioner
  3. An administrator should be able to crete a meetup in Questioner
  4. A user with an account should be able to post Questions to specific meetups
  5. A user should be able to post a question agains a specific meetup
  6. A user should be able to get a specific meetup record
  7. A user should be able to get all meetup recods
  8. A user should be able to upvote or downvote a question
  9. A user should be able to give an rsvp for a meetup
  10. An admin should be able to delete a meetup
  11. A user should be able to log out of Questioner
  12. A user should be able to post comments
  13. An admin should be able to delete a meetup
  14. A client should be able to get all questions for a meetup
  15. A client should be able to get a specific question from questioner

Installation and Setup

Clone the repository.

git https://github.com/Ogutu-Brian/QuestionerAPI-Version2

Create a virtual environment

$ python3 -m venv venv;
$ source venv/bin/activate

On Windows

py -3 -m venv venv

If you need to install virtualenv because you are on an older version of Python:

virtualenv venv

On Windows

\Python27\Scripts\virtualenv.exe venv

Activate the virtual environment

Before you begin you will need to activate the corresponding environment

source venv/bin/activate

On Windows

venv\Scripts\activate

Install requirements

$ pip install -r requirements.txt

Running the application

After the configuration, you will run the app

$ cd api
$ export FLASK_APP=run.py
$ flask run

Endpoints

All endpoints can be now accessed from the following url on your local computer

http://localhost:5000/api/v2/

Testing

After successfully installing the application, the endpoints can be tested by running.

pytest tests/*

Available endpoints

Method Endpoint Description
POST /api/v2/meetups Creates a meetup record by admin
GET /api/v2/meetups/<meetup-id> Fetch a specific meetup record
GET /api/v2/meetups/upcomng/ Fetch all upcoming meetup records
POST /api/v2/questions Create a question for a specific meetup
PATCH /api/v2/questions/<question-id>/upvote Upvotes a specific question
PATCH /api/v2/questions/<question-id>/downvote Downvotest a specific question
POST /api/v2/meetups/<meetup-id>/rsvps Responds to a meetup Rsvp
POST /api/v2/auth/signup Creates a new user to Questioner
POST /api/v2/auth/login Allows a user with an account to log in
DELETE /api/v2/meetups/<meetup-id> Allows an admin to delete a meetup
POST /api/v2/comments/ Allows a user to make comments
DELETE /api/v2/auth/logout Allows a logged in user to logout
GET /api/v2/comments/<question-id> Allows a user to get all comments for a questi
GET /api/v2/questions/<meetup-id>/ Gets all questions for a meetup from questioner
GET /api/v2/questions/<question-id> Gets a specific question from questioner

Resources and Documentation

  1. Swagger UI documentation
  2. PostmanDocumentation

Pivotal Tracker Project

You can view the Pivotal Tracker stories

Research Materials

  1. Flask