Bytestall: a digital product store for templates and ebooks
Card checkout with just an email, a five-use download link, a buyer library, and a creator dashboard with live sales.
Run it yourself
Get the finished app on your own machine, ready to change however you like.
Press 'Enter' to confirm your input or 'Escape' to cancel
Press ⇧⌘P in VS Code and choose Elements: New App. Then paste this line and press Enter.
New to Elements? Install Elements first.
The code
How it's built
Bytestall needed product uploads, guest card checkout, download links with a limit and an expiry, emails, and live sales totals. Each of those is a part of Elements, so the agent spent its 22 minutes on the store itself.
What Elements gave the app
- Card checkout with just an email. The buy button prices the product on the server and sends the buyer to Stripe Checkout. The order is recorded when the buyer returns and again when Stripe's webhook arrives, once either way. Without a Stripe key the button opens a test checkout inside the app, which records the sale through the same function, so the whole flow runs before Stripe is connected. In production the app registers its own webhook on the first checkout.
- Product uploads. The creator's product form sends the cover and the PDF or ZIP as file fields to an
@rpcfunction, which checks each file's own bytes for its type and stores both. - Download links that count. Each purchase gets a link that works five times and expires in thirty days. One SQL update checks the count and the expiry and spends a download, so every click is counted exactly once.
- Live sales totals. Each payment, download and resend notifies a channel, and the creator's dashboard re-reads its totals, so revenue and download counts move while it is open.
- Download emails. A template emails the download link along with a link to the buyer's library of everything bought with that email, and the creator can resend it with a fresh link.
- Data from SQL files. Migrations define the store and seed the creator, six products with drawn covers and real PDF and ZIP files, and a dozen past sales. The project server applied each one as soon as it was saved.
What the project server gave the agent
The project server runs alongside the agent and answers as soon as a file is saved: it type-checks the templates, TypeScript and SQL, applies migrations and reruns the tests, so every question came back right away and the agent kept building.
What shipped
The app type-checks with zero errors and all 21 tests pass. Every page works on desktop and phone. A real sandbox payment goes through Stripe end to end and its download link serves the file, and live updates arrive on the creator's dashboard, such as the download count rising as a buyer downloads.
Join the community
Get a weekly digest of new posts.
Comments· 0