Add Reddit monitoring bot — backend, frontend, and Docker config

Python/FastAPI backend with PostgreSQL for collecting Reddit data via
public .json endpoints. React/Vite dashboard for analytics. Docker Compose
setup with API and worker services connecting to shared PostgreSQL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 19:29:58 -05:00
parent aaa240dbf0
commit bc2203524f
76 changed files with 7570 additions and 0 deletions

45
backend/schemas/post.py Normal file
View File

@@ -0,0 +1,45 @@
from datetime import datetime
from pydantic import BaseModel
class PostResponse(BaseModel):
id: int
reddit_id: str
subreddit_id: int
subreddit_name: str | None = None
author_id: int | None
author_name: str | None = None
title: str
selftext: str | None
url: str | None
permalink: str | None
flair: str | None
score: int
upvote_ratio: float | None
num_comments: int
is_self: bool | None
over_18: bool
hot_rank: int | None
created_utc: datetime
collected_at: datetime
updated_at: datetime
model_config = {"from_attributes": True}
class PostDetailResponse(PostResponse):
comments: list["CommentResponse"] = []
class CommentResponse(BaseModel):
id: int
reddit_id: str
post_id: int
parent_comment_id: int | None
author_id: int | None
author_name: str | None = None
body: str
score: int
created_utc: datetime
model_config = {"from_attributes": True}