Minimal viable dashboard for ImpacterAGI customers to manage credits and submit tasks.
✅ Authentication - Signup/Login with JWT tokens
✅ Credit Management - Display and track credit balance
✅ Task Submission - Simple form to submit tasks (10 credits each)
✅ Stripe Integration - Webhook handler for automatic account creation
✅ Email Notifications - Welcome emails via AWS SES
✅ Task History - View submitted tasks and their status
- Frontend: Next.js 14 + React + Tailwind CSS
- Auth: JWT tokens, bcrypt password hashing
- Database: AWS DynamoDB (3 tables)
- Email: AWS SES
- Payments: Stripe webhooks
- Deployment: Cloudflare Pages + Workers
npm installnode scripts/setup-db.jsThis creates three tables:
ImpacterAGI_Users- User accountsImpacterAGI_Transactions- Credit purchases/spendsImpacterAGI_Tasks- Submitted tasks
Edit .env.local:
STRIPE_SECRET_KEY=sk_live_51S21n0PRrsO1NVxA...
STRIPE_WEBHOOK_SECRET=whsec_... # Get this after setting up webhook
JWT_SECRET=your-secure-random-string
NEXT_PUBLIC_APP_URL=https://dashboard.impacteragi.comnpm run devVisit http://localhost:3000
- Deploy to Cloudflare Pages (see below)
- Go to Stripe Dashboard → Webhooks
- Add endpoint:
https://dashboard.impacteragi.com/api/stripe/webhook - Select event:
checkout.session.completed - Copy webhook secret to
.env.local
- Build command:
npm run build - Build output directory:
.next - Root directory:
/
# Install Wrangler
npm install -g wrangler
# Login to Cloudflare
wrangler login
# Deploy
npx @cloudflare/next-on-pages
# Or use Cloudflare Dashboard:
# 1. Go to Pages → Create a project
# 2. Connect your Git repo
# 3. Configure build settings above
# 4. Add environment variables
# 5. Deploy!Add these in Cloudflare Pages → Settings → Environment Variables:
STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETJWT_SECRETNEXT_PUBLIC_APP_URL
- Customer pays via Stripe checkout ($10 = 1,000 credits)
- Stripe sends
checkout.session.completedevent to/api/stripe/webhook - Webhook creates user account (or adds credits to existing account)
- Welcome email sent with dashboard login link
- Customer logs in and sees their credits
- Customer logs into dashboard
- Enters task description in text area
- Clicks "Submit Task" (costs 10 credits)
- Credits deducted, task saved to DynamoDB with status "pending"
- Task appears in history section
Tasks are stored in DynamoDB table ImpacterAGI_Tasks. Admin can:
- Query all pending tasks
- Update task status (pending → in-progress → completed)
- Use AWS Console or custom admin tool
POST /api/auth/signup- Create new accountPOST /api/auth/login- Login and get JWT tokenGET /api/user- Get current user infoPOST /api/tasks- Submit new taskGET /api/tasks- Get user's tasksGET /api/transactions- Get user's credit transactionsPOST /api/stripe/webhook- Stripe webhook handler
/login- Login page/signup- Signup page/dashboard- Main dashboard (requires auth)
email (PK)
password_hash
credits_balance
created_at
stripe_customer_id
transaction_id (PK)
user_email (GSI)
type: 'purchase' | 'spend'
amount
timestamp
description
stripe_payment_intent
task_id (PK)
user_email (GSI)
description
status: 'pending' | 'in-progress' | 'completed'
credits_spent
created_at
updated_at
- Customer pays $10 via Stripe
- Webhook auto-creates account with 1,000 credits
- Customer receives email with dashboard link
- Customer logs in, sees 1,000 credits
- Customer can submit a task (deducts 10 credits)
- Task appears in history for manual processing
- Admin dashboard to manage tasks
- Password reset flow implementation
- Credit purchase page (Stripe checkout link)
- Email notifications when tasks complete
- Task filtering/search
- Better error handling
- Rate limiting
- Testing suite
Webhook not working:
- Check Stripe webhook secret is correct
- Verify endpoint URL is publicly accessible
- Check Stripe Dashboard → Webhooks → Recent events for errors
Email not sending:
- Verify AWS SES sender email is verified
- Check AWS credentials have SES permissions
Login not working:
- Check JWT_SECRET is set
- Clear browser localStorage and try again
Database errors:
- Verify AWS credentials have DynamoDB permissions
- Check table names match exactly
- Run
node scripts/setup-db.jsagain
For issues or questions, contact: alexander@homefreedom.com
Built in 4-6 hours as minimal viable product. Polish later! 🚀