This is my final capstone project for Udacity's FullStack Web Developer Nanodegree. Quotations system is a system that manage quotes said by people Web app can be accessed at here
- Flask - Slim python web library.
- SQLAlchemy - Python ORM library
- Heroku - PaaS platform for easy hosting of web apps
- curl - API testing tool
- Clone project to directory of your choice.
- Create a virtualenv in project directory
- run
pip install -r requirements.txt
to install project dependencies - add
DATABASE_URL
to environment variables of your system. On Unix systems, useexport DATABASE_URL={username}:{password}@{host}:{port}/{database_name}
- run
python3 app.py
###Endpoints:
- GET /persons and /quotes
- DELETE /persons and /quotes
- POST /persons and /quotes
- PATCH /persons and /quotes
-
reader
- GET /persons/ and /quotes
-
editor
- GET /persons/ and /quotes
- ADD /persons/ and /quotes
- PATCH /persons/ and /quotes
-
admin
- GET /persons/ and /quotes
- ADD /persons/ and /quotes
- PATCH /persons/ and /quotes
- DELETE /persons/ and /quotes
If you would like to setup your own account with my Auth0 instance, you can do so at the URL below. Auth0 URL: here
Verifies that application is up and running on Heroku.
Sample response:
{
"description": 'Quotation system is running.'
"success": true
}
Displays all quotes listed in the database.
Sample response:
{
"quotes": [
{
"description": "do something useful",
"id": 1,
"person_id": 3,
"title": "Do somethingelse"
},
{
"description": "do something useful",
"id": 2,
"person_id": 3,
"title": "Mohamed"
},
],
"success": true,
"total_quotes": 2
}
Displays all persons listed in the database.
Sample response:
{
"persons": [
{
"id": 1,
"name": "Mohamed"
},
{
"id": 2,
"name": "Mohamed"
},
],
"success": true,
"total_persons": 2
}
}
Creates a new person entry in the database.
Sample response:
{
"created": 3,
"persons": [
{
"id": 1,
"name": "Mohamed"
},
{
"id": 2,
"name": "Mohamed"
},
{
"id": 3,
"name": "Mohamed"
},
],
"success": true,
"total_persons": 3
}
Creates a new quote entry in the database.
Sample response:
{
"created": 12,
"quotes": [
{
"description": "do something useful",
"id": 1,
"person_id": 3,
"title": "Do somethingelse"
},
{
"description": "do something useful",
"id": 2,
"person_id": 3,
"title": "Mohamed"
},
{
"description": "do something useful",
"id": 3,
"person_id": 4,
"title": "Mohamed"
},
],
"success": true,
"total_quotes": 3
}
Updates quote information given a quote_id and newly updated attribute info.
Sample response:
{
"quote_id": 4,
"success": true
}
Updates person information given a person_id and newly updated attribute info.
Sample response:
{
"person_id": 4,
"success": true
}
Deletes a quote entry from the database given the inputted quote_id.
Sample response:
{
"id": 7,
"success": true
}
Deletes an person entry from the database given the inputted person_id.
Sample response:
{
"id": 7,
"success": true
}