Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wangonya/casting_agency
Udacity capstone project
https://github.com/wangonya/casting_agency
Last synced: about 1 month ago
JSON representation
Udacity capstone project
- Host: GitHub
- URL: https://github.com/wangonya/casting_agency
- Owner: wangonya
- Created: 2019-12-04T14:51:49.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T03:17:57.000Z (about 2 years ago)
- Last Synced: 2023-03-03T04:21:59.255Z (almost 2 years ago)
- Language: Python
- Size: 103 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Casting Agency
Casting Agency models a company that is responsible for creating movies and managing and assigning actors to those movies.
Hosted on heroku. [Link](https://udacity-casting-agency.herokuapp.com/).
## Motivation
This is my capstone project for the Udacity FSWD nanodegree.
## Dependencies
All dependencies are listed in the `requirements.txt` file.
They can be installed by running `pip3 install -r requirements.txt`.## Authentication
The API has three registered users:
1. Assistant
```
email: [email protected]
password: [email protected]
```2. Director
```
email: [email protected]
password: [email protected]
```3. Producer
```
email: [email protected]
password: [email protected]
```The Auth0 domain and api audience can be found in `setup.sh`.
## Endpoints
### `GET /movies`
Gets all movies from the db.
Response:
```json5
{
"movies": [
{
"id": 1,
"movies": "all acted movies here",
"release_date": "2021-02-02",
"title": "Movie"
},
{
"id": 2,
"movies": "all acted movies here",
"release_date": "2019-01-01",
"title": "New movie"
}
],
"success": true
}
```### `POST /movies`
Adds a new movie to the db.
Data:
```json5
{
"title": "title",
"release_date": "release_date"
}
```Response:
```json5
{
'success': true,
'movie': 'title'
}
```### `PATCH /movies/`
Edit data on a movie in the db.
Data:
```json5
{
"title": "new title",
"release_date": "2021-02-02"
}
```Response:
```json5
{
'success': true,
'movie': {
"id": 1,
"movies": "all acted movies here",
"release_date": "2021-02-02",
"title": "new title"
}
}
```### `DELETE /movies/`
Delete a movie from the db.
Response:
```json5
{
'success': true,
'delete': 1
}
```### `GET /actors`
Gets all actors from the db.
Response:
```json5
{
"actors": [
{
"gender": "M",
"id": 1,
"movies": "all acted movies here",
"name": "actor"
},
{
"gender": "F",
"id": 2,
"movies": "all acted movies here",
"name": "ewwe"
}
],
"success": true
}
```### `POST /actors`
Adds a new actor to the db.
Data:
```json5
{
"name": "name",
"gender": "F"
}
```Response:
```json5
{
'success': true,
'actor': 'name'
}
```### `PATCH /actors/`
Edit data on a actor in the db.
Data:
```json5
{
"name": "new name",
"gender": "M"
}
```Response:
```json5
{
'success': true,
'actor': {
"gender": "M",
"id": 1,
"movies": "all acted movies here",
"name": "new name"
}
}
```### `DELETE /actors/`
Delete a actor from the db.
Response:
```json5
{
'success': true,
'delete': 1
}
```## Tests
To run the tests, run `python3 tests.py`.