Topic 5: Capstone
Create an API with serverless functions that display movie information. Don't forget to create a GitHub repo and document in your README.md
Capstone Steps
Create Your Cloud Infrastructure:
- Use an SDK to set up your cloud infrastructure.
- You will need a NoSQL database, cloud storage, and serverless functions.
- Depending on the cloud provider (AWS, Azure, Google Cloud), additional setup steps may be required.
Prepare Your Data:
- Find movie data or create it and store it in your cloud NoSQL db.
- Store movie cover images of each movie in cloud storage.
Create Serverless Functions:
- GetMovies: Returns a JSON list of all movies in your database. Ensure the response includes a URL for the movie cover.
- GetMoviesByYear: Returns a list of movies released in a specified year. The year is provided by the client.
- EXTRA CREDIT - GetMovieSummary: Returns a summary generated by AI for a specified movie.
Example Data Model
Your movie data model could look like:
{
"title":"title of the movie",
"releaseYear":"when the movie was released",
"genre":"genre of the movie",
"coverUrl":"url-to-image-in-cloud-storage"
}
Example API Endpoints
- GetMovies
yourapi.com/getmovies
[
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg"
},
{
"title": "The Shawshank Redemption",
"releaseYear": "1994",
"genre": "Drama, Crime",
"coverUrl": "https://example.com/shawshank-redemption.jpg"
},
{
"title": "The Dark Knight",
"releaseYear": "2008",
"genre": "Action, Crime, Drama",
"coverUrl": "https://example.com/dark-knight.jpg"
}
]
- GetMoviesByYear
yourapi.com/getmoviesbyyear/2010
[
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg"
}
]
- GetMovieSummary
yourapi.com/getmoviesummary/inception
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg",
"generatedSummary": "A mind-bending sci-fi thriller about dream theft and manipulation."
}
Things you should be familiar with at the end of this phase
Programming
- Variables: Understand how to declare and use variables.
- Data Types: Familiarize yourself with different data types (e.g., strings, integers, lists, dictionaries).
- Comments: Learn to write comments to document your code.
- Functions: Learn to define and call functions.
- Object-Oriented Programming (OOP): Understand the basics of OOP (classes, objects, inheritance).
- Lists: Learn how to create and manipulate lists.
- Modules: Understand how to use and import modules.
- Dictionaries: Learn to use dictionaries for key-value data storage.
- Loops: Master loops (for, while) to iterate over data.
- Control Statements: Understand conditional statements (if, else, elif).
- Exceptions: Learn to handle exceptions and errors in your code.
Git
- Create a Git Repo Locally: Initialize a repository and add files.
- Create a GitHub Repo and Clone It Locally: Understand the process of creating a remote repository and cloning it.
- Create a Git Branch: Learn to work with branches.
- Add Changes to a Git Branch: Stage and commit changes.
- Merge Git Changes: Merge changes from different branches.
- Document Code with a README: Write clear and informative README files.