A smart price tracking application that monitors product prices across e-commerce platforms and notifies you when prices drop below your target.
- Lightning Fast - Extracts prices in seconds using Firecrawl, handling JavaScript and dynamic content
- Always Reliable - Works across all major e-commerce sites with built-in anti-bot protection
- Smart Alerts - Get email notifications instantly when prices drop below your target
- Price History - Visual charts to track price trends over time
- Automated Monitoring - Cron jobs automatically check prices at regular intervals
- Secure Authentication - User authentication powered by Supabase
- Framework: Next.js 16 with App Router
- UI Library: React 19
- Styling: Tailwind CSS 4
- Database & Auth: Supabase
- Web Scraping: Firecrawl
- Email Service: Resend
- Charts: Recharts
- UI Components: Radix UI + Lucide Icons
Before you begin, ensure you have:
- Node.js 18+ installed
- A Supabase account and project
- A Firecrawl API key
- A Resend API key for email notifications
- (Optional) A cron job service for automated price checks
-
Clone the repository
git clone https://github.com/yourusername/dealdrop.git cd dealdrop -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:# Supabase NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key # Firecrawl FIRECRAWL_API_KEY=your_firecrawl_api_key # Resend (Email) RESEND_API_KEY=your_resend_api_key # Cron Secret (for automated price checks) CRON_SECRET=your_secure_random_string
-
Set up Supabase Database
Run the following SQL in your Supabase SQL Editor:
-- Create product table create table product ( id uuid default gen_random_uuid() primary key, user_id uuid references auth.users not null, url text not null, name text not null, current_price numeric not null, currency text default 'USD', image_url text, created_at timestamp with time zone default timezone('utc'::text, now()) not null, updated_at timestamp with time zone default timezone('utc'::text, now()) not null, unique(user_id, url) ); -- Create price_history table create table price_history ( id uuid default gen_random_uuid() primary key, product_id uuid references product(id) on delete cascade not null, price numeric not null, currency text default 'USD', checked_at timestamp with time zone default timezone('utc'::text, now()) not null ); -- Enable Row Level Security on product table alter table product enable row level security; -- Create policies for product table create policy "Users can view their own products" on product for select using (auth.uid() = user_id); create policy "Users can insert their own products" on product for insert with check (auth.uid() = user_id); create policy "Users can update their own products" on product for update using (auth.uid() = user_id); create policy "Users can delete their own products" on product for delete using (auth.uid() = user_id); -- Enable Row Level Security on price_history table alter table price_history enable row level security; -- Create policies for price_history table create policy "Users can view price history for their products" on price_history for select using ( exists ( select 1 from product where product.id = price_history.product_id and product.user_id = auth.uid() ) );
-
Run the development server
npm run dev
-
Open http://localhost:3000 in your browser
- Sign In - Create an account or sign in using Supabase authentication
- Add Product - Paste any product URL from supported e-commerce sites
- Monitor - DealDrop will automatically track price changes
- View History - Check price history charts for each product
- Get Notified - Receive email alerts when prices drop (via cron jobs)
The app includes a cron endpoint at /api/cron/check-price that automatically checks all tracked products and sends email alerts when prices drop.
To set up automated checks:
-
Use a cron service like Vercel Cron, EasyCron, or cron-job.org
-
Configure a POST request to:
https://your-domain.com/api/cron/check-price -
Add the authorization header:
Authorization: Bearer YOUR_CRON_SECRET -
Set your desired schedule (e.g., every 6 hours)
The cron endpoint will:
- Check all products in the database
- Update current prices
- Record price changes in the history table
- Send email alerts when prices drop below previous prices
dealdrop/
├── app/
│ ├── action.js # Server actions (add/delete products, get data)
│ ├── page.jsx # Home page
│ ├── layout.js # Root layout
│ └── api/
│ ├── auth/
│ │ └── callback/ # Auth callback route
│ └── cron/
│ └── check-price/ # Price monitoring cron endpoint
├── components/
│ ├── AddProductForm.jsx # Product URL input form
│ ├── AuthButton.jsx # Authentication button
│ ├── Authmodel.js # Auth modal component
│ ├── PriceChart.jsx # Price history chart component
│ ├── ProductCard.jsx # Product display card
│ └── ui/ # Reusable UI components (shadcn/ui)
├── lib/
│ ├── email.js # Email service (Resend integration)
│ ├── firecrawl.js # Web scraping utilities (Firecrawl integration)
│ └── utils.js # Helper functions
└── utils/
└── supabase/ # Supabase client configurations
├── client.js # Browser client
├── server.js # Server client
└── middleware.js # Middleware client
The project uses shadcn/ui components built with Radix UI and Tailwind CSS:
- Alert, Badge, Button, Card, Dialog, Input, Sonner (toast notifications)
addProduct(formData)- Add a new product to trackdeleteProduct(productId)- Remove a product from trackinggetProducts()- Get all products for the current usergetPriceHistory(productId)- Get price history for a specific product
POST /api/cron/check-price- Cron endpoint for automated price checking- Requires
Authorization: Bearer YOUR_CRON_SECRETheader - Returns JSON with update statistics
- Requires
If you encounter errors with product scraping:
- Verify your
FIRECRAWL_API_KEYis set correctly in.env.local - Ensure the product URL is accessible and public
- Check that the URL is a valid absolute URL (includes protocol: https://)
- Review the Firecrawl API documentation for any service updates
- Verify your Supabase credentials in
.env.local - Ensure all database tables and policies are created correctly
- Check that Row Level Security policies are properly configured
- Verify your
RESEND_API_KEYis set correctly - Check that the Resend API key has sending permissions
- Ensure email addresses in your database are valid
- Ensure
.env.localis in the root directory - Restart your development server after changing environment variables
- Verify variable names match exactly (case-sensitive)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- Firecrawl for reliable web scraping
- Supabase for backend infrastructure
- Vercel for hosting
- shadcn/ui for beautiful UI components
For support, email your-email@example.com or open an issue in the repository.
