Skip to content

imonroe/fee-clear

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FeeClear

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.

Stack

  • Next.js App Router + TypeScript + Tailwind CSS
  • Prisma + PostgreSQL
  • Stripe Checkout + webhook unlocks
  • React PDF reports
  • Docker + CapRover captain-definition

Local setup

cp .env.example .env
npm install
npx prisma generate
# start Postgres separately or with docker compose
npx prisma migrate dev
npm run dev

Visit http://localhost:3000/check.

Stripe setup

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/webhook

Set the generated STRIPE_WEBHOOK_SECRET.

More detailed instruction for Stripe integration

Here are step-by-step instructions for each Stripe setting:

  1. 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)
  1. 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

  1. STRIPE_WEBHOOK_SECRET This lets Stripe notify your app when a payment completes.

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

Testing the flow end-to-end

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).

CapRover deployment

  1. Push this repo to private GitHub.
  2. Create a CapRover app, enable HTTPS, and connect the repo.
  3. Provision PostgreSQL, preferably managed Postgres or a CapRover Postgres app with backups.
  4. Set env vars in CapRover:
    • DATABASE_URL
    • NEXT_PUBLIC_APP_URL=https://your-domain.com
    • STRIPE_SECRET_KEY
    • STRIPE_WEBHOOK_SECRET
    • STRIPE_REPORT_PRICE_ID
  5. Configure Stripe webhook URL: https://your-domain.com/api/stripe/webhook for checkout.session.completed.
  6. 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_ID
    • AWS_SES_SECRET_ACCESS_KEY
    • SES_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.

Legal note

FeeClear provides educational screening and document-preparation only. It is not legal advice and does not guarantee compliance.

About

FeeClear is a Dockerized Next.js app for educational junk-fee / drip-pricing compliance screening.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages