This project was developed using Flask. Flask is a light weight web framework written in python. The code also utilizes material design lite.
- CRUD
- Oauth2 - Google Authentication
- Cross site
- Image Handling using raw url
The environment leverages a Vagrant VM. There is a shell script written by Udacity called pg_config.sh. I have modified the original script to create the sportsvenue database. You can still access the original script via pg_config.sh.bak (bak - stands for backup script)
If the script does not function properly, do the following command:
cp pg_config.sh.bak pg_config.sh
This will restore the original script.
-
Clone the github repo:
git clone https://github.com/harushimo/fullstack-nanodegree-vm.git
-
Type this command:
cd fullstack-nanodegree-vm/vagrant directory
-
Run the command
vagrant up
. This command will create a Vagrant file in your directory. -
After the Vagrant VM is setup, you must type in the command:
vagrant ssh
-
Run
python database_setup.py
.
The data is store in postgresql database.
There is a shared folder called vagrant inside the virtual machine. You must type this command while in the VM: cd /vagrant
sudo su - postgres
psql
CREATE DATABASE sportsvenue;
CREATE USER vagrant WITH PASSWORD 'vagrant';
GRANT ALL PRIVILEGES ON DATABASE sportsvenue TO vagrant;
\q
exit
Please create sports user, the database_setup.py will run.
CREATE USER sports WITH PASSWORD 'sports';
GRANT ALL PRIVILEGES ON DATABASE sportsvenue TO sports;
For the create user, you can input any password you like.
When inside the virtual machine, run the following commands
cd fullstack/vagrant/catalog
python application.py
This will run an local instance of the application. Type in the browser: 'https://localhost:5000'
click the login button.
Once Login, a new screen will show up with AddVenue and Logout
To Add/Edit a new venue
- Type the venue name and description
- Enter the raw image url
- Google your favorite venue image, click the option view image. It will take you image url link. Copy that url and paste into the form. The image will render. Here is a sample page
Click on the Delete button. It will take you the delete page: