This project was generated using the Stapler CLI. It sets up a fullstack monorepo with Next.js, Supabase, Payload CMS, and more, leveraging Turbo and pnpm to streamline your development workflow.
- apps/web: This is the main frontend for your project. Built with Next.js, it also optionally integrates Payload CMS for content management.
- apps/docs: This could serve as your project's documentation site or any other static content site.
- supabase: Contains the configuration and code for Supabase, which serves as your project's backend (database, authentication, and API).
- packages: Shared utilities, TypeScript configurations, ESLint rules, and UI components that can be reused across different apps.
Ensure that you have the following installed on your machine:
- Node.js (version >= 16)
- pnpm (package manager)
- Supabase CLI
- GitHub CLI (for repo management)
To install all the necessary dependencies across the monorepo, run:
pnpm install
To start the web
app (frontend):
cd apps/web
pnpm dev
This will launch the Next.js frontend on http://localhost:3000
.
To start the documentation site (if configured):
cd apps/docs
pnpm dev
This will run the documentation app at http://localhost:3001
.
To start the backend server with Supabase:
cd supabase
supabase start
This will launch Supabase services locally, including the database and API.
Next.js and Supabase environment variables are automatically stored in the .env
file in the project's root folder.
Payload CMS environment variables are generated in apps/web
.
The monorepo uses Turbo to manage and speed up tasks across different apps. To see the available tasks, run:
pnpm turbo run
You can execute tasks like building, linting, or testing across all apps simultaneously. Linting
To lint the entire project with ESLint:
pnpm lint
To create a production build of the project:
pnpm build
Refer to the ARCHITECTURE document for an in-depth overview of the project structure.
You can extend the project by:
-
Adding new apps: Create a new directory in apps/ and set up another service (e.g., a mobile app).
To add your own
packages
andapps
, run:pnpm turbo gen workspace
-
Adding Payload CMS collections: Modify the
payload.config.ts
file inapps/web
to add new content types. -
Customizing Supabase: Write custom SQL queries or functions in Supabase.