A True Enterprise Jamstack CMS: Combining AEMaaCS and Next.js
I recently talked with many clients about Adobe Edge Delivery Services (EDS) and got mixed feedback. For some, it's a great fit, but others don't like the plain JavaScript front-end solution, making it harder for them to staff front-end developers. Also, from an architecture point of view, clients with high digital maturity prefer separating their CMS vendor from the experience/front-end layer and the CDN vendor. Therefore, I've decided to offer an alternative to EDS by combining the best enterprise CMS - Adobe Experience Manager as a Cloud Service (AEMaaCS), with the most popular front-end static site generation framework - Next.js.
For the demo we'll present later in this article, we've set four main goals to satisfy all important stakeholders:
- Top-performance and browsing experience for end-users: We want our site to be blazing fast, provide great user experience and search engine optimization (SEO) so it's highly ranked by search engines like Google
- WYSIWYG editing experience for authors: Even though we'll split the experience layer from the CMS, we still want editors to get instant, in-context previews for all edits they make before publishing them
- State-of-the-art frontend development experience: As an alternative to plain JavaScript used in EDS, we'll develop our front-end components with server-side React components and Next.js framework
- Flexible JAMstack architecture: Allowing clients to avoid vendor lock-in and choose the different state-of-the-art tools in the different architecture layers
So far we have not been able to build a CMS solution that satisfies all the four goals mentioned, so we had to prioritize. However, with the recent updates of Next.js and the introduction of Universal Editor in AEMaaCS, achieving all the goals mentioned became possible. Adobe's Universal Editor facilitates seamless integration with any type of frontend by relying on plain HTML data attributes and standardizing content delivery through APIs. This enables frontend developers to easily fetch content and build experiences in modern frameworks like React or Next.js. Throughout the rest of the article, we'll showcase a demo website and the solution from four different perspectives.

End-user Experience
First, let's take a look at the end-user browsing experience. For demo purposes, we've built a simple Meticulous Digital company website with three pages: Home, About Us, and Our Services. All pages are created using a few standard AEM-React server-side components delivered with Next.js: Header, Hero, Container, Teaser, Cards, and Footer. Building a website using these technologies provides excellent performance even on mobile devices with slow connections. Switching from one page to another is incredibly fast for end-users with no flickering effects.

The trick when using static site generation (SSG) frameworks like Next.js is to deliver the maximum amount of content server-side to achieve top performance. However, that doesn't mean we cannot add additional client-side, dynamic components like search. As long as we focus on delivering the content that the users see first and load the dynamic parts and third-party libraries later, our Google PageSpeed/Lighthouse performance results will remain top. In the Google PageSpeed results for our demo shown below, we can observe that we are hitting almost 100 in all categories. These results are comparable with the ones achieved by using Adobe Edge Delivery Services, with the additional benefit of having a developer-friendly and flexible architecture.

Editor Experience
Most editors like a WYSIWYG editing experience with an immediate, in-context preview of the changes made before publication. Therefore, we've decided on a hybrid CMS, instead of a full headless CMS setup for our demo. Adobe's new Universal Editor enables us to integrate and edit any type of front-end application. This is enabled through the integration of the front-end application and the editor using plain HTML. Therefore, we can load our Next.js application in the Universal Editor and benefit from in-context, instant preview, inline adding, as well as all standard editorial features like adding/deleting/copying components. Obviously, a bit of logic needs to be added in the Next.js application to support fetching content from two different AEM instances, author and publish. In the editor, we are fetching unpublished content from the AEM author instance. On the other hand, on the CDN, we are fetching only published content from the AEM publisher instance.

Developer Experience
Using Next.js and React provides a great front-end development experience, as our developers can leverage the OOTB components and built-in optimizations. All components are created with React and can be reused and organized with atomic principles and a design library in mind. The only addition to the React components to make them editable in the Universal Editor is a few HTML data attributes we need to define. Those attributes define the AEM path where to store the content, component type, and label used by the editor, as well as the model that defines the input fields and value types used.

JAMstack Architecture
Finally, let's explore our demo from an architecture point of view. A JAMstack architecture focuses on pre-building all HTML/JS files, so only a small percentage of user requests need to reach the backend servers. The pre-built content is pushed to a CDN like Vercel, Netlify, Akamai, or CloudFront to achieve maximum performance. However, a true JAMstack architecture also enables clients to choose different state-of-the-art solutions for their different layers. In our demo, we used AEMaaCS as CMS, Next.js as the static site generator, and Vercel's edge network for content delivery. However, this architecture approach allows us to choose different tools or replace them at a later stage. Therefore, we can avoid vendor lock-in across layers and keep our architecture future-proof and flexible.

Conclusion
In this article, we presented an AEMaaCS and Next.js hybrid CMS demo that focuses on solving four important goals for different stakeholders: end-users, editors, developers, and architects/business owners.
We've demonstrated how to achieve top performance, browsing experience, and SEO for end-users by leveraging Next.js static site generation capabilities. Then we showed how to enable the WYSIWYG editing experience for authors with instant, in-context previews by leveraging Adobe's Universal Editor. Finally, we looked at the developer-friendliness and architecture flexibility of the proposed approach, as an alternative to Edge Delivery Services.
In case you liked our demo and you're interested in a live demo session or discussion with our experts, please get in touch. At Meticulous Digital we provide truly independent technical consulting and we are always looking for innovative solutions that solve our client's pain points in the best possible way.


