Let's build a simple yet powerful video streaming app similar to YouTube using Amazon Web Services (AWS), FastAPI, Docker, Redis, PostgreSQL, Flutter and Bloc! This tutorial is designed for beginners in AWS, Docker or PostgreSQL. Since our main focus of the tutorial will be backend development, if you're more comfortable with a different frontend framework—or just want to follow along purely for backend knowledge—feel free to use your preferred tools.
📌 Discord Server -
https://discord.gg/Q8Rx8YWFVF
GitHub Repository -
https://github.com/RivaanRanawat/video_streaming_app_tutorial
All copy paste material mentioned in the tutorial (like access policies, CORS for buckets, SQS Queue policies and more) -
https://gist.github.com/RivaanRanawat/67a8cfe6674d3b73e5f2fc5bfd06b5fd
Timestamps:
(00:00:00) Introduction
(00:01:41) Getting started and Docker intro
(00:05:00) What is Docker? And installation
(00:07:42) Core Docker concepts
(00:11:58) Dockerfile for Backend
(00:26:44) Running Images and Building Containers
(00:32:47) Why PostgreSQL not AWS Aurora DB?
(00:34:14) Docker Compose (Postgres Setup)
(00:39:50) Docker volumes
(00:45:44) Simple valid FastAPI app
(00:49:29) Docker Errors
(00:51:31) Docker Volumes for reloading FastAPI
(00:55:06) Postgres Error
(00:58:11) Setting up AWS and Configuring IAM
(01:12:16) Intro to AWS Cognito and setting it up
(01:22:54) Signing Up the user using Cognito and dotenv errors
(01:33:48) Secret Hash in Cognito - Deep dive into HMAC-SHA256
(01:47:02) Coding up Secret Hash
(01:49:40) Recap of HMAC-SHA256 Algorithm
(01:52:03) Setting up SQLAlchemy & Storing user data in PostgreSQL
(02:11:50) Logging in the user using Cognito
(02:14:17) Verifying user using Cognito
(02:17:34) Auth state persistence (using Cookies + Access Token + Refresh Token)
(02:32:14) Get user data (Part of auth state persistence)
(02:41:59) Video Uploading & Processing Architecture
(03:03:14) Recap of the architecture
(03:05:09) Video retrieving/displaying architecture and Microservices
(03:12:31) Creating S3 Buckets, SQS, Bucket Policies & Sending Notifications to SQS
(03:29:54) Consumer Microservice - Polling SQS For Notifications/Messages
(03:44:21) Transcoder & Segmentation Service - FFMPEG, DASH vs HLS, Adaptive Birate Streaming using HLS
(04:32:25) Pushing Image to Elastic Container Registry (ECR)
(04:38:16) Configuring ECS & Telling Consumer to Run ECS Tasks
(04:48:53) Testing the transcoding & consumer service (spoiler alert: fixing bugs after that)
(04:58:24) Adaptive Bitrate streaming(ABR) with MPEG-DASH
(05:07:35) AWS Cloudfront CDN
(05:15:46) Creating Video Table, API - Getting Presigned URL For Uploading Videos & Thumbnails
(05:35:48) API - Upload Video Metadata
(05:46:13) API - Getting all videos
(05:51:45) (Optional) API - Getting 1 video’s data, Redis & Caching
(06:08:22) Updating the Processing Status, Ngrok
(06:24:01) Recap of Backend
(06:29:16) Frontend Flutter Setup
(06:32:53) Signup Page UI
(06:45:25) Login Page UI
(06:49:58) Forms & Validation
(06:56:03) Frontend’s Auth Service - Connecting to Signup Backend Routes
(07:07:09) Confirm Signup Page UI & Connecting its backend route to frontend
(07:13:29) Connecting to backend login route
(07:19:29) Adding state management (Auth Cubit)
(07:34:17) Auth state persistence - Local Storage: Flutter Secure Storage, Refresh Token
(08:07:45) Recap: Auth state persistence
(08:11:22) Upload Page UI
(08:27:25) Picking Images & Videos in Flutter
(08:39:21) Flutter Frontend - Uploading thumbnail (image), video using Presigned URLs, metadata as well, Solving bugs
(09:22:58) Thumbnail bug
(09:26:16) Fetching, Displaying all videos on Home Page. Also debugging
(09:55:25) Flutter Video Player for DASH
(10:14:19) Cloudfront Distribution for Thumbnails
(10:16:08) Fetching video based on id is useless for Flutter Mobile
(10:18:15) Conclusion
Connect With Me Here:
GitHub:
https://github.com/rivaanranawat
Linkedin:
https://www.linkedin.com/in/rivaan-ranawat
Medium:
https://namanrivaan.medium.com
X:
https://x.com/RanawatRivaan
Instagram:
https://instagram.com/optimalcoding
Тэги:
#amazon_web_services #aws #flutter #aws_tutorial_for_beginners #YouTube_clone_tutorial #video_streaming_app_tutorial #aws_course_for_beginners #redis_tutorial #docker_tutorial #postgresql_tutorial #bloc_tutorial #flutter_tutorial_for_beginners