Code Monkey home page Code Monkey logo

udacity_catalogue_project's Introduction

Item catalogue project - Udacity

This project creates a locally hosted website with sports items. Users logged in with Google will be able to edit and add items.

Getting Started

These instructions will get you a copy of the project up and running on in a virtual environment.

Prerequisites

  • Python 3.6
  • Vagrant
  • VirtualBox

Installation instructions for Vagrant and VirtualBox can be found in the Built With section below

Installing

Install required python modules

pip install -r requirements.txt

Initialise virtual environment

From your terminal, type:

vagrant up

When finished, ssh into your virtual environment:

vagrant ssh
cd /vagrant

Initialise database and populate it with sample data

python create_database.py
python populate_item_catalogue.py

Launch the site

In your virtual environment:

python views.py

You can now access your site at http://localhost:5000/

Examples

Front page

Located at http://localhost:5000/

Screenshot of the front page

Item page for the author of an item

Example url: http://localhost:5000/catalog/Hockey/items/Hockey-Puck/

Screenshot of item page for logged in user

JSON exports

Export all categories and items:
http://localhost:8000/catalog.json/
Response:

{
    "Categories": [
        {
            "id": 1,
            "items": [
                {
                    "category_id": 1,
                    "description": "An ideal ball for players taking their first steps onto the pitch, the Soccer Ball is a solid, durable go-to that handles the rigors of tough shooting and skill drills while celebrating the sport's iconic tournament.",
                    "id": 1,
                    "last_update": "Fri, 11 May 2018 14:08:53 GMT",
                    "name": "Soccer ball",
                    "user_id": 1
                },
                {
                    "category_id": 1,
                    "description": "Equipped with a smooth latex foam palm, the Nike Adult Match Goalkeeper Soccer Goalie Gloves offer reliable impact protection and consistent grip so you can block the hardest shots in any weather conditions.",
                    "id": 2,
                    "last_update": "Fri, 11 May 2018 14:08:53 GMT",
                    "name": "Goalkeeper Gloves",
                    "user_id": 1
                }
            ],
            "name": "Soccer"
        },
        {
            "id": 2,
            "items": [
                {
                    "category_id": 2,
                    "description": "An all-in-one package that includes an easy-to-use air pump to maintain the perfect inflation",
                    "id": 3,
                    "last_update": "Fri, 11 May 2018 14:08:53 GMT",
                    "name": "A pretty good basketball",
                    "user_id": 1
                },
                {
                    "category_id": 2,
                    "description": "Don't dunk on this one. It is going to break",
                    "id": 4,
                    "last_update": "Fri, 11 May 2018 14:08:53 GMT",
                    "name": "Very fragile basketball hoop",
                    "user_id": 1
                }
            ],
            "name": "Basketball"
        }
      ...

Export items in one category:
http://localhost:8000/catalog/<CATEGORY_NAME>.json
Response will be similar to the above

Export one item:
http://localhost:8000/catalog/<CATEGORY_NAME>/<ITEM_NAME>.json
Response:

{
    "category_id": 5,
    "description": "It's a puck. No further explanation needed",
    "id": 10,
    "last_update": "Fri, 11 May 2018 14:08:54 GMT",
    "name": "Hockey Puck",
    "user_id": 1
}

Built With

Author

  • Lasse Alsbirk

udacity_catalogue_project's People

Contributors

buschbirk avatar

Watchers

James Cloos 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.