Skip to content

About

real time webpage

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

life.ai

A real-time life advice platform that aggregates content from Reddit communities and generates AI-powered commentary and images.

Features

  • 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

Prerequisites

Setup

  1. Install dependencies

    npm install
  2. Configure environment variables

    Create a .env file 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
  3. Build the project

    npm run build
  4. Start the server

    npm start
  5. Open in browser

    http://localhost:3000
    

Configuration Options

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

Project Structure

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)

API Endpoints

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

Development

# Build TypeScript
npm run build

# Start server
npm start

License

MIT

About

real time webpage

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages