How uroojfatima-052/flyrank-capstone-social-studio works
Social Media Studio turns submitted blog content into reviewed, platform-specific campaign variants, schedules approved variants, and publishes them with attempt tracking and history. The principal flow runs from HTTP endpoints through domain services to persistent records; a background scheduler dispatches due slots to the publishing service and configured platform adapters. AI generation has a template fallback, and validation enforces platform and brand constraints. Some service wiring is described in the README but not sampled, so uncertain internal calls are omitted.
Main entry points: main.py FastAPI App · database.py Application Database · ai_generator.py AI Generator · publisher.py Publish Service
Components 28
HTTP API
- FastAPI App
app/main.py - Posts API
app/routers/posts.py - Campaign API
app/routers/campaigns.py - Variants API
app/routers/variants.py - Schedule API
app/routers/schedule.py - History API
app/routers/history.py
Content And Review
- Content Fetcher
app/services/fetcher.py - Post Service
app/services/posts.py - Campaign Service
app/services/campaigns.py - Variant Service
app/services/variants.py - Variant Generator
app/services/generator.py - AI Generator
app/services/ai_generator.py - Content Validator
app/services/validator.py - Platform Profiles
app/profiles.py
Scheduling And Publishing
- Schedule Service
app/services/schedule.py - Scheduler Runner
app/scheduler/runner.py - Publish Worker
app/scheduler/worker.py - Publish Service
app/services/publisher.py - History Service
app/services/history.py
External Integrations
- Adapter Registry
app/adapters/registry.py - Publisher Interface
app/adapters/base.py - Discord Adapter
app/adapters/discord.py - Mock Adapters
app/adapters/mock.py
Persistent State
- Application Database
app/database.py - Domain Records
app/models.py
Other components
- User
- Gemini API
- Discord
Connections 34
- User → FastAPI App: sends requests
- FastAPI App → Posts API: routes requests
- FastAPI App → Campaign API: routes requests
- FastAPI App → Variants API: routes requests
- FastAPI App → Schedule API: routes requests
- FastAPI App → History API: routes requests
- Posts API → Post Service: invokes
- Post Service → Content Fetcher: fetches URLs
- Campaign API → Campaign Service: invokes
- Campaign Service → AI Generator: generates variants
- AI Generator → Variant Generator: falls back to
- AI Generator → Gemini API: requests generation
- AI Generator → Content Validator: validates output
- Variant Generator → Content Validator: validates output
- Content Validator → Platform Profiles: reads constraints
- Variants API → Variant Service: invokes
- Schedule API → Schedule Service: invokes
- History API → History Service: invokes
- FastAPI App → Scheduler Runner: starts and stops
- Scheduler Runner → Publish Worker: schedules job
- Publish Worker → Publish Service: publishes due slots
- Publish Service → Adapter Registry: selects adapter
- Adapter Registry → Discord Adapter: resolves adapter
- Adapter Registry → Mock Adapters: resolves adapter
- Publish Service → Publisher Interface: uses interface
- Discord Adapter → Discord: posts webhook
- Post Service → Application Database: persists posts
- Campaign Service → Application Database: persists campaigns
- Variant Service → Application Database: persists variants
- Schedule Service → Application Database: persists slots
- Publish Worker → Application Database: reads due slots
- Publish Service → Application Database: records attempts
- History Service → Application Database: reads history
- Application Database → Domain Records: stores records