Skip to content

celias/comic-hunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comic Hunter — Reddit Poller (Node.js)

Polls Reddit JSON feeds for free/cheap comics and collectibles. No Reddit account or API key needed — uses Reddit's public JSON endpoint. Scores posts by keyword and location, saves to Postgres, and fires Discord webhook alerts.


Setup

1. Install dependencies

This project uses npm workspaces for monorepo management. A single install command handles everything:

npm install

2. Configure environment

Create a .env file in the project root:

DATABASE_URL=your_neon_postgres_connection_string
DISCORD_WEBHOOK_URL=your_discord_webhook_url

Database: The app uses Neon (cloud Postgres) in development and AWS RDS in production. Run npx prisma db push after setting DATABASE_URL to create the schema.

Discord webhook:

  1. Open any Discord channel
  2. Channel Settings → Integrations → Webhooks → New Webhook
  3. Copy the URL

3. Run

For development (recommended):

# Single command runs API server + dashboard + Reddit poller
npm run dev:manual

Individual processes:

# Reddit poller (saves alerts to database)
npm start

# API server only (port 3001)
npm run server

# Dashboard only (port 5173)
npm run dashboard

Verify the API is up:

curl http://localhost:3001/api/health

Production build:

npm run build

API

The Express server exposes three endpoints:

Method Path Description
GET /api/health Liveness check
GET /api/alerts Paginated alert list with filters
GET /api/alerts/:id Single alert by id

GET /api/alerts query params:

Param Default Description
page 1 Page number
limit 20 Results per page (max 100)
minScore 0 Minimum score filter
localOnly false "true" to show only local posts
subreddit Filter by subreddit name
since ISO timestamp — only alerts newer than this (for live polling)

Edit SCORE_THRESHOLD in lib/config.ts:

Threshold What you get
5 Everything — very noisy
10 Good starting point
15 Only strong matches
20+ Quiet — only clear wins

To add content keywords, edit the KEYWORDS array in lib/keywords.ts:

["your keyword", pointValue],

To add location keywords (South/Central NJ area), edit LOCATION_KEYWORDS in lib/config.ts.


Running 24/7

tmux (simplest):

tmux new -s comics
npm start
# Ctrl+B then D to detach

tmux new -s api
npm run server
# Ctrl+B then D to detach

PM2 (recommended):

npm install -g pm2
pm2 start reddit-poller.ts --name comic-hunter-poller
pm2 start api-server.ts --name comic-hunter-api
pm2 save
pm2 startup

Using Turborepo for production:

# Build optimized assets
npm run build

# Deploy built dashboard to S3/CloudFront
# Run API server on EC2/ECS

What's next

  • AWS Cognito auth — per-user settings and seen state
  • eBay flip value — price lookup on local posts once API key arrives
  • Facebook Marketplace — Playwright scraper, geo-targeted listings
  • Buy Nothing — Facebook Buy Nothing group scraper (same session as Marketplace)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors