Getting Started

Project Structure

Understand the SaaSKit project structure and organization

structure organization

Project Structure

Understanding the project structure will help you navigate and customize SaaSKit effectively.

Directory Overview

astro-saas-landing-kit/
β”œβ”€β”€ public/              # Static assets
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/      # Reusable components
β”‚   β”œβ”€β”€ content/         # Content collections
β”‚   β”œβ”€β”€ layouts/         # Page layouts
β”‚   β”œβ”€β”€ pages/           # Route pages
β”‚   β”œβ”€β”€ styles/          # Global styles
β”‚   β”œβ”€β”€ utils/           # Utility functions
β”‚   └── config.ts        # Site configuration
β”œβ”€β”€ astro.config.mjs     # Astro configuration
β”œβ”€β”€ tailwind.config.mjs  # Tailwind configuration
└── package.json         # Dependencies

Key Directories

/public

Static files served as-is:

  • Images (/images/)
  • Favicon (/favicon.svg)
  • robots.txt
  • Any other static assets

/src/components

Reusable components organized by type:

components/
β”œβ”€β”€ backgrounds/    # Background components
β”œβ”€β”€ heros/         # Hero section variants
β”œβ”€β”€ sections/      # Content sections
β”œβ”€β”€ Header.astro   # Site header
β”œβ”€β”€ Footer.astro   # Site footer
└── ...

Component Types:

  • .astro - Astro components (server-rendered)
  • .tsx - React components (client-side interactivity)

/src/content

Content collections using Astro’s content system:

content/
β”œβ”€β”€ blog/          # Blog posts
β”‚   └── *.md
└── docs/          # Documentation
    β”œβ”€β”€ getting-started/
    β”œβ”€β”€ components/
    β”œβ”€β”€ guides/
    └── api/

/src/layouts

Page layout templates:

  • BaseLayout.astro - Main layout with header/footer

/src/pages

File-based routing. Each file becomes a route:

  • index.astro β†’ /
  • about.astro β†’ /about
  • blog.astro β†’ /blog
  • blog/[...slug].astro β†’ /blog/* (dynamic)

/src/styles

Global styles:

  • global.css - Global styles and Tailwind directives

/src/utils

Utility functions:

  • images.ts - Image helper functions

File Naming Conventions

Pages

  • Use kebab-case: about-us.astro
  • Dynamic routes: [...slug].astro or [id].astro

Components

  • PascalCase: HeroSection.tsx or HeroSection.astro
  • Descriptive names

Content

  • kebab-case: getting-started.md
  • Organized in folders by category

Configuration Files

astro.config.mjs

Astro framework configuration:

  • Integrations (React, Tailwind, etc.)
  • Site URL
  • Build options

tailwind.config.mjs

Tailwind CSS configuration:

  • Theme customization
  • Color palette
  • Typography
  • Plugins

tsconfig.json

TypeScript configuration:

  • Compiler options
  • Path aliases
  • Type definitions

Import Paths

Absolute Imports

import Component from '../components/Component';

Content Collections

import { getCollection } from 'astro:content';
const posts = await getCollection('blog');

Config

import { siteConfig } from '../config';

Best Practices

  1. Organize by Feature - Group related components
  2. Reusable Components - Keep components generic
  3. Consistent Naming - Follow naming conventions
  4. Type Safety - Use TypeScript interfaces
  5. Documentation - Comment complex logic

Next Steps


Structure understood! You’re ready to navigate the codebase. πŸ—ΊοΈ