Skip to content

Latest commit

 

History

History
82 lines (63 loc) · 2.08 KB

README.md

File metadata and controls

82 lines (63 loc) · 2.08 KB

Item Catalog Project

"The Item Catalog project consists of developing an application that provides a list of items within a variety of categories, as well as provide a user registration and authentication system."

Project Structure

.
├── application.py
├── client_secrets.json
├── catalogdb_setup.py
├── fakedb.py
├── catalog.db
├── README.md
├── static
│   └── style.css
└── templates
    ├── categories.html
    ├── categoryItems.html
    ├── deleteCategoryItem.html
    ├── editCategoryItem.html
    ├── header.html
    ├── itemDescription.html
    ├── login.html
    └── newCategoryItem.html

Instructions

  1. Download and install Vagrant.

  2. Download and install VirtualBox.

  3. Clone or download the Vagrant VM configuration file from here.

    • You will end up with a new directory containing the VM files.

    • Change directory to the vagrant directory:

      cd vagrant/
  4. In vagrant/ run:

    vagrant up
  5. Connect to the VM by running:

    vagrant ssh
  6. Type cd /vagrant/ to navigate to the shared repository.

    • "Files in the VM's /vagrant directory are shared with the vagrant folder on your computer. But other data inside the VM is not. For instance, the PostgreSQL database itself lives only inside the VM."
  7. Download this repository in the catalog/ folder

  8. Set up the database:

    python catalogdb_setup.py
  9. Insert dummy values:

    python fakedb.py
  10. Run application.py:

    python application.py
  11. Open http://localhost:5000/ in your favourite Web browser, and enjoy.

JSON Endpoints

Returns JSON of all categories /catalog.json

Returns JSON of all category items /catalog/items/json

Returns JSON of specific category items /catalog/<int:category_id>/<int:item_id>/json