How I Built a Modern Web App: Learning Next.js & Headless CMS Approach

How I Built a Modern Web App: Learning Next.js & Headless CMS Approach

Introduction

I'm always trying to learn and improve my craft, and web development has many tools and frameworks to choose from. So I decided to build a real-world project to master new tools.

My goal was simple yet ambitious: create an elegant platform to read and explore Shakespeare's plays, from Hamlet to A Midsummer Night's Dream. I wanted to learn by doing, using a real-world project, Dreamweaver, to master new tools. The app needed to be content-rich but flexible, allowing me to iterate as I learned.

The Vision: Shakespeare Meets Modern Tech

To bring Dreamweaver to life, I selected a modern, scalable stack:

  • Next.js & React: For a dynamic, server-rendered frontend that's fast and SEO-friendly.

  • TypeScript: To ensure type safety and make scaling easier.

  • Firebase: For a serverless backend handling authentication, hosting, and Firestore for data.

  • Genkit (with Gemini): To experiment with generative AI, adding interactive flair.

This stack balances power and simplicity, perfect for a solo developer diving into new territory.

Building a Headless Foundation

I started by storing all content—play texts, timeline events, and UI labels—in JSON files in an internal directory, creating a content repository and using Next.js API routes to serve this data as a delivery layer. React components, like my main app and themes page, fetched and rendered this data, forming the "head" of the app.

Why Headless? The Aha Moment

My realisation came when I stepped back and saw the bigger picture. This setup mirrored a headless CMS: content stored separately, delivered via APIs, and rendered flexibly by the frontend.

  • Flexibility: The same API could power a mobile app or VR experience without changing the content.

  • Scalability: Adding new plays or features didn't require rewriting the presentation layer.

  • Learning Value: It forced me to think deeply about data organisation and API design early on.

This approach is gaining traction, with platforms like Optimizely or Contentful. However, my JSON-based system is lightweight and developer-friendly, though it lacks an administration.

The First Version

The initial app was basic: a list of plays (comedies, tragedies, histories, romances) with a simple reading view. The headless setup made it easy to tweak the frontend without altering the content, letting me focus on learning rather than wrestling with data.

Takeaways and Next Steps

This headless foundation accelerated my learning and set Dreamweaver up for scalability. Key lessons:

  • Separating content and presentation simplifies iteration.

  • JSON files can act as a lightweight "database" for small projects.

  • Real-world projects make learning tech meaningful.

Conclusion

By using Shakespeare as my testbed, I discovered how approachable headless architecture can be for solo projects. What started as an experiment in Next.js and Firebase grew into a flexible, CMS-like system that can scale far beyond its initial concept. Sometimes the best way to learn isn't by following tutorials but by building something that inspires you.

Next in this series

Stay tuned for Part 2, where I'll explore UX challenges and AI integrations

Further Reading

Mor from me


Original Article: Read on LinkedIn | Read on Substack

#WebDevelopment #Next.js #Firebase #GenerativeAI #HeadlessCMS #SelfTaughtDev