Skip to content

Commit

Permalink
Merge pull request #231 from learntocloud/updatedictionarylink
Browse files Browse the repository at this point in the history
Updatedictionarylink
  • Loading branch information
madebygps authored Jan 23, 2025
2 parents dac89f7 + 05f18bd commit 409c3e6
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 159 deletions.
25 changes: 25 additions & 0 deletions docs/phase2/1-python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Topic 1: Python Basics

In the previous topic, you were introduced to programming and Python. In this step we want to further improve your Python skills.

- Study: [Python Crash Course](https://nostarch.com/pythoncrashcourse2e) by Eric Matthes
We reccomend you work through every chapter and projects.

This book is a great resource for beginners to learn Python programming. It covers the basics of Python syntax, data structures, functions, and modules. The book also includes hands-on projects to help you practice your skills and build real-world applications.

## Test your knowledge

Once you are done with the book, watch the [CS50 lecture on Python](https://youtu.be/LfaMVlDaQ24?feature=shared&t=49364). Everything here should make sense to you, if not, you are not ready to move on.

Test your knowledge with an AI assistant, here are some example prompts to test your Python knowledge:

1. Can you ask me about the difference between a list and a tuple in Python?
2. Can you quiz me on how to create a dictionary in Python?
3. Can you ask me to explain the concept of list comprehensions with an example?
4. Can you ask me what a lambda function is and how it is used?
5. Can you quiz me on how to handle exceptions in Python?
6. Can you ask me about Python decorators and how they work?
7. Can you ask me to explain the difference between `__init__` and `__new__` methods in Python classes?
8. Can you quiz me on how to read and write files in Python?
9. Can you ask me about generators in Python and how they differ from regular functions?
10. Can you quiz me on how to use the `map`, `filter`, and `reduce` functions in Python?
18 changes: 18 additions & 0 deletions docs/phase2/2-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Topic 2: Rest API

In the previous topic, the reccomended book introduced you to Django, so you should have some context and knowledge about how REST APIs work. In this step we want to further improve your knowledge on REST APIs.

- Study: [What Is REST API?](https://www.youtube.com/watch?v=-mN3VyJuCjM/) by Byte Byte Go
- Study: [REST API Concepts and Examples](https://www.youtube.com/watch?v=7YcW25PHnAA) by WebConcepts
- Watch [RESTful APIs in 100 Seconds](https://youtu.be/-MTSQjw5DrM?feature=shared)

## Test your knowledge

Once you are done with the videos, test your knowledge with an AI assistant, here are some example prompts to test your REST API knowledge:

1. Can you ask me to explain what REST stands for and how it works?
2. Can you quiz me on the difference between a REST API and a SOAP API?
3. Can you ask me to explain the concept of resources in REST?
4. Can you ask me to explain the difference between PUT and POST requests in REST?
5. Can you quiz me on how to use the HTTP methods GET, POST, PUT, and DELETE in REST?
6. Can you ask me to explain the concept of status codes in REST and give examples?
17 changes: 17 additions & 0 deletions docs/phase2/3-fastapi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Topic 3: Fast API

Fast API is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints. It is the framework we use to build the L2C journal application and what you will use as well.

- Study: [FastAPI official tutorial](https://fastapi.tiangolo.com/tutorial/) by FastAPI

## Test your knowledge

Once you are done with the tutorial, test your knowledge with an AI assistant, here are some example prompts to test your FastAPI knowledge:

1. Can you ask me to explain what FastAPI is and how it works?
2. Can you quiz me on how to create a FastAPI application and define endpoints?
3. Can you ask me to explain how to handle request and response models in FastAPI?
4. Can you ask me to explain how to use path parameters and query parameters in FastAPI?
5. Can you quiz me on how to use dependency injection in FastAPI?
6. Can you ask me to explain how to use Pydantic models in FastAPI?
7. Can you ask me to explain how to use FastAPI with asynchronous code?
31 changes: 31 additions & 0 deletions docs/phase2/4-databases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Topic 4: Databases

We will be using a database to store our application data. For this we need to first understand how databases work and how to interact with them. Let's start with the basics.

- Study: [Intro to SQL](https://www.khanacademy.org/computing/computer-programming/sql)

Then, decide which cloud you will use. For AWS, you will use DynamoDB, and for Azure, you will use Cosmos DB.

- Study: [AWS DynamoDB Tutorial For Beginners](https://www.youtube.com/watch?v=2k2GINpO308)

- Study: [Azure Cosmos DB Essentials Playlist](https://youtube.com/playlist?list=PLLasX02E8BPDd2fKwLCHnmWoyo4bL-oKr&feature=shared/)

Then do the Python quickstart for the database you chose.

- Action: [AWS DynamoDB Python Quickstart](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/example_dynamodb_Scenario_GettingStartedMovies_section.html)


- Action: [Azure Cosmos DB Python Quickstart](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/quickstart-python)

## Test your knowledge

Once you are done with the tutorials, test your knowledge with an AI assistant. Here are some example prompts to test your database knowledge:

1. Can you ask me to explain what a database is and how it works?
2. Can you quiz me on the difference between SQL and NoSQL databases?
3. Can you ask me to explain the concept of CRUD operations in databases?
4. Can you ask me to explain how to connect to a database from a Python application?
5. Can you quiz me on how to perform CRUD operations in a database using Python?
6. Can you ask me to explain how to use an ORM (Object-Relational Mapping) library in Python?
7. Can you ask me to explain how to use a NoSQL database like DynamoDB or Cosmos DB?
8. Can you quiz me on how to model data in a NoSQL database like DynamoDB or Cosmos DB?
7 changes: 7 additions & 0 deletions docs/phase2/5-build-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Topic 5: Build the Application

Ok now you have all the knowledge you need to build the application. You will be building the API for the application. The frontend will be provided to you. The starter repo has the frontend code and the API code. You will be working on the API code.

The repo readme has all the information you will need.

- Action: Go to the [starter repo](https://github.com/learntocloud/journal-starter)
178 changes: 21 additions & 157 deletions docs/phase2/README.md
Original file line number Diff line number Diff line change
@@ -1,173 +1,37 @@
# Phase 2: Programming

Author: [GPS](https://twitter.com/madebygps)

## How does this phase apply to Cloud?

Welcome to Phase 2, this one is all about programming, specifically with Python.

Programming is a fundamental skill for cloud engineering, enabling you to create, manage, and optimize cloud resources efficiently.

You don't need to know how to build UIs but you need to know how to work with APIs and other cloud services like storage, databases, etc. Knowing how to program will make you more competitive in the hiring market.

Continuing with our hands-on approach, we've prepared an application and it's starter code for you to build out. You will be focused on building the API, the frontend we will fully provide. You first must go through the content of this phase to gain knowledge to build the application out.

<!--truncate -->
<iframe width="100%" height="315" src="https://www.youtube.com/embed/AZhINW89kbM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>


## How to break down this phase

There are several programming languages that are popular with Cloud: Python, Go, Rust, .NET, JavaScript. If you know any of these, you can continue using them, if not, I would go with [Python](https://www.python.org/). It's a very popular language and there are many quality free resources out there to learn it.

Continue adding your projects to your GitHub profile that you created in the past phase.

I would suggest spending time on these two topics and this timeline:

| Order | Topic |
|-------|---------------------------------|
| 1 | Learn to Code |
| 2 | Learn Prompt Engineering |


## Resources

| Order | Title | Notes |
| :---- | :--------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| 1 | [Python Crash Course](https://ehmatthes.github.io/pcc/) | A great Python book, also there is an Appendix in there on Git which is great!
1 | [Python for Beginners](https://www.youtube.com/playlist?list=PLlrxD0HtieHhS8VzuMCfQD4uJ9yne1mE6) | A 44 part video series introducing you to Python |
1 | [7 Days of Python](https://7daysofpython.com/) | A 7 day guide to Python
| 2 | [A Beginner's Guide to Prompt Engineering with GitHub Copilot](https://dev.to/github/a-beginners-guide-to-prompt-engineering-with-github-copilot-3ibp) | An article by [Rizèl Scarlett](https://twitter.com/blackgirlbytes) on how to get the most out of GitHub Copilot.|


## Capstone Project: Serverless Movies API.

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

1. **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.

2. **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.

3. **Create Serverless Functions:**
1. **GetMovies:** Returns a JSON list of all movies in your database. Ensure the response includes a URL for the movie cover.
2. **GetMoviesByYear:** Returns a list of movies released in a specified year. The year is provided by the client.
3. **EXTRA CREDIT - GetMovieSummary:** Returns a summary generated by AI for a specified movie.

#### Example Data Model

Your movie data model could look like:
```json
{
"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`

```json
[
{
"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`

```json
[
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg"
}
]
```

- **GetMovieSummary** `yourapi.com/getmoviesummary/inception`

```json
{
"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.


## Optional Capstone Project: Serverless Movies API - Infrastructure as Code

Having completed the Serverless Movies API, this optional project is to do the same thing but via Infrastructure as Code. This should be easier due to having the structure and Movies API as a reference point.

### Capstone Steps
As learners finish this phase, many will share their code. We recommend you do not copy and paste anybody's solution. You are only doing a disservice to yourself and will not make it in this field if that is the mentality you have.

The same steps are required as the original Capstone project, but are to be done using Infrastructure as code. (Terraform is recommended).
Additionally, we recommend you turn off any AI assistants you might have for code completion, though using AI to ask for explanations and clarification is highly recommended. We will continue to suggest prompts throughtout the guide.

1. **Create Your Cloud Infrastructure:**
## Objectives

- Use IaC 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.
By the end of this phase, you will have:

2. **Follow The Steps from The First Capstone Project**
- Learned the basics of programming and Python
- Learned the basics of how REST APIs work
- Learned the basics of FastAPI
- Learned how to use cloud SDKs to interact with cloud services via code
- Completed the [starter repo]() functionality

### Things you should be familiar with at the end of this optional project
## Prerequisites

- **Understanding IaC Principles**: Grasp the core concepts of IaC, including automation of infrastructure provisioning, version control of infrastructure configurations, and the ability to replicate environments consistently.
- **Declarative Configuration**: Learn how to define the desired state of your infrastructure in code, allowing tools to manage the creation and updates automatically.
- Mac OS or a Ubuntu based computer. If you're on Windows, you'll use WSL.

## Topics

| No. | Topic |
|-----|------------------------------|
| 1 | [Python](1-python.md) |
| 2 | [APIs](2-api.md) |
| 3 | [Rest API](3-fastapi.md) |
| 4 | [Fast API](4-database.md) |
| 5 | [Build the app](5-build-app.md) |
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const config = {
label: 'Guide',
},
{
href: 'https://definethecloud.guide/',
href: 'https://dictionary.learntocloud.guide/',
label: 'Cloud Dictionary',
position: 'left',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Te sugerimos invertir tiempo en estos 3 temás con este cronograma::
| Título | Descripción |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [Crear tu perfil de GitHub](https://docs.github.com/en/github/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme) | Crear tun README para contrar a otros acerca de vos en GitHub |
| [Enviar una Definición al Diccionario de Nube](https://definethecloud.guide/) | Aparece en la página de inicio de LTC y contribuí a un proyecto de código abierto! |
| [Enviar una Definición al Diccionario de Nube](https://dictionary.learntocloud.guide/) | Aparece en la página de inicio de LTC y contribuí a un proyecto de código abierto! |
| [7 Días de Python](https://7daysofpython.com/) | Crea un Blog impulsado por Python |

## Conceptos que te deberían ser familiar al final de esta fase
Expand Down

0 comments on commit 409c3e6

Please sign in to comment.