A serverless video streaming application for live and time-travel playback from a Raspberry Pi camera, powered by AWS Kinesis Video Streams.
Deployed at: baga.jpearnest.com
Live stream with time travel controls
- Live Streaming: Watch real-time video from a Raspberry Pi camera
- Time-Travel Playback: Seek to any point in the last 24 hours
- Google SSO: Secure authentication via AWS Cognito
- Serverless Architecture: Fully managed AWS infrastructure
See ARCHITECTURE.md for detailed diagrams and component descriptions.
flowchart LR
Pi[Raspberry Pi] --> KVS[Kinesis Video Streams]
KVS --> Lambda
Lambda --> App[React App]
App --> CF[CloudFront]
| Component | Technology |
|---|---|
| Frontend | React 19, Vite, TypeScript, Tailwind CSS |
| Video Player | hls.js |
| Authentication | AWS Cognito, Google OAuth |
| Backend | AWS Lambda (Python 3.11), API Gateway |
| Video Streaming | AWS Kinesis Video Streams |
| Hosting | AWS S3, CloudFront |
| Infrastructure | Terraform, Terragrunt |
bagacam/
├── app/ # React frontend (Vite)
│ ├── components/ # UI components (VideoPlayer, Dashboard, etc.)
│ ├── services/ # API clients
│ ├── config/ # Amplify configuration
│ └── .env.example # Environment template
├── backend/ # Lambda functions (Python)
│ └── src/handlers/ # Lambda handlers
├── infrastructure/ # Terraform/Terragrunt IaC
│ ├── modules/ # Reusable Terraform modules
│ └── environments/ # Environment-specific config
└── scripts/ # Development utilities
- Node.js 20+
- AWS CLI configured with appropriate permissions
- (Optional) Raspberry Pi streaming to Kinesis Video Streams
-
Install dependencies:
cd app && npm install cd ../scripts && npm install
-
Configure environment:
cp app/.env.example app/.env.local # Edit app/.env.local with your configuration -
Start development server:
# Terminal 1: Start KVS proxy (optional, for local video testing) cd scripts && npm run proxy # Terminal 2: Start frontend cd app && npm run dev
cd app
npm run buildInfrastructure is deployed via AWS CodePipeline triggered by GitHub pushes.
Deployment Order:
- KMS (encryption keys)
- SSM (configuration)
- Cognito (authentication)
- ACM (SSL certificates)
- Lambda (backend)
- API Gateway
- Frontend Hosting (S3 + CloudFront + CodePipeline)
See infrastructure/ for Terragrunt configurations.
MIT License - see LICENSE for details.
