Why this project
A real application makes service boundaries visible. Nginx serves the interface, PHP validates requests, RDS stores captions and object keys, and private S3 stores video bytes. The browser receives a short-lived media URL rather than AWS credentials. This is a single-admin teaching application, not a production social network.
Request flow
- A visitor opens the feed over HTTPS and requests
api.php?action=feed. - PHP reads the latest post metadata from MySQL using PDO.
- The AWS SDK creates a short-lived signed GET URL for each private S3 object.
- The browser displays vertical videos and captions. It downloads media directly from S3.
- An administrator signs in, uploads a video and caption, or updates an existing caption.
- PHP validates the upload, writes the object using the EC2 role and inserts its key into MySQL.
Component contract
| Component | Stores/does | Does not store/do |
|---|---|---|
| EC2 + Nginx | Static UI, reverse execution to FPM | Permanent video library |
| PHP-FPM | Auth, CSRF, validation, SDK/PDO calls | Browser-visible AWS keys |
| RDS MySQL | Post ID, caption, key, timestamps | Video binary files |
| Private S3 | MP4/WebM objects under reels/ | SQL rows or application sessions |
| EC2 IAM role | Scoped object permissions | SQL username/password |
Resource plan
Use one lab Region, a VPC, a public web subnet and private DB subnets across two AZs. A simple teaching deployment exposes the web instance via HTTPS; an advanced deployment can place it behind an ALB. The provided Nginx configuration assumes direct TLS termination on the instance after certificate setup. Keep S3 Block Public Access enabled. Use web-sg for 80/443 and restricted management, and db-sg with 3306 only from web-sg. Choose small resources after checking current cost. Record a teardown owner/time before launch.
Included implementation
The package's project/ folder contains PHP API, feed/admin pages, schema, example private configuration, IAM policy and Nginx configuration. Download the project from the course Resources area. The application supports upload, paginated feed and caption update; it deliberately has no public registration, comments, recommendations or transcoding pipeline.
Acceptance criteria
A valid admin can publish a short video; visitors can play it; caption updates persist; unsigned direct S3 access fails; unauthenticated writes fail; secrets cannot be fetched from the document root. The later project chapters provide the runbook and test cases.
Ravindra’s Tip
Video को database में भरने की जरूरत नहीं है। Video S3 में रखो और उसका object key तथा caption MySQL में—हर service को उसका सही काम दो।
Official reference
Interview and revision check
Why store an object key instead of a permanent signed URL in MySQL?
The key identifies durable media. Signed URLs expire and should be generated when authorized access is needed.
Ravindra Bagale · Cloud & DevOps Academy · Handbook and project downloads