A coupon management application with email integration.
incentivebox/
├── frontend/ # Frontend React application
│ ├── components/ # React components
│ ├── context/ # React context providers
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page components
│ ├── services/ # API services
│ └── utils/ # Utility functions
├── backend/ # Backend Express server
│ ├── index.js # Main server file
│ └── test-email.js # Test script for email endpoint
└── public/ # Static assets
The frontend is built with React and uses Supabase for authentication and data storage.
- Install dependencies:
npm install
- Start the development server:
npm run dev
- User authentication (sign up, login, logout)
- Coupon browsing and filtering
- Favorites management
- Email-to-coupon integration
The backend server handles inbound emails from Postmark and processes them into coupons.
- Start the server:
npm run server
- For development with auto-reload:
npm run server:dev
To test the email processing functionality:
npm run test:email
Deploy the frontend to your preferred hosting service (Vercel, Netlify, etc.):
npm run build
Deploy the backend to a server that can handle Express applications (Heroku, AWS, etc.).
Create a .env file in the root directory with:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
Create a .env file in the server directory with:
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
OPENROUTER_API_KEY=your_openrouter_key
PORT=3001