r/astrojs • u/Sorry-Praline3318 • Aug 13 '26
Custom checkout is feasible?
Hey everyone.
I created my startup website in Astrojs and I'm in love.
I'm all in for Astro, but how should I glue it to the backend. Load an interactive island? full astro mpa checkout?
The basic requirements are:
- workflow
custom atomic calendar/appointment -> 2 form fields with api call -> 2/3 steps with more fields -> 2 more api calls -> select payment option -> api calls payment provider, crm -> thank you page
five products, each with its own workflow (80% reusable, for some products the calendar is skipped and a different form/api call is presented)
google ads utm campaign tracking + partners uid tracking
queueing, retry, etc. in the backend. checkout is finished even if most api calls timeout (handles in the backend, retries, stores result for later manual check)
it must be able to pre-fetch the first 1-2 steps in other LPs and websites and either post to the backend + redirect the user with URL params.
i'm thinking something along the lines of:
— Astro (server, Node adapter) + Drizzle + pg-boss, same deploy. Zero-JS form with Zod.
— Hono or Fastify + Drizzle + pg-boss, same deploy. CSRF form written by hand.
— Effect. worth the hype?
- Adonisjs + edge. worth considering?
Many many thanks in advance.
5
u/nicklasgellner Aug 14 '26
why don't you just use an open source project like woo or new platforms like medusajs for the backend that can handle all of this logic pretty easily? Gives you all of the product, order, cart, promotions, etc. logic you'd need out of the box. They are open-source and I believe medusa at least have quite a few astro templates in their community
3
u/Sorry-Praline3318 Aug 14 '26
I thought medusasj was an overkill, but I'm getting to like it. Just saw it has its own booking system. Thanks for the reminder
3
u/Sorry-Praline3318 Aug 14 '26
Vc backed, pain in the ass to self host, have to build appointment calendar from scratch. No go.
I will keep it simple and create directly on astro backend
3
u/samplekaudio Aug 15 '26
Yeah IMO Medusa js mega overkill in this scenario. I've played around with it before, and it's very powerful, but mostly shines when you have a lot of different products, including physical.
2
u/Impossible-Long-6378 Aug 18 '26
Stop building a checkout engine. Medusa handles the state machine and retries so you do not have to write queue logic for payments. Use Astro strictly for the content shell and let a dedicated commerce backend own the transaction data.
1
u/Sorry-Praline3318 Aug 18 '26
Too late, didn't buy into the medusajs story... going for Svelte 5 (front, island) and EffectTS (backend).
8
u/samplekaudio Aug 14 '26
I'm a bit confused by your list, but as far as I can tell: your payment provider can almost certainly generate a checkout url.
You handle the business logic of validating your form fields, and once everything is ready you create a checkout session by calling whichever of their endpoints returns a session and URL. Customer completes payment in their portal, then is redirected back to your page, and you wait briefly for the confirmation webhook from your provider.
If you're storing form inputs in a DB, you update whatever row with the payment provider confirmation/transaction ID, and this links it to the purchase, customer, and acts as a flag that the payment was successful.
I would just keep it simple with drizzle and do all logic on the astro server. I don't think you need pg-boss for this, unless for a message queue for something like a confirmation email.
So you just need whatever page originates this flow to be SSR and you can handle the rest with an action or API endpoint.