This is a monorepo setup with Turborepo and Cloudflare Pages for deploying NextJS applications. It also includes a shared tailwindcss
configuration and a shared eslint
configuration.
-
To get this project files locally on your machine, you can clone this repository by running the following command on your terminal or command line:
git clone https://github.com/Saurav-Pant/Starter-Kit.git
-
Install all the dependency packages found in the
package.json
files across the monorepo apps by runningnpm install
from the project root directory. -
To start the development servers of all the applications in your monorepo in parallel, simply run
npm run dev
.
A sample documentation Next.js app.
NextJS on Cloudflare Pages setup with Drizzle ORM and Cloudflare D1.
-
To create a database on D1, run:
npx wrangler d1 create <dbName>
-
Add the necessary configuration to the
wrangler.toml
file which you get while running above command. -
To initialize the DB:
- Locally:
npx wrangler d1 execute <dbName> --file=src/db/seed.sql --local
- Remotely:
npx wrangler d1 execute <dbName> --file=src/db/seed.sql --remote
- Locally:
-
Run:
npm run cf-typegen
-
In
drizzle.config.ts
, update with your DB Name and URL, then run:npx drizzle-kit introspect
-
To Deploy on Cloudflare Pages:
npm run deploy
Shared tailwindcss
and eslint
configurations.
tsconfig.json
s which can be used by extending them throughout the monorepo.
Shared UI components with ShadCN implementation.