Git Product home page Git Product logo

item-catalog's Introduction

Udacity Item Catalog Project

The 4th projects made as a part of Udacity Full Stack Web Development Nanodegree. Project represents a an application that provides a list of items as well as a user registration and authentication system. Registered users have the ability to use CRUD functionallity, or post, delete, edit. For User Registration Google+ Authentification and Authorization service. Local Permissions System was implemented to prevent other user's changes to items uploaded by someone.

Required software

Vagrant and VirtualBox are needed to be installed before running the program to provide Linux environment. Vagrant can be downloaded from HashiCorp website, and VirtualBox from here. If you face some problems during the installation of Vagrant, you can find answers either at Stack OverFlow or in the GitHub repository of Vagrant itself.

Also, installed Python 2.7 is required, also project uses SQLAlchemy Python SQL toolkit and Object Relational Mapper and Flask Python Microframework.

Frontend was done with HTML, while JavaScript and jQuery were needed to connect client side to server.

How to start

  • After the installation, download Vagrant Virtual Machine from here
  • Launch the Virtual Machine by running in command line vagrant up
  • Enter your Virtual Machine after the previous command by vagrant ssh
  • Clone the project from repository to the catalog directory in your vagrant folder
  • Enter this repository by running cd /vagrant/catalog
  • Run the python script application.py with the following command: python application.py
  • Access an application by visiting http://localhost:8000/ locally

BookShelf Item Catalog Application

Database contains three tables: genre, user, book_item. Each BookItem belongs to specific Genre, while each User can create both Genre and BookItem in it. Different Users can add BookItems to the Genre, however, only creator can edit or delete created Genres and BookItems. Not registered users are not able to add, delete or edit anything, but they can see publicly available list of items, which are rendered with public_genres.html and public_books.html. If authentificated user tries to edit or delete items that were added by another user, alertwindow is shown and the action is aborted.

Each BookItem contains the following attributes: ID (Primary Key), Name, Author, Description, Price, Type (either eBook or HardCopy), GenreID(ForeignKey), UserID(ForeignKey), while Genre has ID (Primary Key), Description, UserID (ForeignKey), User has ID (Primary), Name, Email and Picture that are taken from Google+ account after authentification.

Python file populate_book.py was used to add items to the new_book_catalog.db file.

Demonstration

Screenshots of some pages along with their URL adresses are shown below http://localhost:8000/ http://localhost:8000/ or http://localhost:8000/genres (authorized) http://localhost:8000/ http://localhost:8000/ or http://localhost:8000/genres (not authorized used) http://localhost:8000/genres/1/books http://localhost:8000/genres/1/books (authorized) shows all books of Poetry (GenreId=1) genre for an authorized user.

item-catalog's People

Contributors

alexsnow348 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.