Proposal

APT Magic

A Serverless AI Platform for Personalized Image Generation and Social Interaction

1. Executive Summary

APT Magic is a serverless AI-powered web application designed to enable users to generate, personalize, and share artistic content such as AI-generated images. The platform integrates with AI foundation models via Amazon Bedrock and provides a seamless web experience using Next.js (SSR) hosted on AWS Amplify.

The MVP version focuses on real-time image generation and sharing, while the Future Design aims to scale with Bedrock agentCore/SageMaker Inference, SQS/SNS, Secret Manager & CloudTrail and AWS MLOps pipelines for advanced model orchestration and automation.

APT Magic is currently developed as a modern, cost-efficient, and secure AWS-native architecture for small to medium user bases, with planned expansion into enterprise-grade AI orchestration.


2. Problem Statement

What’s the Problem?

Most AI image generation platforms are costly, rely on opaque third-party APIs, and offer limited personalization.
Developers and creators often face high latency, lack of transparent model management, and limited control over user data security.

The Solution

APT Magic leverages AWS serverless architecture to deliver:

  • Real-time AI image generation through Amazon Bedrock Stability AI models.
  • Secure user authentication and content management using Amazon Cognito and DynamoDB.
  • Scalable API handling via AWS Lambda and API Gateway.
  • Low-latency global delivery with CloudFront CDN and WAF protection.

Future upgrades will include SQS/SNS decoupling, Bedrock AgentCore/SageMaker Inference pipelines, and cost-efficient CI/CD via CloudFormation. transforming APT Magic into a fully automated MLOps platform.


3. Solution Architecture

MVP Architecture

The MVP is a fully serverless architecture, focusing on scalability, maintainability, and cost-effectiveness.

Core AWS Services:

  • Route53 + CloudFront + WAF — Secure global access and caching.
  • Amplify (Next.js SSR) — Hosts the frontend and server-side rendering layer.
  • API Gateway + Lambda Functions — Manage backend logic (image processing, subscription, post APIs).
  • Amazon Cognito — User authentication and access control.
  • Amazon S3 + DynamoDB — Data persistence and image storage.
  • Amazon Bedrock — Integrates foundation model (Stability AI) for image generation.
  • CloudWatch — Logging, and monitoring.

Security

  • WAF + IAM policies for traffic filtering and role-based access control.

APT Magic MVP Architecture


Future Design (Enhanced Architecture)

In the next phase, APT Magic will evolve into an AI orchestration platform, introducing new layers for automation, resilience, and model lifecycle management.

New Services to be Added:

  • Amazon SQS — For reliable message queuing between async Lambda tasks.

  • Amazon SNS — For real-time event notifications to users or administrators.

  • Amazon ElastiCache (Redis) — For rate limiting and caching of frequent inference requests.

  • Amazon Bedrock AgentCore — For hosting custom fine-tuned models and managing model endpoints.

  • CI/CD

    • CloudFormation for infrastructure deployment and automation.

APT Magic Future Architecture


4. Technical Implementation

Implementation Phases

Phase 1 – MVP Deployment (Completed / Current)

  • Implement Amplify (Next.js SSR) + API Gateway + Lambda.
  • Integrate Bedrock Stability AI API.
  • Deploy CI/CD via Gitlab CI/CD.
  • Enable user authentication (Cognito) and storage (S3 + DynamoDB).
  • Log and Monitor via Cloudwatch

Phase 2 – Future Design Expansion

  • Introduce SQS/SNS to decouple.
  • Add ElastiCache for request throttling and caching.
  • Integrate Bedrock Agent to enhance AI Pipelines
  • Connect GitLab Runner with CodeBuild for unified CI/CD.

5. Timeline & Milestones

