PriceGhost/README.md
clucraft 10660e5626 Initial commit: PriceGhost price tracking application
Full-stack application for tracking product prices:
- Backend: Node.js + Express + TypeScript
- Frontend: React + Vite + TypeScript
- Database: PostgreSQL
- Price scraping with Cheerio
- JWT authentication
- Background price checking with node-cron
- Price history charts with Recharts
- Docker support with docker-compose

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:58:13 -05:00

3 KiB

PriceGhost

A full-stack web application for tracking product prices across any website. Monitor prices over time and visualize price history with interactive charts.

Features

  • Track prices from any product URL
  • Automatic price extraction using heuristics and structured data
  • Configurable refresh intervals (15 min to 24 hours)
  • Price history visualization with Recharts
  • User authentication with JWT
  • Background price checking with node-cron
  • Docker support for easy deployment

Tech Stack

  • Backend: Node.js, Express, TypeScript
  • Frontend: React, Vite, TypeScript
  • Database: PostgreSQL
  • Scraping: Cheerio
  • Charts: Recharts
  • Auth: JWT + bcrypt
  • Containerization: Docker

Quick Start with Docker

  1. Clone the repository:
git clone https://github.com/yourusername/priceghost.git
cd priceghost
  1. Start all services:
docker-compose up -d
  1. Initialize the database:
docker-compose exec backend npm run db:init
  1. Access the application at http://localhost

Development Setup

Prerequisites

  • Node.js 20+
  • PostgreSQL 16+

Backend Setup

cd backend
npm install

# Create .env file
cp .env.example .env
# Edit .env with your database credentials

# Initialize database
npm run db:init

# Start development server
npm run dev

Frontend Setup

cd frontend
npm install

# Start development server
npm run dev

Environment Variables

Backend (.env)

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/priceghost
JWT_SECRET=your-secret-key
PORT=3001
NODE_ENV=development

API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login

Products (Protected)

  • GET /api/products - List tracked products
  • POST /api/products - Add product to track
  • GET /api/products/:id - Get product details
  • PUT /api/products/:id - Update product settings
  • DELETE /api/products/:id - Remove product

Prices (Protected)

  • GET /api/products/:id/prices - Get price history
  • POST /api/products/:id/refresh - Force price refresh

Project Structure

PriceGhost/
├── backend/
│   ├── src/
│   │   ├── config/         # Database configuration
│   │   ├── middleware/     # JWT auth middleware
│   │   ├── models/         # Database queries
│   │   ├── routes/         # API routes
│   │   ├── services/       # Scraper & scheduler
│   │   └── utils/          # Price parsing utilities
│   ├── Dockerfile
│   └── package.json
├── frontend/
│   ├── src/
│   │   ├── api/            # Axios client
│   │   ├── components/     # React components
│   │   ├── context/        # Auth context
│   │   ├── hooks/          # Custom hooks
│   │   └── pages/          # Page components
│   ├── Dockerfile
│   └── package.json
├── docker-compose.yml
└── README.md

License

MIT