rajashekar / item-catalog

A RESTful web application to display categories and items and gives logined user to edit or add items.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

item-catalog

The purpose of the project is to understand the concepts Python framework Flask along with implementing third-party OAuth authentication and to develop a RESTful web application to display categories and items and gives logined user to edit or add items.

Getting Started

Prerequesites

Below software needs to be installed

Installing

To download the virtual machine using vagrant file

git clone https://github.com/udacity/fullstack-nanodegree-vm.git

To install downloaded virtual machine

cd fullstack-nanodegree-vm
vagrant up

To login to vagrant virtual machine

vagrant ssh

How to Run

git clone https://github.com/rajashekar/item-catalog.git
cd item-catalog
python catalog_views.py

open http://localhost:5000/

Demo

Available json endpoints

http://localhost:5000/catalog.json

{
  "categories": [
    {
      "id": 1, 
      "items": [
        {
          "category": "TV", 
          "description": "Samsung TV 55 inch 4K", 
          "id": 1, 
          "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
          "title": "Samsung TV", 
          "user_id": 1
        }, 
        {
          "category": "TV", 
          "description": "LG TV 55 inch 4K", 
          "id": 2, 
          "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
          "title": "LG TV", 
          "user_id": 1
        }
      ], 
      "name": "TV"
    }, 
    {
      "id": 2, 
      "items": [
        {
          "category": "Gaming Console", 
          "description": "Console game by Sony", 
          "id": 3, 
          "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
          "title": "Sony playstation 4", 
          "user_id": 1
        }, 
        {
          "category": "Gaming Console", 
          "description": "Console game by Microsoft", 
          "id": 4, 
          "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
          "title": "Xbox one", 
          "user_id": 1
        }, 
        {
          "category": "Gaming Console", 
          "description": "Console game by Nintendo", 
          "id": 5, 
          "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
          "title": "Nintendo", 
          "user_id": 1
        }
      ], 
      "name": "Gaming Console"
    }
  ]
}

http://localhost:5000/items.json

{
  "items": [
    {
      "category": "TV", 
      "description": "Samsung TV 55 inch 4K", 
      "id": 1, 
      "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
      "title": "Samsung TV", 
      "user_id": 1
    }, 
    {
      "category": "TV", 
      "description": "LG TV 55 inch 4K", 
      "id": 2, 
      "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
      "title": "LG TV", 
      "user_id": 1
    }, 
    {
      "category": "Gaming Console", 
      "description": "Console game by Sony", 
      "id": 3, 
      "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
      "title": "Sony playstation 4", 
      "user_id": 1
    }, 
    {
      "category": "Gaming Console", 
      "description": "Console game by Microsoft", 
      "id": 4, 
      "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
      "title": "Xbox one", 
      "user_id": 1
    }, 
    {
      "category": "Gaming Console", 
      "description": "Console game by Nintendo", 
      "id": 5, 
      "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
      "title": "Nintendo", 
      "user_id": 1
    }
  ]
}

http://localhost:5000/catalog/\/items/json

Example - http://localhost:5000/catalog/TV/items/json

{
  "items": [
    {
      "category": "TV", 
      "description": "Samsung TV 55 inch 4K", 
      "id": 1, 
      "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
      "title": "Samsung TV", 
      "user_id": 1
    }, 
    {
      "category": "TV", 
      "description": "LG TV 55 inch 4K", 
      "id": 2, 
      "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
      "title": "LG TV", 
      "user_id": 1
    }
  ]
}

http://localhost:5000/catalog/\/<item>/json

http://localhost:5000/catalog/TV/LG%20TV/json

{
  "item": {
    "category": "TV", 
    "description": "LG TV 55 inch 4K", 
    "id": 2, 
    "modified_date": "Sun, 15 Apr 2018 06:40:28 GMT", 
    "title": "LG TV", 
    "user_id": 1
  }
}

About

A RESTful web application to display categories and items and gives logined user to edit or add items.


Languages

Language:Python 60.2%Language:HTML 34.7%Language:CSS 5.2%