Automated Retail Intelligence Engine
PriceDelta is a full-stack market intelligence platform that automates retail price tracking, ingesting high-frequency product data, visualizing historical market trends, and execututing real-time alert triggers when prices fluctuate beyond user-defined thresholds.
- Automated Scraper Engine: Background workers (
ingestor.ts) autonomously scrape and normalize product data from external sources. - Trend Analytics: Interactive visualization of historical price action using Recharts, helping users identify optimal buying windows.
- Smart Alerts: User-defined custom price targets, with distinct
alertCheckerjobs to trigger instant email notifications when targets are met.
- Robust Authentication: Stateless JWT-based auth flow with secure session management and Bcrypt password hashing.
- End-to-End Type Safety: Strict type sharing between the Prisma database schema and React frontend ensures runtime reliability.
- Performance Optimization: Uses optimistic UI updates and responsive design with Tailwind CSS.
-
Decoupled Microservices: Utilizes a Controller-Service pattern in Express.js to strictly separate business logic from API orchestration.
-
Data Integrity: Leverages Prisma ORM with PostgreSQL to enforce strict schema definitions across complex User, Product, and PriceHistory relations.
-
Ingestion Engine: Built a dedicated worker that fetches raw external data, normalizes it to the internal schema, and upserts it into persistent storage.
-
Scheduled Execution: Integrated node-cron to orchestrate recurring "Price Check" jobs that detect market fluctuations at defined intervals.
-
Async Notification Logic: Developed an independent service that evaluates price changes against watchlists, dispatching email alerts via Nodemailer only when specific thresholds are met.
- React (Vite): & TypeScript: Modular architecture with strict end-to-end type safety.
- Tailwind CSS: Responsive, high-performance styling.
- Axios: Configured with interceptors to handle authenticated API requests and global error management.
- Recharts: Interactive data visualization for historical price trends.
- Node.js & Express.js: Built a high-concurrency RESTful API using a modular architecture for efficient request handling.
- Prisma ORM: & PostgreSQL: Type-safe ORM with strict relational schema enforcement and automated migrations.
- JSON Web Tokens (JWT): & Bcrypt.js: Stateless authentication with industry-standard secure password hashing.
- Nodemailer: & Node-Cron: Orchestrates background ingestion workers and automated SMTP communication for email alert dispatch.
- Node.js (v18 or higher recommended)
- PostgreSQL database instance
- Navigate to the server directory:
cd backend npm install - Configure environment variables:
- Create a
.envfile matching.env.example. - Ensure your PostgreSQL instance is running.
- Create a
- Initialize the database:
npx prisma migrate dev --name init
- Start the server:
npm run dev
- Navigate to the client directory:
cd frontend npm install - Start the development server:
npm run dev
POST /api/auth/register: Register a new user.POST /api/auth/login: Log in a user.GET /api/user/me: Get authenticated user's profile.PATCH /api/user/me: Update authenticated user's profile.GET /api/products: Get all products.GET /api/products/:id: Get a single product with price history.GET /api/alerts: Get all price alerts for the authenticated user.POST /api/alerts: Create a new price alert.DELETE /api/alerts/:id: Delete a price alert.GET /api/notifications: Get all notifications for the authenticated user.PATCH /api/notifications/:id/read: Mark a notification as read.GET /health: Health check endpoint.GET /api/ingest: Manually trigger data ingestion.
.
├── backend/
│ ├── .gitignore
│ ├── nodemon.json
│ ├── package-lock.json
│ ├── package.json
│ ├── tsconfig.json
│ ├── generated/ # Generated Prisma client files
│ ├── node_modules/ # Project dependencies
│ ├── prisma/ # Prisma schema, migrations
│ └── src/
│ ├── config/ # Application configuration
│ ├── controllers/ # Request handlers
│ ├── generated/ # Prisma client and model definitions
│ ├── middleware/ # Express middleware
│ ├── routes/ # API route definitions
│ ├── workers/ # Background worker logic
│ └── index.ts # Backend entry point
├── frontend/
│ ├── .gitignore
│ ├── dev.js
│ ├── eslint.config.js
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── tailwind.config.js
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ ├── vite.config.ts
│ ├── node_modules/ # Project dependencies
│ ├── public/ # Static assets
│ └── src/
│ ├── App.css
│ ├── App.tsx
│ ├── index.css
│ ├── main.tsx # Frontend entry point
│ ├── api/ # API client services
│ ├── assets/ # Images and other static files
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React Context providers
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page-level components
│ ├── services/ # Frontend business logic services
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
└── README.md