Git Product home page Git Product logo

item_catalog_udacity's Introduction

##Toy Shop Online Mangement This is the third project for "Full Stack Web Developer Nanodegree" on Udacity.

You can use this website to manage toy shops.

##Before running this website, make sure all the required python modules have been installed. Please see Instructions.

##Instructions

  1. Clone this project to your local machine at first.
  2. use pip install -r requirements.txt to install neccessary python modules.
  3. Use python database_setup.py to create database.
  4. Use python import_fake_data.py to import fake data if you want to test this website.
  5. Use python website.py to run this website on your local machine.
  6. Open browser and navigate to http://localhost:5000/

##Features

  1. Using Flask ( a light Python web framework).
  2. Using OAuth 2.0 to Access Google APIs.
    • You can login using your google account.
    • Only the owner can manage his own shop.
  3. Using RESRfull APIs, like Post and Get.
  4. Providing JSON APIs, which you can exploit to get the information you want.

We also provide json APIs

@app.route('/index/<string:shop_ID>/JSON/')
def shopJSON(shop_ID):
	shops = session.query(ToyShop).filter_by(id=shop_ID).one()
	toys = session.query(ToyItem).filter_by(shop_id = shop_ID).all()
	return jsonify(Shop=shops.serialize, Toys = [g.serialize for g in toys])


@app.route('/index/<string:shop_ID>/<string:toy_ID>/JSON/')
def toyJSON(shop_ID,toy_ID):
	toy = session.query(ToyItem).filter_by(id=toy_ID).one()
	return jsonify(Toy = toy.serialize)

You can use url likes localhost:5000/index/<string:shop_ID>/JSON/ to get the JSON file corresponding to the shop with id = shop_ip; You can use url likes localhost:5000/index/<string:shop_ID>/<string:toy_ID>/JSON/ to get the JSON file corresponding to the toy with id = toy_ID.

##You will see The main page looks like: 1

You can use your google account to login: 2

You can create your own shop: 4

You can view the shop: 6

You can add new toy to your shop: 7

You can use JSON APIs like: 9

item_catalog_udacity's People

Contributors

kongling893 avatar

Watchers

 avatar  avatar

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.