Fauxios is an automated content generation and social media platform. It leverages AI and serverless technologies to create news articles and videos, and post them to social media channels.
The project is built on a serverless architecture using SST to manage AWS resources. The frontend is an Astro site.
The core of the article generation is an AWS Step Function (FauxiosOrchestrator) that automates the following steps:
- Generate Article Content: A Lambda function (
generateArticleContent) uses generative AI to write an article. - Generate Article Image: A Lambda function (
generateArticleImage) creates an image for the article. - Assemble Post: A Lambda function (
assemblePost) combines the article content and image into a final post format and stores it in DynamoDB. - Post to Socials: A Lambda function (
postToSocials) posts the generated article to social media platforms like Twitter and Facebook.
This workflow is triggered by a daily cron job.
Video generation is handled by a separate AWS Step Function (VideoOrchestrator) and Remotion for rendering.
- Parallel Asset Generation:
- Voiceover: An AWS Polly-powered Lambda (
generateVoiceover) creates a voiceover from a headline. - Avatar: A RunwayML-powered Lambda (
generateAvatar) creates a talking avatar video from a quote.
- Voiceover: An AWS Polly-powered Lambda (
- Final Video Rendering:
- A final Lambda function (
renderVideo) invokes a Remotion Lambda function to composite the generated assets (voiceover, animated cartoon, avatar) into a single video.
- A final Lambda function (
For more details, see the Video Generation Architecture document.
-
Prerequisites:
- Node.js (v18 or later)
- An AWS account with credentials configured for SST.
- SST CLI installed globally.
-
Clone the repository:
git clone <repository-url> cd fauxios-project
-
Install dependencies:
npm install
-
Configure Secrets: This project uses SST's
sst.Secretto manage API keys and other secrets for services like Twitter, Facebook, Gemini, and RunwayML. You will need to set these secrets in your SST environment.Example:
npx sst secret set TwitterApiKey "your_api_key" --stage dev
Refer to
sst.config.tsfor the full list of secrets required.
To deploy the entire stack (including the Astro site, APIs, and all serverless functions) to your AWS account, run:
sst deploy --stage devTo run the Astro frontend locally for development:
sst devThis will start a local development server at http://localhost:4321.
To manually trigger the article generation workflow, you can use the SST shell to execute scripts in the context of your deployed backend.
sst shell --stage dev -- node packages/scripts/invoke-generator.tsThis command runs the invoke-generator.ts script, which starts an execution of the FauxiosOrchestrator Step Function.
This project includes scripts for data maintenance, diagnostics, and seeding. These scripts should be run within the SST shell to provide them with the necessary AWS context.
To run a script, use the following command structure, replacing <stage-name> with the target stage (e.g., dev, develop) and <script-name> with the name of the script you want to run.
sst shell --stage <stage-name> -- npm run <script-name>invoke-generator: Manually triggers the article generation workflow.clear-articles-by-date: Removes articles from the database based on their creation date.normalize-sources: Normalizes the source text files used for content generation.reindex-articles: Updates each article to ensure it is included in all GSIs. This is essential after creating a new GSI or if you suspect an index is out of sync.scan-topics: A diagnostic script to inspect thetopicattribute of all articles in the database.seed-authors: Seeds the database with an initial set of authors.seed-pinecone: Seeds the Pinecone index with vectors from the source documents.setup-index: Sets up the initial Pinecone index.
- Frontend: Astro
- Backend & IaC: SST
- Database: Amazon DynamoDB
- Storage: Amazon S3
- Orchestration: AWS Step Functions
- Video Rendering: Remotion
- Generative AI:
- Styling: Tailwind CSS