Skip to content

pdragosh/fullstack-nanodegree-vm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Getting Started

This project is based off the common code for the Relational Databases and Full Stack Fundamentals courses. It was forked from this repository: (http://www.google.com/url?q=http%3A%2F%2Fgithub.com%2Fudacity%2Ffullstack-nanodegree-vm&sa=D&sntz=1&usg=AFQjCNF4G_pOh1CiYbR4pZqE3CsEH5ShaQ).

In order to run the projects, you must install vagrant and VirtualBox. You use vagrant to run a virtual machine that hosts an operating system with Postgresql installed in the image.

Open a terminal window and then clone this project to a local directory.

prompt> cd fullstack-nanodegree-vm/vagrant
prompt> vagrant up
prompt> vagrant ssh

Vagrant will dump informational messages and status as it installs any missing components and brings the VM up. Once down, you need to cd to the vagrant directory which will sync with the local filesystem that contains you're cloned image of the code.

vagrant-ssh-prompt> cd /vagrant

You would then cd to the directory of the project you are interested in running.

Project 2

For Project 2, the actual code is located in the vagrant/tournament sub-directory. While in the vagrant VM you would do the following:

vagrant-ssh-prompt> cd /vagrant/tournament

The SQL database and tables need to be loaded first. The sql code is located in tournament.sql. Use psql (a postgresql command line application) to do so.

vagrant-ssh-prompt> psql \i tournament.sql

The python code that supports the tournament is located in tournament.py. There is test code located in tournament_test.py. Use the test code to run the application code:

vagrant-ssh-prompt> python tournament_test.py

You should see the following output:

1. Old matches can be deleted.
2. Player records can be deleted.
3. After deleting, countPlayers() returns zero.
4. After registering a player, countPlayers() returns 1.
5. Players can be registered and deleted.
6. Newly registered players appear in the standings with no matches.
7. After a match, players have updated standings.
8. After one match, players with one win are paired.
Success!  All tests pass!

Project 3

For Project 3, the actual code is located in the vagrant/catalog sub-directory. While in the vagrant VM you would do the following:

vagrant-ssh-prompt> cd /vagrant/catalog

The database needs to be setup first and optionally populated.

vagrant-ssh-prompt> python setup_database.py
vagrant-ssh-prompt> python populate_database.py

To run the catalog web-server, do the following:

vagrant-ssh-prompt> python application.py

You should see the output such as:

* Running on http://0.0.0.0:5000/
* Restarting with reloader

Open a web browser and type in the url: http://0.0.0.0:5000/

You should be able to view the categories in the catalog and any pre-loaded items. In addition, you can download the JSON representation of either all the categories, items in a category or an item itself.

If you chose to login (click the "login" link on the home page), then you can add categories and items. For those categories and items, you can edit or delete them.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 94.2%
  • CSS 2.1%
  • Python 1.6%
  • PHP 1.5%
  • JavaScript 0.6%
  • Shell 0.0%