Infrastructure Overview
Understanding the AI SaaS Boilerplate architecture and CDK structure
Infrastructure Overview
The AI SaaS Boilerplate is built on a modern, fully serverless AWS architecture designed for scalability, cost efficiency, and rapid deployment. This section helps you understand what you're deploying and how the infrastructure components work together.
Why Serverless Architecture?
The platform uses a 100% serverless approach for several key advantages:
- Automatic Scaling: Resources scale up and down based on actual usage
- Cost Efficiency: Pay only for what you use, with no idle server costs
- Zero Maintenance: No servers to manage, patch, or monitor
- High Availability: Built-in redundancy across multiple AWS regions
With serverless architecture, costs scale directly with usage. Development and testing often run within AWS free tier limits, while production automatically handles any traffic volume.
Architecture Overview
The platform is organized into four main layers, each handling specific responsibilities:
- Frontend Layer: Next.js web application hosted on AWS Amplify
- API Layer: API Gateway routing requests to Lambda functions
- Service Layer: AI services and core business logic
- Storage Layer: DynamoDB and S3 for data persistence
CDK Code Structure
The infrastructure is deployed using AWS CDK with Python. Here's how the code is organized:
The CDK structure follows a layered dependency pattern: Core → Business → Services → Frontend. Each layer builds upon the previous one, ensuring proper resource dependencies and deployment order.
Technology Stack Summary
Frontend:
- Next.js 14+ with React and JavaScript
- Tailwind CSS for styling
- AWS Amplify for hosting and deployment
Backend:
- AWS Lambda functions (Python)
- API Gateway for HTTP routing
- AWS AppSync for GraphQL APIs
Data & Storage:
- Amazon DynamoDB for structured data
- Amazon S3 for file storage
- AWS Parameter Store for secure configuration
AI & External Services:
- AWS Bedrock (Titan Image Generator)
- AWS Textract for document processing
- OpenAI API integration
- Stripe for payments
Infrastructure Guides
Next Steps
Now that you understand the overall structure, you can:
- Explore the Architecture Layers for detailed component explanations
- Review the Backend section for service implementations
- Check the Frontend section for user interface details