Repository Overview
The repository contains 7 numbered lesson folders, each representing a progressive step in building a SaaS product:Each folder is completely independent. You don’t need to run lessons in order, though it’s recommended for learning. Currently, lessons 1-3 have full implementations, while lessons 4-7 are placeholders for upcoming content.
Individual Lesson Structure
Every lesson follows the same file structure pattern. Here’s what you’ll find in each folder:Basic Lesson (01-hello-saas)
Advanced Lesson (03-tailwind-components)
Next.js 14 App Router Structure
The lessons use Next.js 14’s App Router (not the older Pages Router). Understanding this structure is crucial:File-Based Routing
Next.js automatically creates routes based on folder structure:Root Layout (app/layout.js)
Every app has a root layout that wraps all pages:app/layout.js
Components Directory
Reusable components are stored inapp/components/:
app/components/Navbar.js
Components in
app/components/ are not routes. Only page.js files create routes.API Routes
API endpoints are created inapp/api/ with route.js files:
Configuration Files
package.json
Defines dependencies and npm scripts:tailwind.config.js (Lessons 3+)
Configures Tailwind CSS styling:Common Patterns Across Lessons
Consistent File Naming
page.js- Route pageslayout.js- Layout wrappersroute.js- API endpoints- Component files use PascalCase:
Navbar.js,Footer.js
Progressive Complexity
Each lesson builds on concepts from previous ones:Lesson 4: Auth & Database
Introduces
lib/ for utilities, models/ for database schemas, and api/ routesUnderstanding the App Directory
Theapp/ directory is the heart of every Next.js 14 application:
Why is everything in app/?
Why is everything in app/?
Next.js 14 uses the App Router architecture. The
app/ directory contains all routes, layouts, and page components. This is different from older Next.js versions that used a pages/ directory.What's the difference between app/ and components/?
What's the difference between app/ and components/?
- app/ - Contains routes and pages (files here become URLs)
- app/components/ - Contains reusable UI components (not routes)
app/pricing/page.js→ Creates/pricingURLapp/components/Navbar.js→ Reusable component, not a URL
Can I create my own folders in app/?
Can I create my own folders in app/?
Yes! You can organize code however you like:
app/utils/for utility functionsapp/hooks/for custom React hooksapp/styles/for CSS files
page.js become routes.Next Steps
Now that you understand the structure, learn how to:Run Lessons
Start any lesson and begin coding
Customize Lessons
Adapt lessons for your own SaaS idea