This application was completed as the capstone project in the Udacity Full Stack Nanodegree course. It covers the following technical topics that were explored throughout the course, such as:
- Database modeling with
postgres
andsqlalchemy
(inmodels.py
) - Performing CRUD operations on a database with
Flask
(inapp.py
) - Automated testing with
Unittest
(intest_app.py
) - Authorization and role based authentication with
Auth0
(inauth.py
) - Deploying containerized applications on services such as
Heroku
Make sure you are running an updated version of Python 3 as well as postgres
- optional Initialize a virtual environment
$ python3 -m venv env $ source venv/bin/activate
- Install dependencies
$ pip install -r requirements.txt
- This application uses environment variables for dateabase url and auth0 config. Edit the setup.sh file and then activate it.
$ source setup.sh
- Run the application
$ flask run
- optional Test the application by running
$ python3 test_app.py
Here you'll find documention on all end points and supported methods, as well as role based permissions needed for each.
https://camueller-capstone.herokuapp.com
The entire application is unavailable without the permissions offered by one or two roles.
- Read Only - you'll find the auth key for this role in setup.sh as variable READONLY_KEY
- RBAC permissions: get:albums, get:bands
- Manager - you'll find the auth key for this role in setup.sh as variable MANAGER_KEY
- RBAC permissions: get:albums, get:bands, post:album, post:band, patch:album, patch:band, delete:album, delete:band
requires_auth(get:bands) returns json object list of bands
requires_auth(get:albums) returns json object list of albums
requires_auth(post:band) takes a json object of a band in the format
{
'name': 'band_name',
'city': 'some city',
'state': 'MO'
}
and returns a json object like this:
{
'success': True,
'band': {
'name': 'band_name',
'city': 'some city',
'state': 'MO'
}
}
requires_auth(post:album) takes a json object of an album in the format
{
'title': 'album_title',
'band_id': int
}
and returns a json object like this:
{
'success': True,
'album': {
'title': 'band_name',
'band_id': int
}
}
requires_auth(delete:band) takes a band id via the url and returns json object in this format:
{
'success': True,
'band_id': int
}
requires_auth(delete:band) takes an album id via the url and returns json object in this format:
{
'success': True,
'album_id': int
}
requires_auth(patch:band) takes a band id via the url and a json object of a band in the format
{
'name': 'band_name',
'city': 'some city',
'state': 'MO'
}
and returns a json object in this format:
{
'success': True,
'band': {
'name': 'band name',
'city': 'city name',
'state': 'MO'
}
}
requires_auth(patch:album) takes an album id via the url and an album in the following json format:
{
'title': 'album_title',
'band_id': int
}
and returns a json object in this format:
{
'success': True,
'band': {
'name': 'band name',
'city': 'city name',
'state': 'MO'
}
}