python 3.6.7 and Flask
A Q and A Platform where V1 has been implemented using data structures and V2 is powered by a database (postgres)
git clone https://github.com/antonnifo/StackOverflow-lite.git
python3 - m venv env
source .env
pip install -r requirements.txt
source venv/bin/activate
export FLASK_ENV="development"
export FLASK_CONFIG="development"
export DATABASE_URL="dbname='your-database' host='localhost' port='5432' user='your-username' password='your-password'"
export DATABASE_URL_TEST="dbname='your-test-database' host='localhost' port='5432' user='your-username' password='your-password'"
export SECRET_KEY="secret-key-goes-here"
source .env
> flask run
Tests are to be run with pytest or py.test on the root folder Set FLASK_CONFIG to testing on your .env file before running tests
source .env pytest --cov=app/
Method | Endpoint | Description |
---|---|---|
POST | /api/v2/auth/signup/ |
user signs up. |
POST | /api/v2/auth/signin/ |
user signs in here. |
POST | /api/v2/questions |
post a question. |
GET | /api/v2/questions |
Fetch all questions and its answers. |
GET | /api/v2/questions/<int:question_id>> |
Fetch a specific question and all its answers. |
PATCH | /api/v2/answers/<int:answer_id> |
Edit an answer you authored. |
PATCH | /api/v2/questions/<int:question_id>/question |
Edit the comment of a specific red-flag record. |
PATCH | /api/v2/answers/<int:question_id>/answer |
author of a quiz accept an answer. |
DELETE | /api/v2/questions/<int:question_id> |
Delete a specific question and all its answers. |
POST | /api/v2/questions/<int:question_id>/answers |
post an answer to a quiz |
DELETE | /api/v2/answers/<int:answer_id> |
Delete an answer you authored. |