Skip to content

frost-byte/catalog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Catalog App

Installation

Install Vagrant
Install VirtualBox
Clone this project

  1. Use One of the Following Programs
    • Git Bash on Windows
    • Terminal on Mac
    • Shell on Linux  
  • Navigate to the vagrant folder in the cloned repository.
  • Type the command vagrant up
  • Type vagrant ssh to connect to the vagrant VM. (see below for setting up SSH on Windows)

Check the section Using the Vagrant Virtual Machine here for more information.

SSH on Windows

If you opt to use cmd.exe in Windows, you will be able to bring up the Vagrant VM. However, when you try to use "vagrant ssh" you will probably receive a message similar to the following:

`ssh` executable not found in any directories in the %PATH% variable. Is an
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
contain an SSH client. Or use your favorite SSH client with the following
authentication information shown below:

Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: C:/Path/to/catalog/vagrant/.vagrant/machines/default/virtualbox/private_key

If you are running Windows, then the private_key.ppk included in this same directory can be used in PuTTY to ssh into the Vagrant/VirtualBox VM.

Follow the guide under the References SSH section. The following configuration should be setup in PuTTY:

####Session Host Name: 127.0.0.1 or localhost

####Connection -> Data Auto-login username: vagrant

####Connection -> SSH -> Auth Private key file for authentication: Browse to the .ppk file in

Once you've specified the above, go back to Session and under Saved Sessions enter a name for your config and click the "Save" button to the right of the list of Saved Sessions.

From this point on all you'll have to do to start the session is open PuTTY and double click on your config in the Saved Sessions list.

The Database

From your ssh terminal, navigate to the project's root directory.

cd /vagrant/catalog

Run the script to populate the Database.

python catalog/populator.py -r

Google OAuth2 API

Refer to the instructions Here to setup OAuth2.

Open the Google Developer's Console and perform the following steps.

####Consent Screen

  1. Set Product name shown to users to CatalogApp
  2. Click Save.

####Credentials

  1. Under the API Manager, Select Credentials in the Sidebar.
  • Select the Credentials tab in the main view.
  • Click on the Add credentials dropdown button.
  • Specify OAuth 2.0 client ID
  • For Application Type select the Web application radio button
  • Enter Catalog App in the Name field.
  • In the Authorized redirect URIs field enter http://localhost:5000/gconnect
  • Click Save to store the credentials
  • Then click the Download JSON button.
  • Save the client_secret.json file to the project's root directory: /vagrant/catalog

####Google APIs

  1. Under the API Manager in the Google Developer's Console, click Overview in the sidebar.
  • Click the Google APIs tab in the main view.
  • Under Social APIs select Google+ API
  • If not already enabled, click the Enable API button

Server

From the project's root directory - /vagrant/catalog
python runserver.py

Client

Open a browser page to localhost:5000

Endpoints

The following api endpoints have been provided for the Catalog app.

JSON
localhost:5000/catalog/JSON

XML
localhost:5000/catalog/XML

The Catalog APP

Without logging in, you should be able to only view records, these include:

  1. All Items.
  • Items in each Category.

After logging into the app using Google+ you should be able to do the following:

  1. Add new Items to a Category.
  2. Edit Items that you have created.
  3. Delete Items that you have created.

The Add and Edit forms allow you to upload an image for an Item.

Requirements

  • Vagrant VM
  • VirtualBox
  • Clone of this Repository

Libraries

##References

###Documentation The docs for this project can be viewed here.

###Code Formatting Pep8 Online
An online python formatting tester.

Flake8
A Handy, command line tool for checking the formatting of your python code.

###Code Attributions

###Other API and Coding References Stack Overflow
A go to resource for solving all problems related to coding.

W3Schools
Great reference for all languages and specifications for programming web based content. HTML, CSS, jQuery, Javascript...

###SSH How To Use SSH Keys with PuTTY and PuTTYGen
PuTTY for Windows

About

Fullstack Catalog Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •