FeeClear is a Dockerized Next.js app for educational junk-fee / drip-pricing compliance screening. Users complete a free assessment, see a risk score, and can unlock a $29 full PDF report via Stripe Checkout.
- Next.js App Router + TypeScript + Tailwind CSS
- Prisma + PostgreSQL
- Stripe Checkout + webhook unlocks
- React PDF reports
- Docker + CapRover
captain-definition
cp .env.example .env
npm install
npx prisma generate
# start Postgres separately or with docker compose
npx prisma migrate dev
npm run devVisit http://localhost:3000/check.
Create a one-time Stripe price for the full report and set:
STRIPE_SECRET_KEY=sk_test_...
STRIPE_REPORT_PRICE_ID=price_...For local webhooks:
stripe listen --forward-to localhost:3000/api/stripe/webhookSet the generated STRIPE_WEBHOOK_SECRET.
Here are step-by-step instructions for each Stripe setting:
- STRIPE_SECRET_KEY
- Log in at dashboard.stripe.com
- Click Developers (top right) → API keys
- Under "Secret key", click Reveal test key (use the test key first to verify everything works, then swap to the live key when ready)
- Copy the value starting with sk_test_... (or sk_live_... for production)
- STRIPE_REPORT_PRICE_ID This is the $29 one-time product you're selling.
- In the Stripe dashboard, go to Product catalog (left sidebar)
- Click + Add product
Fill in:
- Name: FeeClear Full Report
- Description: (optional) Detailed findings, recommendations, and PDF download
Under Pricing, set:
- Pricing model: One time
- Price: $29.00
- Currency: USD
Click Save product
On the product page, you'll see a Price ID under the pricing section — it looks like price_1ABC... Copy that value — that's your STRIPE_REPORT_PRICE_ID
- STRIPE_WEBHOOK_SECRET This lets Stripe notify your app when a payment completes.
- In the Stripe dashboard, go to Developers → Webhooks
- Click + Add endpoint
- Set Endpoint URL to: https://www.fee-clear.com/api/stripe/webhook
Under Select events to listen to, click + Select events and choose: \
- checkout.session.completed
- Click Add endpoint
On the webhook detail page, click Reveal under Signing secret Copy the value starting with whsec_... — that's your STRIPE_WEBHOOK_SECRET
Before going live, test with Stripe's test card number 4242 4242 4242 4242 (any future expiry, any CVC). Stripe test mode won't charge anyone. Once you've confirmed a payment goes through and the report unlocks, swap sk_test_... → sk_live_... and re-generate the webhook with your live mode keys (webhooks are mode-specific — you need a separate one for live mode).
- Push this repo to private GitHub.
- Create a CapRover app, enable HTTPS, and connect the repo.
- Provision PostgreSQL, preferably managed Postgres or a CapRover Postgres app with backups.
- Set env vars in CapRover:
DATABASE_URLNEXT_PUBLIC_APP_URL=https://your-domain.comSTRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETSTRIPE_REPORT_PRICE_ID
- Configure Stripe webhook URL:
https://your-domain.com/api/stripe/webhookforcheckout.session.completed. - Set Amazon SES env vars so the webhook can email the purchased PDF report to the customer:
AWS_SES_REGION(e.g.,us-east-1)AWS_SES_ACCESS_KEY_IDAWS_SES_SECRET_ACCESS_KEYSES_FROM_EMAIL— a verified SES sender (or any address in a verified domain)SES_CONFIGURATION_SET— optional, for SES delivery/bounce/complaint tracking
The container runs npx prisma migrate deploy && npm start on boot.
FeeClear provides educational screening and document-preparation only. It is not legal advice and does not guarantee compliance.