Content-generator for Social Media

(Next.js / AWS Lambda / Dynamo / Kinde)

The goal was to build a multitenant app where enterprise users get isolated subdomains with dedicated data storage, and regular users join a shared SaaS environment via self-sign-up. The app offers a streamlined UX for generating and publishing high-quality social media content using generative AI and make.com workflows, based on user inputs entered manually or via speech-to-text. I implemented and hosted the app as a serverless solution on the client's AWS account, incorporating a One-Click deployment approach for ease of setup. An Admin page allows them to manage new and onboarded tenants.

User Entering Ideas and Generating Content

Users can enter their ideas (stories) manually or via the speech-to-text capability on the website. The application integrates with Make.com, which:

  • Generates AI-powered content tailored for different social media platforms.
  • Allows per-tenant and per-user workflow customization, enabling different tenants to define their unique publishing workflows.
  • Provides flexibility to charge tenants based on their workflow usage and underlying service costs. After publishing, Make.com sends a webhook request back to the app, which updates the post status in the user dashboard.

Architectural Decisions

  • Integration with Make.com: Enables workflow customization and monetization, allowing tenants to configure workflows for their specific needs while offloading publishing complexity to a third-party system.
  • DynamoDB with Single-Table Design: Each tenant has its own isolated DynamoDB instance to ensure strict data separation while using a single-table design for scalable and efficient queries.


Creating and publishing posts to social media platforms

Uploading Images

Users can upload images securely through signed POST uploads to Amazon S3 or provide URLs to fetch images from the web. Images are distributed via CloudFront CDN for fast and scalable delivery. Image metadata and associations (e.g., which story it belongs to) are stored in DynamoDB under the tenant's isolated instance for easy retrieval.

Architectural Decision:

  • Separation of Storage and Distribution: Using S3 for storage and CloudFront for delivery ensures scalability, high performance, and cost-effectiveness.


Using signed-post to securely upload images to S3 bucket

Scheduling Posts

Users can schedule posts by specifying a date and time for publishing. AWS EventBridge manages scheduled events, triggering a Lambda function at the exact time. The Lambda function pushes the scheduled post to an SQS queue for asynchronous processing, ensuring reliability and scalability. The SQS message is then processed by another Lambda function, which sends the post data to Make.com for publishing.

Architectural Decisions:

Event-Driven Scheduling with EventBridge and SQS:

  • EventBridge manages time-based triggers, while SQS ensures decoupling and reliability for scheduled task execution.

Serverless Scalability: Leveraging Lambda and SQS allows the system to handle variable workloads without overprovisioning resources.


Using EventBridge + SQS and Lambda to schedule post publishing

Multi-Tenancy and Tenant Management

The app supports multi-tenancy, enabling enterprise users to have:

  • Dedicated DynamoDB instances for data isolation, where each tenant's data is stored using a single-table design for efficiency and scalability.
  • Custom domains and branding (e.g., .client-domain.com) to provide personalization and isolation.

Kinde handles authentication and authorization, enabling:

  • Customizable auth UI per tenant for branding.
  • Support for tenant-specific user management and roles.

Admins can:

  • Create and manage tenants.
  • Configure branding, user permissions, and isolated resources.

Architectural Decisions:

  • Per-Tenant DynamoDB Instances: Ensures strong data isolation and tenant-specific performance tuning, while single-table design simplifies data access patterns.
  • Customizable Authentication with Kinde: Allows each tenant to have a unique and branded login experience, enhancing the multi-tenant offering.


Admin interface triggers automated deployment of infrastructure for new tenants

Key Architectural Highlights Across the System

Serverless and Event-Driven Architecture:

  • Using Lambda, EventBridge, and SQS minimizes operational complexity and ensures scalability.

Customizable and Monetizable Workflows with Make.com:

  • Allows per-tenant and per-user workflow configuration, supporting custom publishing needs and enabling billing based on usage.

Isolated Multi-Tenancy with Per-Tenant DynamoDB Instances:

  • Guarantees data security and isolation for enterprise clients while maintaining efficient access patterns using single-table design.

Customizable Authentication with Kinde:

  • Supports tenant-specific branding for login pages, enhancing user experience and aligning with tenant branding requirements.

API Gateway for Scalability and Security:

  • Enables controlled access to the backend with features like throttling, logging, and JWT-based authentication.

ExpressAPI for Business Logic:

  • Simplifies the implementation of RESTful operations and supports rapid iteration of application features.

One-Click Deployment:

  • GitHub Actions powers the CI/CD pipeline, allowing fully automated, one-click deployments.
  • Infrastructure as Code (IaC): AWS CDK is used to deploy backend infrastructure, while AWS Amplify hosts the frontend.
  • Deployments span multiple AWS environments, including Development, QA, and Production, with seamless scaling.

Next Project: Patreon-tiered content-gating