mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-04-25 00:36:32 +02:00
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>
3 KiB
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
- Clone the repository:
git clone https://github.com/yourusername/priceghost.git
cd priceghost
- Start all services:
docker-compose up -d
- Initialize the database:
docker-compose exec backend npm run db:init
- 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 userPOST /api/auth/login- Login
Products (Protected)
GET /api/products- List tracked productsPOST /api/products- Add product to trackGET /api/products/:id- Get product detailsPUT /api/products/:id- Update product settingsDELETE /api/products/:id- Remove product
Prices (Protected)
GET /api/products/:id/prices- Get price historyPOST /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