Foundational project for the MemeOn.ai marketing site and serverless API.
web/– Vite-powered frontend that displaysHello MemeOn.aiand calls the serverless API.api/– TypeScript Lambda handler plus an Express dev server that serves/apiroutes on port3001, returning a JSON description (fromapi/src/api-description.ts) for any unimplemented path.infra/terraform/– Terraform configuration for S3, CloudFront, ACM, API Gateway, Lambda and Route53..github/workflows/– CI/CD automation for build and deploy (see below).
- Node.js 20+
- npm 10+
- Terraform 1.8+
- AWS CLI v2 with credentials that can manage S3, CloudFront, Lambda, API Gateway, ACM and Route53.
Install dependencies once:
npm install
Then launch both the Vite dev server and the API server locally:
npm run dev
The site runs on http://localhost:5173 and proxies /api requests to http://localhost:3001.
Build the frontend and package the Lambda bundle:
npm run build
The Lambda package is written to api/lambda.zip and is referenced by Terraform.
Terraform is organised under infra/terraform.
- Generate the Lambda bundle:
npm run bundle:api. - Ensure the S3 bucket
memeon.aiexists. You can create it with the AWS CLI:aws s3api create-bucket --bucket memeon.ai --region us-west-2 --create-bucket-configuration LocationConstraint=us-west-2 - Initialise and plan:
cd infra/terraform terraform init terraform plan -var='route53_zone_id=Z123456789ABC' - Apply when ready:
terraform apply -var='route53_zone_id=Z123456789ABC'
The configuration provisions:
- S3 bucket for the static site with CORS set to mirror the Masky project.
- CloudFront distribution with behaviours for the site and
/api/*requests. - CloudFront function to redirect
www.memeon.aitomemeon.ai. - ACM certificate in
us-east-1formemeon.aiandwww.memeon.ai. - API Gateway HTTP endpoint integrated with the
memeon-apiLambda function. - Route53 records for apex and
www.
Certificate validation requires DNS. Terraform creates the CNAME records automatically in the hosted zone you supply.
A GitHub Actions workflow (.github/workflows/deploy.yml) builds the frontend, uploads assets to S3, invalidates the CloudFront cache, and updates the Lambda function code using AWS CLI commands. Static deployment identifiers (including the AWS region) live in config/deploy.json. Configure the following repository secrets before running the workflow:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGION(optional ifawsRegionis present inconfig/deploy.json)
Trigger the workflow with pushes to main or manually from the Actions tab.