Project banner

AIMages

AWS Lambda Step Functions DynamoDB S3 CloudFront Route 53 SQS EventBridge CloudWatch Serverless Event-driven architecture

Project Description

AIMages is a project designed as a gallery of AI-generated images, featuring integration with a Discord chatbot for content management. The platform leverages a robust AWS serverless architecture to provide a scalable and efficient solution for displaying, categorizing, and managing image content.

Main Goal

The primary goal of the AIMages project is to establish a highly available and scalable gallery for showcasing images generated by popular AI services. The core challenge involves building a robust content management pipeline using a Discord chatbot for uploads, and leveraging an AWS serverless stack to efficiently process, categorize, and serve static image content globally.

Architecture & Technical Solution

The following diagram illustrates the key components and their interaction within the AIMages project.

Project architecture diagram

Gallery Viewing

Upon accessing the site, the user's request to fetch the gallery categories and subsequent image lists is routed via Amazon API Gateway. These requests are processed by a dedicated AWS Lambda function, which retrieves the necessary metadata, including category information and the associated image and thumbnail URLs, from the Amazon DynamoDB Table.
The site then dynamically displays the image previews, allowing the user to select one to view the full-resolution image.

Image Upload and Processing

The Administrator issues a chat command in Discord to upload an image. Project architecture diagram

The Discord bot calls an Amazon API Gateway endpoint, which is handled by an AWS Lambda function (Step 8 on the diagram). This function processes the Discord bot command, performs initial validation, and triggers the corresponding AWS Step Functions workflow. Project architecture diagram

Project architecture diagram
The workflow orchestrates the entire serverless content processing pipeline. Its logic includes the following steps:
  • Source Download & Storage: Downloading the source image and saving it to an Amazon S3 bucket.
  • Thumbnail Generation: Creating a smaller thumbnail (preview) of the image and storing it in a separate Amazon S3 bucket.
  • Metadata Persistence:Generating and persisting the image metadata (links to the source image and preview, category, quality, etc.) into the Amazon DynamoDB Table.
  • Error Handling:Implementing logic for error handling, including rollback procedures for previously completed steps in case of failure.

Upon completion of the workflow, another dedicated AWS Lambda function (Step 10, Callback) updates the Discord chat. This action notifies the Administrator of the result of the image save operation (success or error). Project architecture diagram

Observability

Core services are instrumented with logging to Amazon CloudWatch Logs , allowing for detailed tracking and troubleshooting. Furthermore, a CloudWatch Dashboard is utilized to monitor key metrics, ensuring control over the operational health and performance of the main components.