A real-time life advice platform that aggregates content from Reddit communities and generates AI-powered commentary and images.
- Real-time polling of Reddit subreddits (r/relationship_advice, r/AMA)
- AI-generated article commentary using Google Gemini
- AI-generated header images reflecting post topics
- Warm, calming visual design
- Responsive grid layout with detail views
- Node.js 18+
- Reddit API credentials - create at https://www.reddit.com/prefs/apps (select "script" type)
- Google Gemini API key
-
Install dependencies
npm install
-
Configure environment variables
Create a
.envfile in the project root (/realtimewp/.env):# Reddit API REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret REDDIT_USERNAME=your_username REDDIT_PASSWORD=your_password # Google Gemini GEMINI_API_KEY=your_gemini_api_key # Optional configuration SUBREDDITS=relationship_advice,AMA POLL_INTERVAL=300000 MAX_ARTICLES=10 COMMENTS_PER_POST=5 PORT=3000
-
Build the project
npm run build
-
Start the server
npm start
-
Open in browser
http://localhost:3000
| Variable | Default | Description |
|---|---|---|
SUBREDDITS |
relationship_advice,AMA |
Comma-separated list of subreddits to monitor |
POLL_INTERVAL |
300000 |
Polling interval in ms (5 minutes) |
MAX_ARTICLES |
10 |
Maximum articles to keep in memory |
COMMENTS_PER_POST |
5 |
Number of top comments to fetch per post |
PORT |
3000 |
Server port |
servers/web-app/
├── src/
│ ├── index.ts # Express server and API routes
│ ├── content-engine.ts # Reddit polling and article processing
│ ├── reddit.ts # Reddit API integration
│ ├── gemini.ts # AI article and image generation
│ └── types.ts # TypeScript interfaces
├── public/
│ ├── index.html # Main page
│ ├── styles.css # Styling
│ └── app.js # Frontend logic
├── build/ # Compiled TypeScript (generated)
└── images/ # AI-generated images (generated)
| Endpoint | Description |
|---|---|
GET /api/articles |
Returns all articles with metadata |
GET /api/articles/:id |
Returns a single article by ID |
GET /api/status |
Returns processing status |
GET /api/config |
Returns current configuration |
# Build TypeScript
npm run build
# Start server
npm startMIT