How gideonag/photo-blog-app-backend works
Project type and purpose
• This is a Java-based, AWS Serverless backend for a photo-blog application.
• It exposes REST APIs (via API Gateway) that handle user auth, photo CRUD, processing, notifications, and disaster-recovery.
• Infrastructure is defined in a SAM template (template.yaml + samconfig.toml) and deployed via GitHub Actions (backend-deploy.yml).
Main components
a. Client layer
• Web or mobile client that calls REST endpoints
b. API Gateway
• Entry point routing HTTP requests to Lambda functions
c. AWS Lambda functions (grouped by domain)
• Auth domain: AuthHandler, CognitoService
• Photo domain: PhotoUploadHandler, PhotoQueryHandler, PhotoDeleteHandler, PhotoShareHandler, RecycleBinHandler
• Processing domain: ImageProcessingHandler, ImageProcessor, ProcessingRetryHandler
• Notifications domain: LoginNotificationHandler, ProcessingNotificationHandler, SystemAlertHandler, EmailService
• Disaster-recovery domain: BackupHandler, CognitoBackupHandler, RestoreHandler
d. AWS Services
• Amazon Cognito (user-pools & identity-pools) for authentication
• Amazon DynamoDB for metadata (tables for photos, users, statuses)
• Amazon S3 for storing photo files
• Amazon SNS & SES (via SNSUtil, SESUtil) for messaging and email alerts
e. Infrastructure / CI-CD
• AWS SAM (CloudFormation)
• GitHub Actions for build & deploy
Relationships and data-flow
• Client → API Gateway → specific Lambda
• Lambdas call utility classes (DynamoDBUtil, S3Util, SNSUtil, SESUtil)
• Write/read metadata in DynamoDB; read/write photo blobs in S3
• Processing Lambda triggered by S3 events (or invoked by API) and posts status updates
• Notification Lambdas subscribe to SNS topics to send emails via SES
• Backup/Restore Lambdas use DynamoDB and Cognito APIs for disaster-recovery
Architectural patterns & design principles
• Serverless microservices: each handler is a single-responsibility function
• Event-driven integrations: S3 events → processing, SNS topics → notifications
• Infrastructure-as-Code: SAM template defines all resources
• Domain grouping: handlers and models reflect clear Bounded Contexts