This application will display, create, edit & delete items and their categories. You also have the possibility to access items & categories through a JSON- and/or XML-API.
An application that provides a list of items within a variety of categories as well as a user registration and authentication system. Registered users will have the ability to post, edit and delete their own items.
https://www.virtualbox.org/wiki/Downloads
https://www.vagrantup.com/downloads
Verify that Vagrant is installed and working by typing in the terminal:
vagrant -v # will print out the Vagrant version number
Once you are sure that VirtualBox and Vagrant are installed correctly execute the following:
git clone https://github.com/alinr/Udacity_FSWDN_P3_Item_Catalog.git
cd Udacity_FSWDN_P3_Item_Catalog
cd catalog
--catalog #folder containing tournament files
----project.py #file that contains the python functions which unit tests will run on
----database_setup.py # SQLite Database Schema preparation
----dummydata.py # Dummy Data
----fb_client_secrets.json # JSON file with Facebook Credentials
----google_client_secrets.json # JSON file with Google Plus Credentials
----templates # folder containing HTML templates
------base # folder containing layout HTML templates
--------layout.html # standard layout template
------forms # folder containing HTML templates with forms
--------deleteItem.html # HTML Template for deleting an item
--------editItem.html # HTML Template for editing an item
--------newCategory.html # HTML Template for creating a new category
--------newItem.html # HTML Template for creating a new item
------home.html # HTML Template: Homepage of the Item Catalog Website
------login.html # HTML Template: Login page
------showCategory.html # HTML Template: Show items of one category
------showItem.html # HTML Template: Show one item
--Vagrantfile # template that launches the Vagrant environment
--pg_config.sh # shell script called by Vagrantfile that performs configurations
vagrant up #to launch and provision the vagrant environment
vagrant ssh #to login to your vagrant environment
cd /vagrant
cd catalog
python database_setup.py
python dummydata.py
As the app uses Google for authentication, the next step you have to obtain a client id and client secret from Google:
- Go to the Google Developer Console.
- Create a new project.
- Go to APIs & auth - Consent screen and select a valid Email address.
- Go to APIs & auth - Credentials and download the JSON file
- Copy the content of the JSON file to google_client_secrets.json
As the app uses also Facebook for authentication, the next step you have to obtain a client id and client secret from Facebook:
- Go to the Facebook Developer.
- Create a new app (www - website).
- Get the App ID & App Secret
- Copy the App ID & Secret to the fb_client_secrets.json
python project.py
You are now able to login via Google+ or Facebook to the application. After successfully login you can view, create, edit, delete items & categories.
vagrant halt
vagrant destroy
- The app uses Jasny Bootstrap's file input widget for the picture upload.
- The pictures are stored in the database.
- The app uses nonces to prevent cross-site request forgeries (CSFR) when creating, updating and deleting items.
- The app offers two API endpoints:
- JSON:
- /categories/JSON
- /category/int:category_id/JSON
- /category/int:category_id/item/int:item_id/JSON
- XML:
- /categories/XML
- /category/int:category_id/XML
- /category/int:category_id/item/int:item_id/XML
- JSON:
- Python 2.7.9
- Flask 0.9
- Werkzeug 0.8.3