Project hosted in heroku: https://casting-agency-bz.herokuapp.com
Follow instructions to install the latest version of python for your platform in the python docs
We recommend working within a virtual environment whenever using Python for projects. This keeps your dependencies for each project separate and organized. Instructions for setting up a virtual environment for your platform can be found in the python docs
Once you have your virtual environment setup and running, install dependencies by navigating to the /backend
directory
and running:
pip install -r requirements.txt
This will install all of the required packages we selected within the requirements.txt
file.
-
Flask is a lightweight backend microservices framework. Flask is required to handle requests and responses.
-
Flask-SQLAlchemy and Psycopg is a library and adapter to handle the PostgreSQL database.
-
Flask-Migrate is an extension that handles SQLAlchemy database migrations for Flask applications using Alembic.
-
jose JavaScript Object Signing and Encryption for JWTs. Useful for encoding, decoding, and verifying JWTS.
createdb cagency
On your first local run, source the setup.sh file. It defines shell environment variables necessary for the project. Run:
source setup.sh
From within the main directory first ensure you are working using your created virtual environment. Run:
python run.py
To run the tests, run
dropdb cagency_test
createdb cagency_test
python test_app.py
The repository has a Postman collection file, in which tokens were not included. Please edit the tokens on the json file before using the collection to test the endpoints.
Response:
{
"actors": [{
"age": 45,
"dob": "19. July 1976",
"gender": "m",
"id": 1,
"name": "Benedict Cumberbatch"
}]
}
Response:
{
"movies": [
{
"id": 1,
"release": "Sunday, 22. April 2001",
"title": "Shrek"
},
{
"id": 2,
"release": "Friday, 26. October 1984",
"title": "The Terminator"
}]
}
Response:
{
"deleted": 4,
"success": true
}
Response:
{
"deleted": 1,
"success": true
}
Request body (json):
{
"name": "Benedict Cucumberbatch",
"birthdate": "1976-07-19",
"gender": "m"
}
Response:
{
"added": {
"age": 45,
"dob": "19. July 1976",
"gender": "m",
"id": 1,
"name": "Benedict Cucumberbatch"
},
"success": true
}
Request body (json):
{
"title": "Terminator",
"release": "1984-10-26"
}
Response:
{
"added": {
"id": 5,
"release": "Friday, 26. October 1984",
"title": "Terminator"
},
"success": true
}
Request body (json):
{
"name": "Benedict Cumberbatch",
"birthdate": "1976-07-19",
"gender": "m"
}
Response:
{
"success": true,
"updated": {
"age": 45,
"dob": "19. July 1976",
"gender": "m",
"id": 1,
"name": "Benedict Cumberbatch"
}
}
Request body (json):
{
"title": "Pulp Fiction",
"release": "1994-05-21"
}
Response:
{
"success": true,
"updated": {
"id": 4,
"release": "Saturday, 21. May 1994",
"title": "Pulp Fiction"
}
}
Authentication route: /login
- Assistant
- Can view actors and movies
- Director
- All permissions a Casting Assistant has and…
- Add or delete an actor from the database
- Modify actors or movies
- Producer
- All permissions a Casting Director has and…
- Add or delete a movie from the database