HawiCaesar / smart-goals-api

An API service that contains CRUD features for the smart-goals app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Coverage Status Code Climate Issue Count

Smart Goals API

What would you like to do in the next few years? Climbs a mountain? Learn to ride a bike? It's important to keep track of what you have already done and what you are yet to achieve. Smart Goals allows you to register and achieve all these feats and also allows you to tick off what you have done.

Based on

This app is built on Smart Goals It is a continuation only this will use a RESTFUL API and database as opposed to python data structures like lists and dictionaries as data stores

RESTFUL API features

Create Read Update Delete bucketlist & Items

Installation

After cloning the repo into your local machine

Create a Virtual Environment and Wrapper

$ export WORKON_HOME=~/Environs
$ export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3

$ cd smart-goals-api
$ virtualenv sm-goal-api

API Dependencies

Install all package requirements in your python virtual environment.

pip install -r requirements.txt

Tests

To run tests

nosetests tests/

Coverage Tests

coverage run -m unittest discover && coverage report

Documentation

Follow this link to check out the documentation

Routes

Endpoint Description
POST /auth/register Register user. Request should have name and password in form data.
POST /auth/login Login user. Session token is valid for 30 minutes.
POST /auth/logout Logout user.
POST /bucketlists/ Create a new bucket list. Request should have desc in form data.
GET /bucketlists/ List all the created bucket lists.
GET /bucketlists/ Get single bucket list.
PUT /bucketlists/ Update single bucket list. Request should have desc in form data.
DELETE /bucketlists/ Delete single bucket list.
POST /bucketlists//items Add a new item to this bucket list. Request should have goal in form data.
PUT /bucketlists//items/<item_id> Update the bucket list completion status to true.
DELETE /bucketlists//items/<item_id> Delete this single bucket list item.
GET /bucketlists?limit=5 Get 5 bucket list records belonging to user.
GET /bucketlists?q=draw Search for bucket lists with phrase or words draw

Hosted on Heroku

https://demo-smart-goals-api.herokuapp.com/

Authors

  • Brian Hawi Odhiambo

Acknowledgements

About

An API service that contains CRUD features for the smart-goals app


Languages

Language:Python 91.3%Language:API Blueprint 8.2%Language:Mako 0.4%