Scalable Content Engine w/ Notion & Next.js

Executive Summary: I architected and built a reusable, scalable content engine that transforms Notion from a simple document editor into a powerful, fully-featured headless CMS. By solving the Notion API's inherent limitations around data structure and routing, I created a system capable of powering dynamic websites with complex, nested content hierarchies. The success of this engineering effort led to the development of a prototype micro-SaaS, demonstrating a clear path from technical solution to commercial product.
While Notion is an excellent tool for content creation, its API presents significant challenges for developers seeking to use it as a true headless CMS for a dynamic website:
- No Native Routing: The API provides no system for defining or fetching a website's page structure. All routes must be hardcoded by a developer.
- Flat Data Structure: The API cannot natively represent hierarchical content (e.g., a "Projects" section containing individual project pages).
- Inefficient Data Fetching: Building a single, complex page often requires multiple, chained API calls to assemble disparate content "blocks," leading to performance bottlenecks and brittle code.
I engineered a multi-part solution in Next.js and Node.js to systematically solve each of these challenges.
- Dynamic Routing System: I designed a "master routing table" within Notion. My Next.js application fetches this table on build, dynamically generating all site routes without a single hardcoded path. This allows a content creator to add a new page to the website simply by adding a new row in a Notion database.
- Hierarchical Content Parser: To enable folder-like nesting, I implemented a recursive parsing function. This function intelligently detects when a Notion table entry links to another table, allowing it to traverse the "tree" and build a complete site map. It can generate pages for
domain.com/projects/
anddomain.com/projects/project-a/
entirely from the Notion database structure.
- Packaging for Reusability & Productization: Recognizing the value of this solution, my focus shifted to productization. I began refactoring the core logic into a self-contained package. The goal is to create a streamlined SDK that any developer could drop into a Next.js project to instantly connect to their Notion workspace.
- Prototyping a Micro-SaaS: To validate the market demand for this solution, I designed and deployed a waitlist landing page for a potential micro-business. This service would offer a hosted solution for users wanting to serve websites directly from their Notion or Discord content, demonstrating my ability to think beyond code and toward business impact.
- Front-End: Next.js (utilizing Static Site Generation with a roadmap for ISR), React-Notion-Render
- Backend Logic & Scripting: Node.js (for pre-build data fetching, image persistence, and parsing logic)
- API Integration: Notion API
- Deployment: Netlify
This project successfully transformed Notion into a viable, scalable headless CMS. It proves that with the right engineering and architecture, the limitations of a platform can be overcome to create immense value.
The immediate next step is to finalize the reusable package for public release. Following that, I will use the data from the waitlist prototype to evaluate the next stage of development for the micro-SaaS venture. My portfolio remains the primary prototype.