Skip to content

krmroland/stackoverflow-lite-ui

Repository files navigation

Stack overflow lite

Maintainability Codacy Badge BCH compliance

Service Master Develop
Travis CI status Build Status Build Status
Coveralls Coverage Status Coverage Status

StackOverflow-lite-ui is a platform where people can ask questions and provide answers.

Getting Started

In your terminal

  1. Clone the repo locally to your machine by running git clone https://github.com/krmroland/stackoverflow-lite-ui
  2. change your current directory (cd) to wherever you cloned the app in 1 above.

Demos

This api is currently has two versions hosted on heroku;

Requirements

  • Python A general purpose programming language
  • Pip A tool for installing python packages
  • Virtualenv A tool to create isolated Python environments
  • Postgresql An open source relational database

Development setup

  • Create a virtual environment and activate it

     virtualenv venv
     source /venv/bin/activate
  • Install dependencies

    pip3 install requirements.txt
  • Setting environmental variables

    Rename .env.example to .env and replace the dummy values with the actual values e.g the database name for both the testing environment and the development environment.

Run the database migrations

 # Delete all tables and recreate them
 flask migrate:fresh

Run the application

python run.py

Running tests

pytest

#with coverage
pytest pytest   -v --cov api/app

API REST End Points

End Point Verb Use
/api/v1.0/ GET API index
/api/v1.0/questions GET Gets a list of Questions
/api/v1.0/questions POST Stores a Question resource
/api/v1.0/questions/<int:id> GET Gets a Question resource of a given ID
/api/v1.0/questions/<int:id> PATCH Updates a Question resource
/api/v1.0/questions<int:id> DELETE Deletes a Question resource
/api/v1.0/questions/<int:id>/answers GET Gets a answers of a specific question
/api/v1.0/questions/<int:id>/answers POST Adds a an answer to a question
/api/v1.0/questions/<int:id>/answers/<int:id> GET Gets a specific answer
/api/v1.0/questions/<int:id>/answers/<int:id> UPDATE Updates an existing answer
/api/v1.0/questions/<int:id>/answers/<int:id> DELETE Deletes an existing answer
/api/v1.0/auth/signup POST Creates a user account
/api/v1.0/auth/login POST Exchanges user credentials with a token

Built With

  • Flask A microframework for Python based on Werkzeug, Jinja 2

Acknowledgments

A Special thanks goes to

  1. Andela for having given me an opportunity to participate in the boot camp, without them , this application wouldn't be a success.

  2. UI Faces for providing free avatar sources that I used in the UI templates .