Skip to content

This is an implementation of a basic python flask app that does not use ORM. It is a fully functional application that works like stackoverflow. This was my bootcamp project while joining Andela

Notifications You must be signed in to change notification settings

WalterNyeko/andela-stackoverflow-lite-back

Repository files navigation

StackOverflow-Lite

Andela Challenge 3

Build Status Coverage Status

Installation Instructions for the app:

  1. Install Flask using pip install flask
  2. Clone the app using git clone https://github.com/JSnakegitHub/Challenge-3.git

Getting Started With Tests:

For Python 2:

  1. pip install pytest
  2. pip install coverage report
  3. pip install pytest-cov
  4. pip install pytest-xdist

For Python 3:

  1. pip3 install pytest
  2. pip3 install coverage report
  3. pip3 install pytest-cov
  4. pip3 install pytest-xdist

Running the tests on a virtual environment

For python 2:

  1. pip install -U virtualenv
  2. python -m virtualenv venv
  3. source venv/bin/activate # in Windows -> venv\Scripts\activate.bat
  4. pip install pytest

For Python 3:

  1. pip3 install -U virtualenv
  2. python3 -m virtualenv venv
  3. source venv/bin/activate # in Windows -> venv\Scripts\activate.bat
  4. pip install pytest

For Python 3.6+:

  1. python3 -m venv venv
  2. source venv/bin/activate # in Windows -> venv\Scripts\activate.bat
  3. pip install pytest

What The Tests Are Testing:

  1. If the required endpoints are rendered.
  2. If the requests are being sent in the right format (JSON-JavaScript Object Notation).
  3. If Validations are being respected

Testing the App Locally.

  1. Postman should be used to test the application locally
  2. Move to the project directory locally
  3. Once you are in the project's root directory, run the command python run.py.
  4. At this point the server should be running.
  5. The application is set to run on port 8080
URL for the route Function Performed HTTP Method
127.0.0.1:8080/api/v1/questions Retrive all questions GET
127.0.0.1:8080/api/v1/questions Post a question POST
127.0.0.1:8080/api/v1/questions/question_id Retrieve One Question GET
127.0.0.1:8080/api/v1/questions/question_id/answers Post Answers to Question POST
127.0.0.1:8080/api/v1/questions/question_id Deletes a question DELETE
127.0.0.1:8080/api/v1/questions/question_id/answers/answer_id Accept/Edit an answer PUT
127.0.0.1:8080/api/v1/auth/signup Register User POST
127.0.0.1:8080/api/v1/auth/login Login User GET

Deployment

  1. The app can be deplyed on Heroku following the Heroku Documentation.

Contributing

Contributions for this project is allowed.

Versioning

GitHub was used to help track the different versions of the project.

Authors

  1. Walter Nyeko, under supervision of Patrick Walukaga

License

  1. This project is licensed under the Andela License

About

This is an implementation of a basic python flask app that does not use ORM. It is a fully functional application that works like stackoverflow. This was my bootcamp project while joining Andela

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages