Overview
AM Group is a demo online store for precision measuring instruments, built to show everything a real shop needs: a catalogue, a cart, checkout with Stripe and PayPal, order emails, reviews, and an admin panel.
It is a portfolio demo. The company, its products and its reviews are made up, there are no real customers, and payments run in test mode only — no real money can move.
You can try it from both sides. The sign-in page has a “Try the demo” box with
two shared logins: Shopper, who can shop and pay with Stripe’s test card
4242 4242 4242 4242, and Admin, who can open every admin page but cannot
save anything. The whole shop goes back to fresh sample data every night.



The owner’s side
The admin panel has a sales dashboard with a monthly revenue chart, plus pages for products (add and edit, with picture upload), orders, users and contact messages. The demo admin sees all of it, read-only, and never sees visitors’ names or email addresses.


Tech Stack
- Next.js 16 (App Router, server actions) and React 19, in TypeScript
- Tailwind CSS 4 and shadcn/ui
- PostgreSQL 18 with Prisma 7
- NextAuth 5 — sign-up, login and roles
- Stripe and PayPal, both locked to test mode
- Nodemailer with Brevo — order receipts
- Jest — tests
- Docker behind Caddy (the web server that handles HTTPS) on my own server, shipped by GitHub Actions
Features
- 16 products in 4 categories, search, category pages and product pages with reviews
- A cart that works without an account, and joins your saved cart when you log in
- Checkout in steps: address, payment method, order summary
- Stripe confirms each payment to the server through a webhook (a message Stripe sends when a payment goes through)
- Account pages: profile and order history
- Admin: sales dashboard, products with picture upload, orders, users, messages
- One clear header for every role, light and dark mode, and a layout that works on a phone
Moving it off Vercel
The first version ran on Vercel, with Neon for the database, UploadThing for pictures and Resend for email — four services that each charge by use. Now it all runs on my own server: the database, the pictures and the app, in Docker, using about 160 MB of memory. For this move, the security work and the redesign, I worked with Claude Code (an AI coding assistant): I set the plan and checked every change.
- Builds happen on GitHub, not on the server. A push builds the app’s image (about four minutes) and sends it straight to the server over SSH, so the other sites on that server never slow down. The last three versions are kept, so a bad release is one step to undo.
- It cannot cost money, even under attack. Payments refuse to start with a real (live) key. Emails are capped at 10 a day and 1 per address, counted in the database, so a restart does not reset the count.
Making it safe for strangers
A public demo with shared logins is an open door, so I treated every visitor as hostile and went looking for holes. Some of what I found and closed:
- Admin functions anyone on the internet could call directly — create products, list every user, mark orders paid
- A cart that trusted the price the browser sent, so a visitor could set their own price
- A login page that would forward to any outside website afterwards (a phishing trick)
- An admin view that started a real payment for someone else’s unpaid order
- A guest seeing the last user’s cart after they logged out on the same computer
On top of that: rate limits on logins, sign-ups, reviews and orders; hidden fields that catch bots; a length limit on every field; and uploads for the admin only, with real picture checks and size limits. The shared logins cannot write public reviews or change their names.
Outcome
- A complete store anyone can try in a minute, from either side of the counter
- No hosting bills beyond the server I already run, and no way for a visitor to run one up
- Honest content: the made-up legal text, addresses and “verified” claims are gone; the Cookies, Privacy and Terms pages say only what the app really does