Git Product home page Git Product logo

theshoppinglistapi's Introduction

Namuli Joyce

Coverage Status Build Status

license PEP8

SHOPPINGLIST API

The innovative Shoppinglist app is an application that allows users to record things they want to Buy This is the backend API for enabling users to perform crud operations on shoppinglist and items with user persistence.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

  • Just clone this repository by typing: https://github.com/JoyLubega/TheShoppingListAPI.git
  • Switch to project directory: cd TheShoppingListAPI
  • Install project requirements using python pip. But wait, you have to have some stuff before you get to this point. So these are:

Prerequisites

  • Python3.6 and above
  • Python virtual environment Just type:
python -V

in your terminal and if its not greater than or equal to 3.6, you're not in big trouble, there are tons of tutorials to get up up and running with these. Just grub one then come back when done.

Installing

Now, you have python3 and a way of running a virtual environment. Lets set up the project environment.(remember we're still in the app directory)

  1. Create your virtual environment. Usually, without any wrappers:
python -m venv my_venv
  1. Start your virtual environment:
source my_venv/bin/activate
  1. Install the project requirements specified in the requirements.txt file. Usually,
pip install -r requirements.txt
  1. Do Migrations. This application uses postgresql. If you don't have psql you may install it here. Create a flask_api database to be used by the application while running on your localhost. Then, you can do migrations as:
python manage.py db init
python manage.py db migrate
python manage.py db upgrade

This is enough to get you started. You can now run the application using:

python run.py

Running the testsz

Easy, just: nosetests

API Endpoints

You can use postman or even curl to reach out to the following api endpoints:

URL Endpoint HTTP Request Resource Accessed Access Type
/auth/register POST Register a new user publc
/auth/login POST Login and retrieve token public
/auth/logout POST Logout and thus deactivate token public
/auth/reset-password PUT Reset your password when logged in private
/shoppinglists POST Create a new shoppinglist private
/shoppinglists GET Retrieve all shoppinglist for user private
/shoppinglists/<shoppinglist_id> GET Retrieve a shoppinglist by ID private
/shoppinglists/<shoppinglist_id> PUT Update a shoppinglist private
/shoppinglists/<shoppinglist_id> DELETE Delete a shoppinglist private
/shoppinglists/<shoppinglist_id>/items/ GET Retrive items in a given shoppinglist private
/shoppinglists/<shoppinglist_id>/items/ POST Create items in a shoppinglist private
/shoppinglists/<shoppinglist_id>/items/<item_id> DELETE Delete an item in a shoppinglis prvate
/shoppinglists/<shoppinglist_id>/items/<item_id> PUT update a shoppinglis item details priate

Screenshots

Register alt text

Login alt text

Reset-Password alt text

add shoppinglist alt text

delete alt text

Searching

Functionality to search bucketlists using the parameter q in the GET request is enabled. Example:

GET http://localhost:/shoppinglists?q=<whatever>

This request will return all shoppinglists with whatever in their name

Built With

Contributing

You can create your pull request. :D

License

This project is currently under the Creative Commons attribution.

Acknowledgments

  • Andela - Inspiring the idea.

theshoppinglistapi's People

Contributors

dependabot[bot] avatar joylubega avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

theshoppinglistapi's Issues

[Peer Review] against develop

Shoppinglist API

Observations:

  • Great work on the develop branch. don't know how you are working but the develop branch ought to be you central working place. merging to master must always be after getting approval / successful defense.
  • I love the file structure arrangement.
  • well commented code.
  • build passing, coverage above 85%.
  • clean and readable code.
  1. Match the readme on master to look like the one on the develop branch. (with the required badges).

  2. Include links of hosted API documentation on Apiary and API on Heroku in the Readme incase they are hosted.

  3. Adding a few screenshots too would be great, though not compulsory.

  4. Check the item update functionality.

  5. Token is being generated on registration instead of login.

  6. Names of users must be alphabet instead of numbers.

  7. Look into pagination

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.