Skip to content

Pranav5255/AWS-AI-Agent-Hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content Marketing Agent

AI-powered content studio that generates, validates, schedules, and analyzes multi-platform marketing content end-to-end.

🗺️ Architecture diagram

For GitHub README (place the image file at the repo root or update the path accordingly):

Content Marketing Agent – Architecture



🚀 Quick pitch

  • Create brand-safe content in seconds
  • Approve with automatic compliance checks
  • Publish everywhere and track results in real time

🎯 Problem

Creating consistent, on-brand content across multiple platforms is slow and error-prone. Teams bounce between tools for ideation, creation, approval, scheduling, and analytics.

💡 Our solution

A single AI-driven content studio that:

  • Generates platform-optimized content using Amazon Bedrock Nova
  • Enforces brand guidelines automatically
  • Surfaces trend-backed ideas
  • Publishes to Twitter, LinkedIn, Facebook, and Instagram
  • Learns from performance to improve future content

✨ Key features

  • AI content generation with brand context and tone control
  • Trend-backed content suggestions from Twitter, Google Trends, and Reddit
  • One-click publish and cross-platform scheduling
  • Real-time analytics and engagement prediction
  • Role-based access with secure key management

🧱 Architecture overview

  • Pattern: Microservices‑oriented monolith, 3‑tier (Presentation, Business Logic, Data)
  • Frontend: React 18 + TypeScript + Vite + Tailwind
  • Backend: FastAPI (Python) + Uvicorn, Async SQLAlchemy, Pydantic
  • Storage: SQLite (dev), PostgreSQL (prod)
  • Cache/queues: Redis
  • Cloud: AWS (Bedrock Nova, S3, RDS, ElastiCache)
  • Deploy: Docker, GitHub Actions, Terraform/CloudFormation

Core services

  • ContentGenerator (Bedrock integration)
  • BrandValidator (Compliance engine)
  • TrendMonitor + UnifiedTrendsAggregator
  • PerformanceLearner (ML insights)
  • Config and Credential managers

External integrations

  • Amazon Bedrock: amazon.nova-pro-v1:0 for content generation
  • Social APIs: Twitter v2, LinkedIn, Facebook Graph, Instagram Basic Display

📦 Tech stack

  • Frontend: React 18, React Router, React Query, Tailwind, Lucide, Axios
  • Backend: FastAPI, Uvicorn, SQLAlchemy 2.0 (async), Alembic, Pydantic v2
  • Infra: Docker, Redis, PostgreSQL, AWS (S3, Bedrock, RDS), GitHub Actions
  • Observability: Sentry, CloudWatch, structured JSON logs

🛠️ Getting started (local)

  1. Prereqs: Node 20+, Python 3.11+, Docker, Redis
  2. Clone and configure
cp .env.example .env               # fill values below
cp frontend/.env.example frontend/.env
  1. Install and run
# backend
python -m venv .venv && source .venv/bin/activate
pip install -r backend/requirements.txt
alembic upgrade head
uvicorn backend.main:app --reload --port 8001

# frontend
cd frontend
npm i
npm run dev -- --port 3000

🔐 Required environment variables

Backend

BEDROCK_REGION=us-east-1
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
JWT_SECRET=change-me
DATABASE_URL=postgresql+asyncpg://user:[pass@localhost:5432](mailto:pass@localhost:5432)/content
REDIS_URL=redis://[localhost:6379](http://localhost:6379)
S3_BUCKET=content-agent-assets-prod
CORS_ORIGINS=http://localhost:3000

Social integrations

TWITTER_API_KEY=...
TWITTER_API_SECRET=...
LINKEDIN_CLIENT_ID=...
LINKEDIN_CLIENT_SECRET=...
FACEBOOK_APP_ID=...
FACEBOOK_APP_SECRET=...
INSTAGRAM_CLIENT_ID=...
INSTAGRAM_CLIENT_SECRET=...

▶️ Run with Docker

docker compose up --build

📚 API at a glance

Base: /api

Content

  • POST /content/generate — AI content generation
  • GET /content/{id} — retrieve
  • PUT /content/{id} — update
  • POST /content/{id}/publish/{platform} — publish
  • POST /content/{id}/schedule — schedule

Suggestions

  • GET /content-suggestions — list
  • POST /content-suggestions/generate-fresh — new AI suggestions
  • POST /content-suggestions/{id}/review — approve or reject
  • POST /content-suggestions/{id}/publish — publish suggestion
  • POST /content-suggestions/{id}/schedule — schedule suggestion

Brands

  • GET /brands — list
  • POST /brands — create
  • GET /brands/status/active — active brand
  • POST /brands/{id}/actions/set-active — set active
  • PUT /brands/{id} — update

Config

  • GET /config/status — system status
  • GET /config/keys — masked keys
  • PUT /config/keys — update keys
  • POST /config/test-connection/{service} — verify integrations
  • POST /config/reload — reload configuration

Auth

  • /auth — JWT-based authentication

🗄️ Data model (high level)

Contents: id, type, title, body, platform, brand_id, status, performance_metrics, timestamps
BrandGuidelines: id, brand_name, voice_tone, key_messages, prohibited_words, traits, demographics, timestamps
Campaigns: id, name, goals, budget_allocation, status, metrics, timestamps
Users: id, email, role, password_hash, flags, timestamps

🔒 Security

  • JWT with access 24h and refresh 30d
  • Encrypted API keys at rest, HTTPS in transit
  • Bcrypt password hashing, input validation, rate limiting
  • CORS, SQLi and XSS protections

📈 Monitoring

  • /health aggregated checks for DB, cache, external APIs, AI
  • Metrics: latency, error rates, AI generation metrics, API quotas
  • Logging: structured JSON, Sentry for errors

✅ What I built during the hackathon

  • End-to-end flow: generate → validate → schedule/publish → track
  • Bedrock Nova integration with prompt templating
  • Brand compliance engine with rules and prohibited lexicon
  • Trend ingestion from Twitter, Google Trends, Reddit with unified ranking
  • Basic analytics with engagement prediction

🗺️ What’s next

  • Team collaboration and review workflows
  • Canva-style editor for rich media
  • Auto A/B testing with multi-armed bandits
  • More platforms and webhooks

📄 License

MIT (placeholder)

👥 Team

  • Pranav

Appendix: Original architecture notes

Expand to view the detailed architecture captured during exploration

Content Marketing Agent - Architecture Overview

🏗️ System Architecture

High-Level Architecture Pattern

Pattern: Microservices-oriented monolith with modular components

Architecture Style: 3-tier architecture (Presentation, Business Logic, Data)

Communication: RESTful APIs with real-time capabilities

Deployment: Containerized with Docker, cloud-ready

[The detailed architecture, routes, models, security, monitoring, deployment notes have been preserved in the source page history.]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published