This project is part of Udacity's Full Stack Developer Nanodegree.
This project implements a web application that lets restaurant owners show their menus. It's built with:
- Server-side: Python plus the Flask framework.
- Database: SQLAlchemy backed by a PostgreSQL database. Also tested with SQLite during development.
- Front-end: HTML5/CSS3, with a Bootstrap interface and some jQuery.
Extra details can be found at: http://www.oscardc.com/project/restaurant-menu
How to run the project
To run the project tests, follow these steps:
- Install Vagrant if you don't have it already.
- Grab a copy of the project. You can either:
- Clone the repo with git:
git clone https://github.com/OscarDoc/fullstack-nanodegree-vm.git.
- Clone with GitHub Desktop.
- Download the latest release
- Open a command-line window and go to the /fullstack-nanodegree-vm/vagrant folder of the project.
- Once in it, run
vagrant up. That command will load the Virtual Machine, which contains the development environment.
- SSH into the machine with the username
vagrant. Depending on your OS:
- NOT Windows: just run
- Windows: Running
vagrant sshwill mourn that it's not possible and provide you an IP/port to log in. So, to log in, download PuTTY and follow the instructions found here, which basically explain how to use the Vagrant VM certificate in PuTTY.
- Once inside the VM, run
- Instal Python dependencies;
sudo pip install -r requirements.txt
- To start the web, just run
- Once it's started, it will be available from the brwoser at localhost:5000.
Within the download you'll find the following directories and files, logically grouping common assets. You'll see something like this:
├── vagrant/ │ ├── restaurants/ THIS PROJECT │ │ ├── README.md THIS FILE │ │ ├── static/ JS and CSS files │ │ │ ├── app.js jQuery functionalities │ │ │ └── style.css Web style, based on Bootstrap │ │ ├── templates/ Flask templates of the site │ │ │ │── partials/ Common sub-templates (head html, navigation bar, flash messages) │ │ │ └── *.html The name of each template is self-descriptive │ │ ├──database.py SQLAlchemy-based definition of the DB │ │ ├──lotsofmenu.py Running this script fills the DB with demo data │ │ ├──daos.py Data-Access Objects; implement the operations on the DB through SQLAlchemy │ │ ├──project.py MAIN SCRIPT. Contains the web Flask routes │ │ ├──project_api_endpoints.py Flask routes implementing JSON and ATOM endpoints │ │ ├──project_oauth.py Flask routes implementing OAuth │ │ ├──client_secrets_fb.json Facebook OAuth secrets file │ │ ├──client_secrets_gc.json Google OAuth secrets file │ │ ├──Procfile Script for foreman │ │ └──requirements.txt Configuration for Heroku │ ├── tournament/ Project 2 of the Full-stack Nanodegree │ ├── Vagrantfile Virtual machine configuration │ └── pg_config.sh Script that install everything needed in the VM └── README.md Repository readme file