rastrillo / abono Public
abono example
A small rastrillo app that sells memberships with abono. It has sign-in by emailed link, the starter pages, and the sandbox in place of Stripe, so you can click through the whole flow without a Stripe account.
Run it
cd example
go run .Open http://localhost:8080. It listens on 127.0.0.1 only.
- Sign in with any address. No mail is sent: the sign-in link is written to the log, so open it from there.
- Buy a plan. The checkout and billing pages are the sandbox's stand-ins for Stripe's: nothing is charged.
- Sign in as
owner@example.comto see the owner's pages under/admin: members, free memberships, subscriptions on prices no plan has, plans and prices, and the Stripe status.
The words on the pages are message keys (abono.pages.pricing_title) until abono's English catalog lands. The layout has one key of its own, example.signout; the sign-in screen is rastrillo's.
Settings are environment variables; main.go lists them. Set STRIPE_KEY and STRIPE_WEBHOOK_SECRET to use a Stripe test account instead of the sandbox.
Where things are
abono_pages.goandtemplates/abono/were written byabono pages -pkg main -dir .and are not edited here, so they stay exactly what an app gets. abono'scmd/abonotests fail if they drift.app.gowires it together: magic-link sign-in (rastrilloauth),abono.Newwith the sandbox, the pages, and the webhook and daily-sync endpoints, whichcsrf.Exemptlets through.models.gohas the user table, and theHolderthat makes a user for someone who pays before signing in. The only way into that user is a sign-in link sent to the address it was made for.
Test it
go test ./...
RASTRILLO_CHROME=/usr/bin/chromium go test -tags browser -run TestBrowser .The second drives the pages in Chromium from the plans to cancelling. It fails, rather than skips, when there is no browser. make ci at the repository root runs both.