A small, two-service project for researching subreddits and aggregating persona-style insights. The new structure separates a FastAPI backend from a Next.js frontend for clean deploys.
- backend: FastAPI service exposing
/apiendpoints - web: Next.js 14 app (App Router) consuming the backend
Legacy notes, experiments, and older details have been moved to oldreadme.md.
- Node.js 20+
- Python 3.11+
- Backend (place in
backend/.env):OPENAI_API_KEYREDDIT_CLIENT_IDREDDIT_CLIENT_SECRET
- Frontend (place in
web/.env):NEXT_PUBLIC_API_BASE_URL(e.g.http://localhost:8000/api)
# Backend
cd backend
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
uv sync
uv run uvicorn main:app --reload --host 0.0.0.0 --port 8000
# Frontend
cd web
npm install
npm run devOpen the app at http://localhost:3000. The API runs on http://localhost:8000.
Ensure you have backend/.env and web/.env populated as noted above.
GET /— health checkPOST /api/research/subreddit— body:{ subreddit_name: string, duration?: '1d' | '1week' | '1month', limit?: number }POST /api/research— legacy persona aggregator (kept for reference)
- Backend (Render)
- Path:
backend/ - Build Command:
curl -LsSf https://astral.sh/uv/install.sh | sh && export PATH=\"$HOME/.local/bin:$PATH\" && uv sync --no-dev - Start Command:
export PATH=\"$HOME/.local/bin:$PATH\" && uv run uvicorn main:app --host 0.0.0.0 --port $PORT - Env Vars:
OPENAI_API_KEY,REDDIT_CLIENT_ID,REDDIT_CLIENT_SECRET - Optional IaC:
backend/render.yamlis included (monorepo).
- Path:
- Frontend (Vercel)
- Framework: Next.js 14 (auto-detected)
- Env Var:
NEXT_PUBLIC_API_BASE_URL→ set to your Render backend public URL (e.g.https://your-render-service.onrender.com/api) - Build Command: default (
next build) - Output: default (
.next)
- The older notes and examples live in
oldreadme.mdto keep this README focused on the new structure and deploy path.
Sample curl:
curl -v -X POST \
-F "face=@/Users/sarthakagrawal/Desktop/agentData/sample.webp;type=image/webp" \
-F "audio=@/Users/sarthakagrawal/Desktop/agentData/sample_small.mp3;type=audio/mpeg" \
{{api_link}}/generateVideo \
-H "x-api-key: {{api_key}}" -o response.jsoncat response.json | jq -r .video_b64 | base64 --decode > final.mp4
open final.mp4