A Next.js-based Dutch auction platform originally built by @Shpigford to sell Optic, a competitive monitoring and analysis platform. This project implements a fully automated Dutch auction system where the price decreases continuously over time until someone makes a purchase.
NOTE: This was originally thrown together very quickly for one specific purpose (selling Optic), so there's some cleanup to be done to repurpose it for your own use.
-
🏷️ Dutch Auction System
- Automated price reduction over a 7-day period
- Configurable starting and ending prices
- Real-time price updates
- First-come, first-served purchase system
-
📊 Price Monitoring
- Real-time price display with automatic updates
- Countdown timer for auction start/end
- Average target price indicator
- Current visitor count display
-
📧 Price Notifications
- Email notification system when price reaches target
- Rate limiting and spam protection
- IP-based subscription limits
- Automated email delivery via Postmark
-
💳 Payment Processing
- Stripe integration for secure payments
- Automatic auction completion upon successful purchase
- Sale status tracking
-
🔒 Security Features
- Rate limiting on all API endpoints
- IP address hashing for privacy
- Input validation and sanitization
- Secure environment variable handling
- Frontend: Next.js 15, React, TypeScript, Tailwind CSS, Framer Motion
- Backend: Next.js API Routes, Supabase
- Database: PostgreSQL (via Supabase)
- Email: Postmark
- Payment: Stripe
- Deployment: Vercel
- Node.js 18.x or higher
- npm or yarn
- Supabase account
- Postmark account
- Stripe account
Create a .env.local
file using the .env.example
file as a template.
- Clone the repository:
git clone https://github.com/Shpigford/dutch-auction.git
cd dutch-auction
- Install dependencies:
npm install
# or
yarn install
-
Set up your environment variables in
.env.local
-
Run the database migrations:
npm run supabase:migrate
# or
yarn supabase:migrate
- Start the development server:
npm run dev
# or
yarn dev
- Open http://localhost:3000 with your browser to see the result.
The project uses Supabase for database management. The necessary migrations are included in the supabase/migrations
directory. They will create the following tables:
sale_status
: Tracks the auction status and final sale priceemail_notifications
: Stores user notification preferencesvisitor_count
: Tracks unique visitors
/api/check-price-notifications
: Checks and sends price notifications/api/create-checkout-session
: Creates Stripe checkout sessions/api/subscribe-notification
: Handles notification subscriptions/api/verify-payment
: Processes successful payments/api/webhook
: Handles Stripe webhooks
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
- Built with Next.js
- Styled with Tailwind CSS
- Animations by Framer Motion
- Database by Supabase
- Payments by Stripe
- Email delivery by Postmark