In the previous chapter, Content Structure - Research & Papers, we explored the academic roots of prompt engineering. We looked at the contentβthe text, the guides, and the citations.
Now, we are going to look behind the curtain. How does a folder full of text files turn into a beautiful, searchable, and interactive website?
Welcome to Chapter 9: The Technical Stack.
If the content is the "soul" of this project, the Technical Stack is the "body." It is the software machinery that builds the website you see in your browser.
Imagine you want to create a website with 100 pages of documentation.
The Problem:
If you wrote raw HTML code for every page (<div class="sidebar">...</div>), it would take forever. If you wanted to change the sidebar color, you would have to edit 100 different files.
The Solution: We use a Technical Stackβa combination of tools that act like a factory.
This project is built on four main technologies. Think of them as a construction team.
website.com/guide).Let's look at how this stack makes life easy for a contributor.
Goal: Add a new chapter called "Robots" to the website.
How the Stack works: You don't need to write any website code. You just create a file.
robots.md inside the pages/ folder.# Robots
Robots are cool.
Because of Next.js and Nextra:
prompt-guide.com/robots.You focused on the content; the stack handled the engineering.
Next.js is a "React Framework." In simple terms, it takes pieces of code (components) and assembles them into a website.
Its most important feature for us is File-System Routing.
pages/ folder, it becomes a web page.If your folder looks like this:
pages/
βββ index.md -> Becomes the Homepage
βββ about.md -> Becomes /about
Next.js does the heavy lifting to make those links work instantly.
Next.js is generic (it can build e-commerce sites, blogs, etc.). Nextra is what makes this project look like a documentation site.
Nextra is a "theme" for Next.js. It adds:
.md and .mdx files.Nextra allows us to use MDX. This is Markdown with superpowers. You can put interactive code inside your text.
// This is an MDX file
# Hello World
Here is a counter button:
<button onClick={() => alert('Clicked!')}>
Click Me
</button>
Nextra turns that <button> code into a real, clickable button on the documentation page.
How do we make the text blue or the background gray? We use Tailwind CSS.
In traditional web design, you write a separate stylesheet. In Tailwind, you write the style directly on the element.
/* style.css */
.my-button {
background-color: blue;
color: white;
padding: 10px;
}
// No separate file needed!
<button className="bg-blue-500 text-white p-2">
Click Me
</button>
bg-blue-500: Make background blue.text-white: Make text white.p-2: Add padding.This makes it very easy to tweak the design of the guide without breaking things elsewhere.
When a user visits the Prompt Engineering Guide, what happens inside the server?
Here is the flow from the moment you request a page to when you see it.
Let's look at the configuration that ties these tools together. The heart of this technical stack is a file called next.config.js.
This file tells Next.js: "Please use the Nextra plugin."
next.config.js (Simplified)// 1. Import the Nextra plugin
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
})
// 2. Export the configuration
module.exports = withNextra({
// Next.js specific settings go here
reactStrictMode: true,
})
Explanation:
require('nextra'): We load the tool.theme: 'nextra-theme-docs': We tell it to look like a documentation site.module.exports: We tell Next.js to use these settings.
You will notice files ending in .tsx (like theme.config.tsx). This means we are using TypeScript.
TypeScript is just JavaScript with "Rules."
const add = (a, b) => a + b (If a is a word, this crashes).const add = (a: number, b: number) (The computer warns you if a is not a number).This ensures that when we configure the project, we don't make silly spelling mistakes that break the site.
In this chapter, we learned about the Technical Stack that powers the Prompt Engineering Guide.
.md), and the stack handles the rest.Now that we know what tools we are using, how do we control them? How do we change the logo, the title, or the footer links?
Next Chapter: Configuration Files
Generated by Code IQ