marodrig/catalog_app
Catalog Web Application
Web application using Flask for backend portion and Foundation CSS for the styling.
The application is a basic catalog of items and includes login using Google's oauth2.
What is the reason for this repo?
This repo was made as part of the Udacity nanodegree program.
Why should you care about this repo?
You want to learn about Flask and web development using Python.
Table of Contents
Click to expand ToC
Features
Installation & Quick Start
Requirements
- Flask: web development framework.
- Google user account for oauth2.
Cloning this repository using GIT
You can clone this repository by using git:
git clone https://github.com/marodrig/catalog_appUsing PIP to manage Python dependencies
PIP is a package manager for Python. Included in this repo is a requirements.txt file with the requirements of the different packages used in this project.
You can simply use pip to install the necessary packages by navigating where the requirements.txt is found and typing:
pip install -r requirements.txt Built with
Usage
We need to populate the database with data, in order to do so we need to run the followin command:
python populate_db.pyAfter that we can run the application by the following command:
python views.pyAccess the application by going to:
http://localhost:8080/
API Reference
JSON API
This application has a JSON API that can access individual items, all items and all categories of the catalog.
Rate Limit
N/A
Status Codes
| Code | Meaning |
|---|---|
| 200 | OK |
| 400 | Something user's end. |
| 401 | Unauthorized |
| 403 | Frobidden |
| 500 | Something wrong on the server side of things. |
API End-Points and Response
| End-Point URI | Action | Response |
|---|---|---|
| /api/v1/items | Get an array of all items | { items:[{ 'id':1, 'category_name':"Sports', 'name':"Soccer Ball", 'description':"Required to play soccer.", 'date_created':"2015-07-04", 'price':"50.0", }, {}]} |
| /api/v1/items/{int:item_id} | Get specific item | { 'id':1, 'category_name':"Sports', 'name':"Soccer Ball", 'description':"Required to play soccer.", 'date_created':"2015-07-04", 'price':"50.0", } |
| /api/v1/categories/ | Get an array of all categories | { categories:[{ 'id':1, 'name':"Sports", }, { 'id':2, 'name':"Housing", }] } |