How domtes/once works
Project Type Identification
This is a serverless application running on AWS that provides one-time file sharing capabilities. The architecture should emphasize:
• Serverless components
• API-driven interactions
• Temporary storage mechanisms
• Security and access control
Main Components
a) Client Layer:
• CLI client (found in /client directory)
• Interaction with the API Gateway
b) API Layer:
• AWS API Gateway as the entry point
• Three main Lambda functions (found in /once directory):
• get-upload-ticket
• download-and-delete
• delete-served-files
c) Storage Layer:
• S3 bucket for file storage
• DynamoDB for metadata/state management
Client Layer (Top)
┌─────────────┐
• CLI Client │
• ┘
API Layer (Middle)
┌─────────────┐
• API Gateway │
• ┘
┌─────┴─────┬─────────────┬─────────────┐
• Upload │ Download │ Delete │
• Ticket │ File │ Files │
• Lambda │ Lambda │ Lambda │
• ┴─────────────┴─────────────┘
Storage Layer (Bottom)
┌─────────────┐ ┌─────────────┐
• S3 Bucket │ │ DynamoDB │
• ┘ └─────────────┘
Key Elements to Highlight
a) Flow Directions:
• One-time download mechanism
b) Security Components:
• IAM roles and permissions
• API Gateway authentication
• Temporary URL generation
c) Data Flow:
Upload Flow
• Client → API Gateway → get-upload-ticket Lambda
• Ticket generation and S3 presigned URL
• Direct file upload to S3
Download Flow
• Client → API Gateway → download-and-delete Lambda
• File retrieval from S3
• Automatic deletion after download
Cleanup Flow
• CloudWatch Events → delete-served-files Lambda
• Cleanup of expired/downloaded files
Additional Notes
• Timing indicators for temporary access
• Resource cleanup mechanisms
• Scaling capabilities