You want stuff? Yeah, we got stuff.
This is a practice web application that provides functionality for an item catalog.
- Users can log in with Google or Facebook
- Users have a shopping cart to buy items in the catalog.
- Users can add products to the catalog to sell
- Users can upload images for their products.
- Front-end done with Bootstrap and includes pagination and carousels.
- Forms are created with WTF-Forms, which do form validation and eliminate cross-site request forgery attacks.
- Server side framework is Flask
- Google and Facebook logins are handled server-side
- DB-API is Flask-SQLAlchemy
- Offers RESTful API in JSON format
- Offers RSS and Atom feeds
- RSS and Atom feeds are rebuilt as a scheduled task using Flask-APScheduler
- Server-side error handling
- Project built in a Vagrant virtual machine
You will need Vagrant and VirtualBox in order to use this project
- Clone the repo
- At the command line, navigate to the repo’s directory.
- Fire up the virtual machine with
vagrant up
- Log into the virtual machine with
vagrant ssh
- Navigate to the server directory with
cd /vagrant/catalog/
- Start the server with
python runserver.py
- Navigate in your browser to
http://localhost:8000
To populate the database with mock records:
- Navigate to
cd /vagrant/catalog/
at the command line - Run
python populator.py
After running the populator, you can easily login with the populator’s non-Google, non-Facebook account by navigating to /login
. This route is only provided for testing and debugging purposes. Remove this route and its function(login()
) in views.py
before putting this website in production.
All JSON requests are HTTP GET requests. The base directory is the domain name. For example, http://localhost:8000/categories/json
to request all categories
- Get a list of all categories at
/categories/json
- Get a list of all products in a category at
/category/{category_id}/products/json
- Get detailed product information at
/product/{product_id}/json
- Get reviews for a specific product at
/product/{product_id}/reviews/json
Get the “newly-added” RSS and Atom feeds at /rss/newly-added.xml
and /atom/newly-added.xml
A photos provided here are from Pixabay and are under a Creative Commons license
This project is provided under MIT License.