docs
Overview of Project Structure

Overview of Project Structure

πŸ’‘

In this chapter, we will go through the structure of the NextSaaS boilerplate and give you an overview of how modules and components are structured. After reading this chapter, you will have a good understanding of the boilerplate's structure.

Project Structure

NextSaaS boilerplate strictly follows the Next.js Project Structure (opens in a new tab). It's seamlessly integrated with NextAuth, Prisma, Nextra, and Stripe.

β”œβ”€β”€ node_modules
β”œβ”€β”€ prisma
β”‚   β”œβ”€β”€ db.sqlite          # SQLite database file
β”‚   └── schema.prisma      # Prisma schema definition
β”œβ”€β”€ public
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ app                # Application logic
β”‚   β”œβ”€β”€ assets             # Assets not exposed to the public
β”‚   β”œβ”€β”€ components         # React components used on pages
β”‚   β”œβ”€β”€ config             # NextSaaS configuration folder
β”‚   β”‚   β”œβ”€β”€ messages       # Provides messages based on user language
β”‚   β”‚   └── site.ts        # Configuration for NextSaaS boilerplate (site metadata, email, catalog, etc.)
β”‚   β”œβ”€β”€ emails             # React components for emails
β”‚   β”œβ”€β”€ lib                # Libraries (session, stripe, subscriptions, etc.)
β”‚   β”œβ”€β”€ pages              # Next.js pages directory
β”‚   β”œβ”€β”€ styles             # Styling
β”‚   β”œβ”€β”€ typings            # Typings definition
β”‚   β”œβ”€β”€ env.mjs            # Environment variables schema
β”‚   β”œβ”€β”€ middleware.ts      # Next.js middleware (handles redirects and rewrites based on user locale)
β”‚   └── dictionaries.ts    # Internationalization setup for Next.js
β”œβ”€β”€ .env.example           # Example environment file
β”œβ”€β”€ .eslintrc.cjs          # ESLint configuration
β”œβ”€β”€ .gitignore
β”œβ”€β”€ next-sitemap.config.js
β”œβ”€β”€ next.config.mjs        # Next.js and Nextra configuration
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.cjs
β”œβ”€β”€ prettier.config.cjs
β”œβ”€β”€ README.md
β”œβ”€β”€ tailwind.config.ts      # Tailwind configuration
β”œβ”€β”€ nextra-theme.config.tsx # Nextra theme configuration
└── tsconfig.json           # TypeScript configuration