PhaseDescriptionEstimated DurationDeployment Milestone
Month 1: Setup & Core APIDeploy infrastructure (IaC), Cognito, API Gateway, DynamoDB, and foundational Lambda functions.4 WeeksCore Backend operational, Auth/User Management completed.
Month 2: AI IntegrationIntegrate Claude Haiku 3 LLM on Amazon Bedrock (Stability AI), Replicate API, complete Image Processing functions.4 WeeksSuccessful end-to-end AI image processing demo.
Month 3: Front-end & CI/CDDevelop UI/UX (Amplify/Next.js), finalize CI/CD pipelines, and configure Monitoring/Security (CloudWatch/WAF).4 WeeksFull platform ready for user testing.
Month 4: Optimization & Go-LivePerform performance testing (Stress Test), cost optimization, and Production deployment.4 WeeksGo-Live (Official product launch).

6. Cost Estimate (AWS Pricing Estimate)

Total Cost

  • Monthly: $9.80
  • Upfront: $0.00
  • 12 Months: $117.60

Service Overview

ServiceRegionMonthly CostUpfront12-Month CostNotes
Amazon Route 53Asia Pacific (Singapore)$0.50$0.00$6.001 Hosted Zone, 1 domain, 1 linked VPC
Amazon CloudFrontAsia Pacific (Singapore)$0.00$0.00$0.00No specific configuration
AWS WAFAsia Pacific (Singapore)$6.00$0.00$72.001 Web ACL; 1 rule per ACL
AWS AmplifyAsia Pacific (Singapore)$0.00$0.00$0.00Build instance: Standard (8GB/4vCPU); request duration 500ms
AWS CloudFormationAsia Pacific (Singapore)$0.00$0.00$0.00No extensions; no operations
Amazon API GatewayAsia Pacific (Singapore)$0.13$0.00$1.5910k requests/month; WebSocket message 1KB; request size 30KB
AWS LambdaAsia Pacific (Singapore)$1.67$0.00$20.041 million invokes; x86; 512MB ephemeral storage
Amazon CloudWatchAsia Pacific (Singapore)$0.85$0.00$10.221 metric; 0.5GB logs in; 0.5GB logs to S3
S3 StandardAsia Pacific (Singapore)$0.23$0.00$2.7610GB storage; 20k PUT; 40k GET
DynamoDB On-DemandAsia Pacific (Singapore)$0.42$0.00$5.041GB storage; 1KB item; on-demand mode
Total (Estimate)$9.80$0.00$117.60Based on AWS Pricing Calculator

Metadata

  • Currency: USD
  • Locale: en_US
  • Created On: 12/9/2025
  • Share URL: AWS Calculator Link
  • Legal Disclaimer: AWS Pricing Calculator provides estimates only; actual costs may vary based on usage.

AI Model Pricing

ModelResolution / Token UsageQualityPrice per Request (USD)Notes
Titan Image Generator v2< 512×512Standard0.008Fixed price per 1 image
Titan Image Generator v2< 512×512Premium0.01Fixed price per 1 image
Titan Image Generator v2> 1024×1024Standard0.01Fixed price per 1 image
Titan Image Generator v2> 1024×1024Premium0.012Fixed price per 1 image
Stable Diffusion 3.5 LargeAnyN/A0.08Fixed price per 1 image
Claude (text + image)40 input tokens + 1 imageN/A0.00195Price for 1 request including text and 1 image 1024×1024

Additional Options

ModeAugmentationPrice (USD)
text→imgno augment0.08
text→imgwith augment0.08195
img→imgno augment0.012
img→imgwith augment0.094

7. Risk Assessment

RiskImpactProbabilityMitigation
AI model inference latencyMediumHighUse ElastiCache + SQS/SNS for async handling
Cost increase from model callsHighMediumBedrock usage control, SageMaker autoscaling
CI/CD misconfigurationsMediumLowCloudFormation rollback policies
Security vulnerabilitiesHighMediumWAF, GuardDuty, PrivateLink, IAM least privilege
Third-party API dependencyMediumMediumBedrock fallback to S3-stored inference results

8. Expected Outcomes

Technical Outcomes:

  • Complete serverless AI image generation workflow with secure CI/CD.
  • Modular orchestration enabling rapid MLOps integration.
  • Improved latency and reliability via caching and async workflows.

Long-Term Value:

  • A foundation for AI as a Service (AIaaS) platform expansion.
  • Ready-to-scale MLOps framework with automated retraining.
  • Reusable cloud infrastructure for future AI products.