Questioner API using Python Flask and PostgreSQL
Questioner is an application used by meetup organizers to plan well for meetups and to prioritize what to discuss during the meetup.
- A user should be able to sign up to Questioner
- A user with an account should be able to log into Questioner
- An administrator should be able to crete a meetup in Questioner
- A user with an account should be able to post Questions to specific meetups
- A user should be able to post a question agains a specific meetup
- A user should be able to get a specific meetup record
- A user should be able to get all meetup recods
- A user should be able to upvote or downvote a question
- A user should be able to give an rsvp for a meetup
- An admin should be able to delete a meetup
- A user should be able to log out of Questioner
- A user should be able to post comments
- An admin should be able to delete a meetup
- A client should be able to get all questions for a meetup
- A client should be able to get a specific question from questioner
Clone the repository.
git https://github.com/Ogutu-Brian/QuestionerAPI-Version2
$ 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
Before you begin you will need to activate the corresponding environment
source venv/bin/activate
On Windows
venv\Scripts\activate
$ pip install -r requirements.txt
After the configuration, you will run the app
$ cd api
$ export FLASK_APP=run.py
$ flask run
All endpoints can be now accessed from the following url on your local computer
http://localhost:5000/api/v2/
After successfully installing the application, the endpoints can be tested by running.
pytest tests/*
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 |
You can view the Pivotal Tracker stories