- Видео 26
- Просмотров 96 965
microapis
Великобритания
Добавлен 5 май 2006
Hi! I'm Jose Haro Peralta, or just Jose. I'm a consultant, author, and insturctor based in London. I'm the author of Microservice APIs (www.manning.com/books/microservice-apis), the founder of microapis.io, and the creator of some popular open source libraries like fencer (github.com/abunuwas/fencer).
Check out my latest online course: 𝐁𝐮𝐢𝐥𝐝 𝐀𝐏𝐈𝐬 𝐰𝐢𝐭𝐡 𝐏𝐲𝐭𝐡𝐨𝐧: 𝐅𝐚𝐬𝐭𝐀𝐏𝐈 𝐄𝐝𝐢𝐭𝐢𝐨𝐧 👇
✅ microapis.teachable.com/p/build-apis-with-fastapi
For years I've worked with companies big and small all around the world to help them build microservices, deliver API integrations, automate their infrastructure, write better code, and adopt best practices.
My goal in this channel is to share with you everything I've learned over the past years about writing software and architecting systems.
I also write regularly in my newsletter 👇
✅ microapis.substack.com/
If you find my content interesting, don't forget to subscribe to my channel!
Check out my latest online course: 𝐁𝐮𝐢𝐥𝐝 𝐀𝐏𝐈𝐬 𝐰𝐢𝐭𝐡 𝐏𝐲𝐭𝐡𝐨𝐧: 𝐅𝐚𝐬𝐭𝐀𝐏𝐈 𝐄𝐝𝐢𝐭𝐢𝐨𝐧 👇
✅ microapis.teachable.com/p/build-apis-with-fastapi
For years I've worked with companies big and small all around the world to help them build microservices, deliver API integrations, automate their infrastructure, write better code, and adopt best practices.
My goal in this channel is to share with you everything I've learned over the past years about writing software and architecting systems.
I also write regularly in my newsletter 👇
✅ microapis.substack.com/
If you find my content interesting, don't forget to subscribe to my channel!
Running applications in Docker [2024] (Python + FastAPI example)
Run applications with Docker!
The code for this tutorial is available here: github.com/abunuwas/short-tutorials/tree/main/fastapi-docker
To follow along with the tutorial, please install Docker (www.docker.com/) in your system and follow the instructions to the get Docker daemon up and running. The Daemon must be running to be able to run Docker processes.
What is Docker? Docker is a virtualization technology that allows you to build lightweight images. Docker shares the kernel with the host machine instead of running its own kernel as traditional virtual machines do.
Say what...?
Let's put in simple terms: Docker is an engine that allows you to run your code in completely isolated environment...
The code for this tutorial is available here: github.com/abunuwas/short-tutorials/tree/main/fastapi-docker
To follow along with the tutorial, please install Docker (www.docker.com/) in your system and follow the instructions to the get Docker daemon up and running. The Daemon must be running to be able to run Docker processes.
What is Docker? Docker is a virtualization technology that allows you to build lightweight images. Docker shares the kernel with the host machine instead of running its own kernel as traditional virtual machines do.
Say what...?
Let's put in simple terms: Docker is an engine that allows you to run your code in completely isolated environment...
Просмотров: 208
Видео
Deploy with render.com tutorial (FastAPI example)
Просмотров 334Месяц назад
Deploy FastAPI applications to render.com! The code for this tutorial is available here: github.com/abunuwas/short-tutorials/tree/main/fastapi-render To follow along with the tutorial, please create an account with Render here: render.com/. I recommend signing in with GitHub to automatically link Render to your GitHub account. You don't need a paid subscription to follow the tutorial. How do yo...
Validate JWTs issued by Auth0 in FastAPI
Просмотров 380Месяц назад
Validate JSON Web Tokens (JWTs) issued by Auth0 in FastAPI To follow along with this tutorial, you need an account on auth0.com. Also make sure you follow all the steps in the previous videos: - "Setting up Auth0 for API Authentication and Authorization" (ruclips.net/video/PbUcQUQ7K2o/видео.html) to set up your Auth0 account - "Login and issue API access tokens with Auth0 and FastAPI" (ruclips....
Login and issue API access tokens with Auth0 and FastAPI
Просмотров 1,2 тыс.Месяц назад
Login and issue API access tokens with Auth0 and FastAPI To follow along with this tutorial, you need an account on auth0.com. Also make sure you follow all the steps in the previous video, "Setting up Auth0 for API Authentication and Authorization" (ruclips.net/video/PbUcQUQ7K2o/видео.html), since we'll use that set up to integrate FastAPI with Auth0. The code repository for this tutorial is a...
Setting up Auth0 for API authentication and authorization
Просмотров 1,4 тыс.2 месяца назад
Setting up Auth0 for API authentication and authorization. To follow along with this tutorial, you'll need to create an account on auth0.com. Go with the free tier. You won't need paid features for most applications. Login, user registration, managing sessions, issuing access tokens... these are some of the most complex things when building a new web service or an API. For junior developers, it...
Git tutorial for beginners [2024]
Просмотров 702 месяца назад
Git is the most popular and widely used source control management tool. If you're a developer, you probably use git. And if you're not using it, you should! The problem is, in my experience, most developers are not familiar with Git. And this is a big blocker in their work. Becoming a proficient Git user is fundamental for any software developer, so I thought I'd put this short tutorial togethe...
FastAPI severless deployments on AWS
Просмотров 3362 месяца назад
The GitHub repository for this video is here: github.com/abunuwas/short-tutorials/tree/main/fastapi-serverless What's the best way to deploy a FastAPI application? I hear the question a lot. The truth is, there are many different ways to deploy a FastAPI application! When looking for a deployment model, we have to look at 3 parameters: 1) Cost 2) Scalability 3) Easy of deployment The first para...
Create IAM users on AWS with temporary credentials (the right way)
Просмотров 2372 месяца назад
Do you have an AWS account? Are you adding users directly through IAM? If that's your case, watch this video! Traditionally, we'd add users to AWS accounts through the IAM service. We'd log in directly to the account using those profiles, and we'd create AWS access keys for the CLI. This way of managing access to AWS is deprecated and highly insecure. Why? Because those AWS access keys are long...
Create custom middleware with FastAPI
Просмотров 6523 месяца назад
Create custom middleware with FastAPI The code for this tutorial is available on GitHub: github.com/abunuwas/short-tutorials/tree/main/fastapi-middleware What is middleware? Middleware is a layer that pre-processes requests in web servers. Before a request reaches our controllers, i.e. the functions that implement endpoints/URLs in our API, there's a pre-processing stage. In that stage, the fra...
API pagination with FastAPI and SQLAlchemy
Просмотров 2,3 тыс.7 месяцев назад
Pagination is the ability to sequence a collection of items into smaller chunks. For APIs, pagination is incredibly important to safeguard the health of our services. Imagine you have a very large collection of items in your database (millions of records). If you were to return the whole collection to every user in a single fetch, that would put tremendous pressure on your system and cause perf...
Build APIs with Flask (the right way)
Просмотров 11 тыс.8 месяцев назад
Flask is a hugely popular Python web development framework. Tons of websites are built with Flask, and tons of them contain APIs. I've had the privilege to work with many companies building APIs with Flask, I've seen some common errors and anti-patterns, and I've put together a bunch of best practices. This video teaches you how to avoid some common mistakes when building APIs with Flask and ho...
Using the Repository Pattern for better data access encapsulation (in Python)
Просмотров 12 тыс.2 года назад
Using the Repository Pattern for better data access encapsulation (in Python)
Good. Alex Tech Projects
Thank you, this is very helpful. One thing is that I don't see Groups. Is there a feature for Groups? I only see Users, Roles and Permissions but it seems Groups is missing. Also I saw someone saying about Authorization Extension, have you tried that? Does it work? That extension seems to have Groups but I'm not sure if it works.
Thats cool Now it feels like we are a real developers will share resources for what to do next Thanks, keep up ❤
Thank you @allalonetech 🙌!! I have more Docker videos coming up, about SQLAlchemy, Django, GraphQL, and API security 🚀🚀
@@microapis we need FastApi first
Thanks for watching! Don't forget to like and subscribe! What other topics would you like me to over in future videos?
Your presentation is always helpful for me. Thank you so much!
Thank you for your kind comment 🙏! I'm really glad to hear you find the content helpful 🙌!
Hello, I am currently learning FastAPI and Python after working as an Android developer for 6 years. Your channel is very helpful to me, thank you! Could you please cover the topic of deploying on AWS? For example, I have FastAPI and Celery, and I'm finding it difficult to figure out how to deploy them on AWS Lambda. Right now, I am using a regular VPS for hosting, but it is expensive for me, especially when my server is not under load.
Hi sorry for my late reply! I have a tutorial about deploying FastAPI applications to AWS serverless: ruclips.net/video/CTcBLrR32NU/видео.html. Deployment is straightforward and works fairly well for most use cases. The only thing to bear in mind about AWS serverless is that you'll have a max timeout of 30 seconds and the process will exit after that. Only question is how are you using Celery? Is it for long-running background tasks?
@@microapis Thank you for the response! Yes, my background task takes a long time, from a few minutes to an hour. I generate images for my content using OpenAI.
@@vladyslavprykhodko2155 sorry for my late reply! Background tasks won't do well in serverless since the whole process will exist as soon as the API returns or times out. In this setup, I'd recommend using an SQS queue to manage the tasks and a separate Lambda to process those tasks asynchronously. That way, the asynchronous Lambda will have up to 15 minutes to do the job. If what you're doing is generating images, you can upload those images to s3 and you can serve them from there. All of those would be fairly cheap to operate since the Lambdas only run when needed and s3 costs are minimal for a task like this
Thanks for watching! Don't forget to like and subscribe! Did you deploy something after following this tutorial? Share the link with in the comments! What other topics would you like me to cover in future tutorials?
Hey man, thanks for your work. Im spinning up a personal project and i chose Flask for the RESTapi. This video is perfect, thank you. Subbed btw haha
Thank you I'm so glad you found it useful 🙌! Flask is an excellent choice and very powerful when used properly. Good luck with your project and feel free to reach out if you have any questions!
And I'am sorry, can we talk about programming in some messangers? Like Discord I want create project with react and fastapi, but i don't understand how i can do it
with auth0 i don't understand))
Sure! Feel free to ping me on Discord, my handle is @joseharoperalta. I've also created a Discord community for people interested in APIs, feel free to join if you'd like to: discord.gg/fCjxmfJv
Hi! Great videos of theme auth0. Can u create simple project with auith0? I want to see how i can use rbac with endpoints in fastapi. In my mind okta's docs is not userfriendly((
Hi Pavel thank you for your kind words! That's a great idea I'll put together an example of using RBAC in an API!
Thanks for the video, does this work with the standard /callback flow that they talk about? I'm finding with my own implementation, I'll redirect to the auth0 page, user will sign up, and then on the callback I will get a CSRF issue because there is no persistence with the sessions
Great video! Thanks for this, life saver
Thank you for your kind words 🙏! Really glad to hear you found it useful 🙌🙌!
Your lecture is very useful for me. Thank you so much.
Thank you for your comment I'm really glad to hear you found it helpful 🚀!
Thanks for watching! Don't forget to like and subscribe! What other topics would you like me to cover?
the best
Thank you 🚀🚀!!
cant believe this is free....
Trying to help as many people as possible 😄!
appreciate of your working!
Thank you 🙌!
THANK YOU! so much love from Korea ㅜㅜ
Thank you for your kind words 🙏🙏! Will be in Korea 🇰🇷 in September, looking to arrange an API security workshop!
Fantastic video, easy to follow and straightforward process that builds on the each previous step. Looking forward to the next video in the series. Thank you for this video José! Danny
Thank you for your supportive comment Danny 🙌!! Aiming to post the next video later this week 🚀🚀!!
Good video, straight to the point and easy to understand, I will be waiting for more videos about the authorization flow more specifically about the use of refresh tokens and logout.
Thank you for your kind comment and for the suggestions 🙏!! I have those videos in the pipeline for the coming weeks 🙌!
Thanks for watching! Don't forget to like and subscribe! Let me know in the comments what other topics you'd like me to cover in future videos!
Really nice video, and I appreciate your experiential knowledge. This is something that isn't easy to find.
Thank you for your kind words 🙏! This is the exact reason why I created this channel 🚀🚀!
Thanks for your video
Thanks for your support 🙌!
Thank you so much.
Thanks for your support 🙌!
Thanks for watching! Don't forget to like and subscribe! What other topics would you like me to cover in future videos?
Great video an Example with springboot would be helpful
@@ankitpatil5231 Thank you for your support and your suggestion 🙌! I'll look into putting together a tutorial as soon as I can!
Very nice.
Thank you Kelvin 🙌!
so can I implement this IAM Identity Center to limit the number of servers and databases the user can access using permission sets right? my company wants to properly implement strict measures on who and when some devs/data engineers can access some resources.
Thanks for your question! Permission sets are collections of IAM policies. With IAM policies, you can be absolutely granular on how users can access resources. So you can create a policy that gives read-only access to a specific S3 bucket, or a certain path within that bucket. Another policy with specific permissions to an EC2 instance or an RDS database, and so on. Then you can bring those policies together under a permission set. Is that the kind of access control you're looking for?
Thanks for watching! Don't forget to like and subscribe!
I think your performance is outstanding. It will be great help to me. Thank you so much.
Thank you for your kind comment and your support 🙌!
Thanks for your efforts. That'll be helpful for us.
It's my pleasure thank you for your comment 🙌!
Thanks for everything
Thank you for your support 🙌!
Thank you for watching! Don't forget to like and subscribe!
Thanks for watching! Don't forget to like and subscribe!
this explain is a joke? do you mean a program that are PROGRAMED DÃ to answer without a response of the home server from the "page". yes economy data sharing = only download, no upload. _l_ that would not be fake avertising from server providers?
Not sure if you’re commenting on the right video but to clarify this is a video about middleware, specifically about web middleware. Middleware is a layer of software that sits between the receiving end of your server and your controllers and allows you to apply various processing steps on each request
Thank you for watching! What other concepts would you like me to explain?
thank you
Thank you!
Thank you for watching!
Thank you very much, you help me a lot! Congrats for this video.
Thank you for your kind comment @rafaelfurquim745 🙌!
It was really nice to meet you today Jose! I will cheer for you business and your very bright future ahead.
Thank you was a great pleasure meeting you too and I really enjoyed our conversation! Wish you the very best with your projects too and looking forward to seeing them grow. Hope we can see each other again!
Thank you for the help… Chatgpt could not do it actually what you have done. Just a request, you can now update the code as per latest development in FastAPI and update the okta token validation process as well. I have a question, can we use api routes, instead of the objectId when customizing openapi
Thank you for your comment and your suggestions 🚀🚀! I'm currently working on new tutorials about auth/authz with the latest version of FastAPI and I'll show how to do this with dependency injection, integrations with auth0, okta, and more! How are you planning to customise openapi with the API routes?
13 mintes in to video, and I love it already! thanks for sharing proper knowledge,
Thank you for your supportive comment @venil82 🙌!
I still have a question - how to do count with filters?
Thank you for your question! You'd follow the same approach shown in the video, only applying the filters first. Here's an example: @router.get("/jobs", response_model=ListJobs) def list_jobs(contract_type: ContractTypeEnum | None = None,): with session_maker() as session: query = select(Job) if contract_type: query = query.where(Job.contract_type == contract_type.value) count = session.execute( select(func.count()).select_from(query.subquery()) ).scalar_one() This endpoint returns a list of jobs and allows you to filter by contract type. The filter is optional and None by default, so first we check if it's set, and if so, we apply the filter to the query. Once we've filtered the result set, we count the items. Hope this helps, if you have any more questions please let me know!
Thank you so much
You don't come across resources like this very often. Thank you!!!
Thank you for your supportive comment @kingsleyakpan3828!
Such a ROBUST video!!!!!!
Thank you @jasonhall6526 🙌🚀🚀!!
Excellent work sir, thank you for your work. Do you know of anyway to avoid using the CDN for the OPEAPI_SWAGGER_UI_URL and other external urls? Assuming policy does not allow use of CDNs.
Thank you for your question! A workaround would be serving the Swagger UI assets from your own domain. For example, you can download the assets here: cdn.jsdelivr.net/npm/swagger-ui-dist/. You could serve them from Flask, from an S3 bucket if you use AWS, from Cloudflare if you use that, or any other alternative.
'PromoSM'
Ok, this looks good for CRUD. What about beyond CRUD? How do we do joins with this repo pattern? Or a simple subquery? How can we group queries into one instead of hitting the DB several times? I mean at least you're still tightly coupled to SQLAlchemy and you're returning the sqlalchemy instances as is. I've seen some repo patterns where people serialized those into intermediate objects, creating even bigger problems down the line cause of the need to re-fetch that sqlalchemy object in different functions. I feel like everyone goes for repository patterns for simple projects which ends up creating way more problems than it solves. Also, I love the repository registry idea, but am not loving the fact that it's injected into the request object. I think it would we way cleaner as a dependency!😁
Thanks for your comment @RamiAwar! This is a great discussion. First of all 💯 repository isn't suitable in all situations - if it doesn't help it has no place in our codebase. Re joins and subqueries - I think this is query repository shines. You are simply encapsulating the complexity of those queries away from your business and other layers. The example in the video may give the wrong impression that repository is a 1-to-1 between classes and tables, but that's not how it works in practice. Domain models usually pull data from multiple tables and the repository should serve those needs. Ideally, repository doesn't return SQLAlchemy objects, but DTOs or something similar like you say. In the tutorial, the repo's add() method returns an instance of a plain Booking object (github.com/abunuwas/repository-pattern-tutorial/blob/master/data_access/repository.py#L24) and the list() method returns a list of dictionaries (github.com/abunuwas/repository-pattern-tutorial/blob/master/data_access/repository.py#L14). A plain and simple DTO would be a better choice. Personally, I only use the repository pattern when I want to enforce a clear separation between data access and other layers for testing and other purposes, and when queries are growing complex and I want to abstract them away from the business layer. Hope these comments help and thanks again for sharing your thoughts!
Came from your comment on my Post in Reddit, absolute teacher!
Thank you for your kind words and for visiting 🙌!