/PROJECT BRIEF
Next.js App / TypeScript Tooling
OfferEngine
A browser-only offer tool for generating and checking discount codes — no account, no server database. Codes, QR payloads, and saved state stay on the device.
What it is
OfferEngine is a Next.js 15 App Router tool for creating discount-style offer codes and checking whether a code is valid under the rules you configure. It is a personal engineering project, not a multi-tenant SaaS or a payment processor.
Everything runs in the browser. There is no OfferEngine backend, no shared offer catalog, and no merchant account integration. If you clear site data, saved codes leave with it.
How it works
You configure code length, character set, and discount rules, then generate codes with crypto.getRandomValues rather than Math.random. That keeps generation on a cryptographic RNG available in modern browsers.
Validation checks the submitted string against those same rules — format, length, and discount constraints — and returns a clear pass or fail in the UI. Valid codes can be copied to the clipboard and rendered as a QR image for scanning or sharing outside the app.
Generated codes and recent configuration persist in localStorage so a refresh does not wipe the workspace. Persistence is local only; nothing syncs across devices or users.
How it’s built
The app is Next.js 15 and TypeScript with Tailwind CSS for the interface. Logic that matters — generation, validation, and persistence helpers — is covered with Vitest unit tests.
GitHub Actions runs lint, type-check, test, and build on the default branch so regressions show up before a Vercel deploy. The live deployment is a static client surface on Vercel.
What it is not
OfferEngine does not process payments, talk to Stripe, or enforce redemptions at checkout. It does not store offers on a server or issue codes that a store would automatically honor.
Treat it as a typed, tested client tool for code generation and validation UX — useful for demos, local experiments, and practicing production habits (CI, tests, careful randomness) without inventing backend claims.
Stack
- Next.js
- TypeScript
- Tailwind CSS
- Vitest
- GitHub Actions
- Vercel