A modern payment platform for beauty professionals in the UAE, built with Next.js, Stripe Connect, and Supabase. Version 0.1.1 with auto-assignment fixes.
- Stripe Connect Integration: Embedded onboarding for beauty professionals
- Weekly Automated Payouts: Automatic Monday payouts to connected bank accounts
- Payment Links: Create and share payment links with clients
- Real-time Dashboard: Track earnings, view payout history, and manage bank accounts
- Mobile-Optimized: Responsive design for all devices
- Secure Webhooks: Stripe webhook integration for real-time payment processing
- Frontend: Next.js 15, React 18, TypeScript, Tailwind CSS
- Payments: Stripe Connect, Stripe Elements
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Deployment: Vercel
- Node.js 18+
- npm or yarn
- Stripe account with Connect enabled
- Supabase project
- Clone the repository:
git clone [repository-url]
cd decode-app
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env.local
-
Configure your
.env.local
file with:- Stripe API keys (test or live)
- Supabase project credentials
- Application URL
- Webhook secrets
-
Run database migrations:
-- Run the migrations in /migrations folder in your Supabase SQL editor
- Start the development server:
npm run dev
Visit http://localhost:3000
to see the application.
See .env.example
for all required environment variables. Key variables include:
STRIPE_SECRET_KEY
: Your Stripe secret keyNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
: Your Stripe publishable keySTRIPE_WEBHOOK_SECRET
: Webhook endpoint secret from Stripe dashboardSUPABASE_URL
: Your Supabase project URLSUPABASE_SERVICE_ROLE_KEY
: Supabase service role key for server-side operationsCRON_SECRET
: Secret for authenticating cron job requests
npm run dev
: Start development servernpm run build
: Build for productionnpm run start
: Start production servernpm run typecheck
: Run TypeScript type checkingnpm run lint
: Run ESLintnpm run test:env
: Validate environment variablesnpm run validate
: Run all validation checks
- Enable Stripe Connect in your Stripe dashboard
- Configure Connect settings:
- Set platform name and icon
- Configure onboarding settings
- Set up webhook endpoints
- Add webhook endpoints:
- Endpoint URL:
https://your-domain.com/api/webhooks/stripe
- Events to listen for:
checkout.session.completed
payment_intent.succeeded
payment_intent.payment_failed
- For Connect events:
https://your-domain.com/api/stripe/connect-webhook
- Endpoint URL:
- Configure Apple Pay domain (if using):
- Add your domain in Stripe dashboard
- Verify domain ownership
- Push your code to GitHub
- Import project in Vercel
- Configure environment variables in Vercel dashboard
- Deploy
The application includes a weekly payout cron job configured in vercel.json
:
{
"crons": [
{
"path": "/api/cron/weekly-payouts",
"schedule": "0 20 * * 0"
}
]
}
This runs every Monday at midnight GST (Sunday 8 PM UTC).
To enable:
- Set
CRON_SECRET
in your environment variables - Deploy to Vercel (cron jobs are automatically registered)
POST /api/payment/create-link
: Create a payment linkPOST /api/payment/create-payment-intent
: Create Stripe payment intentPOST /api/payment/create-stripe-session
: Create Stripe checkout session
POST /api/stripe/connect-account
: Create a Connect accountGET /api/stripe/account-status
: Get account statusGET /api/stripe/account-balance
: Get account balancePOST /api/stripe/bank-account/set-primary
: Set primary bank accountDELETE /api/stripe/bank-account/remove
: Remove bank account
POST /api/webhooks/stripe
: Main Stripe webhook handlerPOST /api/stripe/connect-webhook
: Stripe Connect webhook handlerGET /api/cron/weekly-payouts
: Weekly payout cron job
-
Stripe webhook signature verification fails:
- Ensure
STRIPE_WEBHOOK_SECRET
matches the secret in Stripe dashboard - Check that the raw request body is being used for signature verification
- Ensure
-
Apple Pay not showing:
- Verify domain is registered and verified in Stripe dashboard
- Ensure you're testing on an Apple device with Apple Pay configured
-
Database connection errors:
- Check Supabase service is running
- Verify database credentials are correct
- Ensure migrations have been run
-
Environment validation fails:
- Run
npm run test:env
to check which variables are missing - Ensure no placeholder values (containing "..." or "your-") are used
- Run
Enable debug logging by setting:
DEBUG=true
DEBUG_WEBHOOKS=true
- Always use environment variables for sensitive data
- Implement proper authentication on all API endpoints
- Validate webhook signatures for all incoming webhooks
- Use HTTPS in production
- Regularly update dependencies
- Monitor for suspicious activity in Stripe dashboard
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is proprietary and confidential.
For support, email support@decode.beauty or create an issue in the repository.