A modular, multi-tenant AI content pipeline. It extracts signals from Reddit, processes them into subtopics, and generates/schedules posts for X (Twitter).
code/models.py: ORM definitions (SignalPost, SignalComment, SubTopic, XPilotPost) with JSON support and multi-tenant grouping.code/database.py: Engine and Session management.code/main.py: FastAPI entry point with dependency injection.data/: (Persistent) SQLite storage.
docker-compose up --build- Multi-tenant: Every record has a
groupfield (indexed). Filter by your product/topic/tenant ID. - Date-Centric: High-frequency query dates (
created_at,publish_before_date) are pre-indexed for performance. - JSON Metadata: Storing raw Reddit objects in
raw_data(SignalPost) andgeneration_metadata(XPilotPost). - Relationships: Automatic foreign-key linkage between Reddit posts and comments.
GET /: Health & Engine info.POST /signals/posts/: Ingest raw Reddit posts.GET /signals/posts/?group=AI: Filter signals by group.GET /pilot/x/pending?group=AI: List scheduled posts that need pushing to X.GET /docs: Interactive Swagger documentation.