Rede is an automated content generation service that runs on a schedule. It currently sends AI generated richly formatted emails, by gathering data from the web based on a users desired content type and interest, sending that to an LLM for generating the content with useful context, and sending the resulting HTML in an email to the user.
It's configured and deployed via Terraform + Serverless and runs on AWS. The front end is React with Vite.
The core Infrastructure resources such as DNS zones, buckets, databases, queues, etc. are deployed via Terraform to AWS, MongoDB Atlas, and CloudFlare.
The backend is comprised of various Javascript Serverless functions behind an AWS API Gateway. The front end is hosted on S3 and fronted by a CloudFront distribution. Emails will be sent with SendGrid
To get started you will need to make sure you have the following Command line tools installed
Prerequisites:
- An available domain or subdomain in Cloudflare
- AWS Cli https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install-
Terraform
-
Terraform Cloud account
-
Serverless
npm install -g serverless
-
AWS Access Keys: AWS Console > User Profile > Security Credentials > Access Keys > Click
Create Access KeyIdeally you'd create a group in IAM, define the least privaledged permissions for the group, add user to the group, then get access tokens for said user
- run
aws configure
See infrastructure/variables.tf for all required variables
Additionally, you'll need to set AWS_SECRET_KEY, and AWS_ACCESS_KEY_ID
cd infrastructureterraform initterraform planterraform apply
CERT VALIDATION WILL SAY STILL CREATING UNTIL YOU COMPLETE STEP 3 YOU MUST POINT YOUR DNS NS SERVERS TO AWS IN ORDER FOR CERT TO COMPLETE THIS CAN TAKE MANY MINUTES
Once DNS name server records have updated and pointed to the AWS NS servers, the cert validation in terraform should complete, and proceed with deploying the rest of the infrastructure.
cd ../services/authnpm install- run
sls deploy
After the entire service is deployed, you can deploy just one function you're working on much more quickly you can run sls deploy -f login to deploy any single function by its name
- run
cd ../web-ui - run
npm install - run
npm run deploy
npm start
cd services/notesand runsls removecd infrastructureand runterraform destroy