A lightweight Reddit feedback analysis application for r/Comcast_Xfinity that uses AI to analyze posts and provide insights.
- 🤖 AI-powered sentiment analysis using OpenAI
- 📊 Real-time analytics dashboard
- 💬 Interactive chat interface
- 🔍 Keyword extraction and trending topics
- 📈 Problem report detection and urgency scoring
- ⏰ Background data collection every hour
- Node.js 18+
- OpenAI API key
- (Optional) Docker for containerized deployment
Copy .env.example to .env and configure:
cp .env.example .envRequired variables:
OPENAI_API_KEY: Your OpenAI API key
Optional variables:
PORT: Server port (default: 3000)NODE_ENV: Environment mode (default: development)
- Clone and install dependencies:
git clone <your-repo-url>
cd reddit-2
npm install- Configure environment:
cp .env.example .env
# Edit .env with your OpenAI API key- Start the application:
npm start- Open http://localhost:3000 in your browser
- Build and run with Docker Compose:
# Set your OpenAI API key
export OPENAI_API_KEY=your_actual_key_here
# Start the application
docker-compose up -d- View logs:
docker-compose logs -f- Stop the application:
docker-compose down# Build the image
docker build -t reddit-analytics .
# Run the container
docker run -d \
-p 3000:3000 \
-e OPENAI_API_KEY=your_actual_key_here \
-v $(pwd)/data:/app/data \
--name reddit-analytics \
reddit-analytics- Install Heroku CLI and login:
heroku login- Create and deploy:
heroku create your-app-name
heroku config:set OPENAI_API_KEY=your_actual_key_here
git push heroku main- Connect your GitHub repo to Railway
- Set environment variables in Railway dashboard
- Deploy automatically on git push
- Connect your GitHub repo
- Configure environment variables
- Deploy with auto-scaling
Use the provided Dockerfile with your preferred container service:
- AWS ECS/Fargate
- Google Cloud Run
- Azure Container Instances
- Dashboard: View real-time analytics and trends
- Chat Interface: Ask questions about Reddit data
- Background Collection: Data is automatically collected every hour
- API Endpoints: Access data programmatically
GET /- Main dashboardGET /api/posts- Get analyzed postsPOST /api/chat- Chat with AI about dataGET /api/analytics- Get analytics summary
The app uses SQLite for data storage. The database file (reddit_analytics.db) is created automatically and stores:
- Reddit posts with metadata
- Sentiment analysis results
- Keywords and trends
- Problem reports and urgency scores
reddit-2/
├── server.js # Main application server
├── public/
│ └── index.html # Frontend dashboard
├── reddit_analytics.db # SQLite database
├── package.json # Dependencies
├── Dockerfile # Container configuration
├── docker-compose.yml # Multi-container setup
└── .env.example # Environment template
npm start- Start production servernpm run dev- Start development server
- OpenAI API errors: Verify your API key is correct and has credits
- Port conflicts: Change PORT in .env if 3000 is occupied
- Database issues: Delete
reddit_analytics.dbto reset - Memory issues: Increase container memory limits if needed
Check application logs:
# Docker
docker-compose logs -f
# Local
npm startISC License
For issues and questions, please check the application logs and ensure all environment variables are properly configured.