Skip to Content
Browse all templates at capricorn.build β†’
Next.jsGetting StartedProject Structure

Understanding Your Template Files

Let’s look at the common file structure used across Capricorn Next.js templates.

Standard Project Structure

All Capricorn templates follow a consistent, organized structure:

      • globals.css
      • layout.tsx
      • page.tsx
    • package.json
    • next.config.ts

Core Folders Explained

πŸ“ app/ β€” Your Pages

This is where all your website pages live using Next.js App Router.

File/FolderPurpose
globals.cssGlobal styles, theme colors, CSS variables
layout.tsxRoot layout (header, footer, providers)
page.tsxHomepage
(routes)/Route groups containing your pages

Note: Folders in parentheses like (marketing) are β€œroute groups” β€” they organize files but don’t appear in URLs.

πŸ“ components/ β€” Building Blocks

Reusable React components organized by purpose:

FolderContains
forms/Form components (contact, booking, newsletter)
layout/Site structure (Header, Footer)
sections/Page-specific sections organized by page
shared/Reusable components (cards, heroes, etc.)
ui/Base UI elements (Button, Input, Accordion, etc.)

πŸ“ config/ β€” Site Settings

Centralized configuration files:

FilePurpose
site.config.tsBusiness info (name, contact, social links)
navigation.config.tsMenu structure and links
seo.config.tsDefault SEO settings

πŸ’‘ Tip: Edit site.config.ts first β€” it’s the quickest way to personalize your template.

πŸ“ content/ β€” Your Content

Where your actual content lives. This may include:

  • MDX files (.mdx) β€” For pages with rich content (blog posts, services, etc.)
  • TypeScript files (.ts) β€” For structured data (team, testimonials, pricing, etc.)

See your specific template documentation for exact content structure.

πŸ“ lib/ β€” Utilities

Helper functions and utilities:

FilePurpose
utils.tsCommon helper functions (className merging, formatting)
types/Shared TypeScript type definitions

Some templates may include additional utilities for content loading (like MDX processing).

πŸ“ public/ β€” Static Files

Static assets served directly:

public/ β”œβ”€β”€ images/ # Your images β”‚ β”œβ”€β”€ blog/ β”‚ β”œβ”€β”€ team/ β”‚ └── ... β”œβ”€β”€ fonts/ # Custom fonts (if any) └── favicon.ico # Site favicon

Reference these files with absolute paths: /images/your-image.jpg

What to Edit vs. What Not to Touch

βœ… Edit Often

LocationWhat to Change
config/site.config.tsYour business info
content/All your content
public/images/Your images
app/globals.cssColors and theme

βœ… Edit Sometimes

LocationWhat to Change
config/navigation.config.tsMenu items
components/Component customizations
app/layout.tsxSite-wide changes

⚠️ Edit Carefully

LocationWhy Be Careful
lib/Core utilities β€” may break functionality
next.config.tsBuild configuration

❌ Don’t Touch

LocationWhy
node_modules/Auto-generated dependencies
.next/Build cache (auto-generated)
package-lock.jsonDependency lock file

Understanding Dynamic Routes

Folders with [slug] or [id] are dynamic routes:

app/ β”œβ”€β”€ blog/ β”‚ β”œβ”€β”€ page.tsx β†’ /blog (listing) β”‚ └── [slug]/ β”‚ └── page.tsx β†’ /blog/any-post-name (dynamic)

The bracketed part gets replaced with actual values from your content.

Hot Module Replacement

When you save a file:

  1. Next.js detects the change automatically
  2. Your browser updates without full reload
  3. You see changes instantly

This makes development fast and iterative!

Quick Reference

I want to…Look in…
Change business infoconfig/site.config.ts
Change colors/themeapp/globals.css
Change navigationconfig/navigation.config.ts
Add/edit contentcontent/
Add imagespublic/images/
Modify a componentcomponents/

Template-Specific Structure

Each template may have additional folders or different content organization. See your specific template documentation:


Next: Customizing Your Template β†’

Last updated on