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