How asucicrepo/st-louis-zoo works
Main Components
a. Backend (backendV2)
• AWS CDK Infrastructure: Located in the backend directory with files for S3 uploads, Lambda functions, ECS containers, and infrastructure orchestration.
• Lambda Functions: For various tasks such as initializing uploads, generating presigned URLs, finalizing uploads, metadata extraction (using Bedrock/Claude 3.5), OpenSearch integration, and email notifications.
• ECS with Fargate: Handles video processing tasks—video clipping, thumbnail generation, and processing pipelines.
• S3 Storage: Serves as the repository for uploaded videos, intermediate clips, and thumbnails.
• Step Functions: Orchestrates video processing flows once a video enters the system.
• OpenSearch: For storing and serving advanced search metadata.
• Glacier Archive: Implements lifecycle rules for long-term storage, moving videos after 2 days.
b. FrontendV2 (Admin Frontend)
• React Application for Admins: Allows video uploads, metadata tagging (both required and optional), and interacts with Lambda-backed API endpoints.
• AWS Cognito: For Admin Authentication and authorization.
c. Frontend-user (User Flow Frontend)
• React Application for End Users: Provides search and filtering for video content, displays previews and metadata, and includes video access request forms.
• Email Service: Used to notify admins when a user requests full-access to a video.
Relationships and Interactions
• The Admin UI (from frontendV2) communicates via API Gateway endpoints to the backend. API calls trigger Lambda functions which initialize uploads, return presigned URLs from S3, and finalize multipart uploads.
• Once a video upload is complete, the S3 bucket triggers a downstream processing pipeline using AWS Step Functions. This workflow coordinates between ECS tasks (for processing video clips and thumbnails) and additional Lambda functions (for AI-based metadata extraction and OpenSearch updates).
• The processed metadata is indexed in OpenSearch to support the advanced search functionality available in the user-facing frontend.
• The User Frontend (from frontend-user) consumes data (search results, video clips, metadata) through APIs. It also provides functionality for submitting video access requests, which in turn triggers email notifications to the administrators.
• Authentication for Admin access is handled by AWS Cognito, while the AWS CDK orchestrates the deployment and configuration of all infrastructure components.
Architectural Patterns and Design Principles
• Microservices and Function-as-a-Service (FaaS): Multiple Lambda functions handling discrete tasks.
• API Gateway Pattern: To manage API calls between the UI and backend services.
• Event-Driven Architecture: S3 triggers and Step Functions to automatically process uploads.
• Separation of Concerns: Distinct projects for Admin and User functionalities, enabling maintenance and scalability.
• Cloud-Native Infrastructure-as-Code (AWS CDK): Organizes infrastructure components and deployment pipelines.
Relevant Technologies & Frameworks
• AWS Services: Lambda, ECS/Fargate, S3, Step Functions, OpenSearch, Glacier Deep Archive, Cognito, and SES (for email).
• Infrastructure-as-Code: AWS CDK (backendV2)
• Frontend: React for both the admin (frontendV2) and user (frontend-user) interfaces.
• Other Tools: Docker (for ECS containers) and AWS CLI/CDK tools for deployment.