DEV Community

Jay P
Jay P

Posted on

Lessons from Building a Full Invoice App for the Price of a Netflix Subscription

Like a lot of devs, I built a side project that scratched a personal itch: an invoice generator. But instead of going full SaaS startup mode, I treated it as a challenge—build something clean, useful, and fast, with a real login system, server-side PDF generation, and as little overhead as possible.

The result is InvoiceDen, a React-based web app hosted on Cloudflare Pages, with backend functionality on an EC2 instance, all for about $8/month.

Here’s what I learned architecting it on a shoestring budget — and how you can do something similar without spinning up Kubernetes or draining your wallet.

⚙️ The Stack

The app is split into a classic frontend + backend setup, but optimized for cost and simplicity.

  • Frontend: React app hosted on Cloudflare Pages

    • Static deploys, global CDN, zero dollars
  • Backend: Small server on a tiny EC2 instance

    • Handles login, PDF generation, and basic routing
  • Auth: Email/password login using bcrypt + sessions

    • No Firebase, no OAuth maze
  • PDFs: Generated on the server using pdfkit

    • Outputs a clean PDF based on user inputs and invoice state

Despite being a “small project,” it touches almost every part of a typical web stack.

🧠 Why I Didn’t Go Full Serverless

I considered doing everything client-side (including PDF generation), but it had some real downsides:

  • PDFs from the browser can be inconsistent across devices

  • Email/password auth is still easier to reason about with a session-based backend

  • Some features (like saving draft invoices) were easier to build with a traditional API

EC2 gave me just enough flexibility to do what I needed—without pulling in a full Firebase/Serverless/PostgreSQL setup. It’s old-school, but reliable.

💸 The Actual Cost

Here’s the real breakdown:

Service Cost
Cloudflare Pages $0
EC2 (t3.micro) ~$8/month
Domain name Already owned
DB/Storage Handled on EC2 (tiny volume)

Could I go cheaper? Yes:

  • Ditch EC2 and use Cloudflare Workers or Vercel Edge Functions

  • Move auth to Clerk/Auth0 (free tiers available)

  • Use client-side PDF generation with html2pdf.js or jsPDF (with quality tradeoffs)

But EC2 kept me in full control and let me skip learning yet another platform.

🏗️ Lessons from the Build

1. Start static, scale dynamic

I built the entire frontend as a static React app before wiring up any backend. Cloudflare Pages made it stupidly easy to deploy and test changes. Even with backend features now, the frontend still deploys independently.

2. PDF generation is trickier than it looks

Client-side libraries are great for MVPs, but if you want consistency across browsers and control over page layout, server-side tools like pdfkit are worth the effort.

3. Auth doesn’t need to be fancy

I skipped magic links, OAuth, and social login. Just bcrypt-hashed passwords + sessions. Boring, secure, and works across devices.

4. React is overkill until it’s not

This could’ve been built with vanilla JS… until I added features like draft saving, invoice previews, and quick item inputs. At that point, React’s state model and component abstraction saved a ton of time.

5. Minimal doesn’t mean messy

The app has no tracking, no upsells, and no bloat. But it still feels polished thanks to small UX touches: instant preview, one-click PDF, simple item entry. You don’t need 100 features to feel "complete."

🧰 Tools That Made Life Easier

  • React + Vite for dev speed

  • Cloudflare Pages for dead-simple deploys

  • EC2 for backend logic

  • pdfkit for clean PDF rendering

  • Plain CSS + minimal color for fast load and print-friendly design

✅ Final Thoughts

This wasn’t a startup idea, it was a technical exercise:
How far can you push a modern stack while keeping it lean, low-cost, and useful?

I’m still iterating on it, but building InvoiceDen reminded me that you don’t need a whole platform or team to make something real.

If you’ve been sitting on a tool you’ve wanted to build, I say skip the boilerplate and just get something working. Then polish it until it’s fun.

Top comments (0)