Based on
This project combines two templates from the Strapi and Next.js communities, plus custom modifications that allow you to build pages via Strapi without writing code for each page.
A Next.js + TypeScript boilerplate using Auth.js for authentication, with user data persisted to PostgreSQL via Auth.js's @auth/drizzle-adapter. Unlike the original Docker-based template, this version runs locally against any PostgreSQL instance you provide.
-
Clone the repository:
git clone https://github.com/yourusername/yourproject.git cd yourproject -
Install dependencies:
cd ./next-js npm installand
cd ./strapi #nvm use 20 (RECOMMENDED! need to install nvm) npm install npx strapi ts:generate-types
-
Configure environment:
- Create a
.env.localfile (ignored by Git) for storing secrets:cp .env .env.local
- Edit
.env.localwith your own values (e.g., database connection string, Auth.js secret, OAuth credentials).
- Create a
-
Run the dev server:
npm run dev #in next-jsand
npm run develop #in strapiThen visit http://localhost:3000.
You can use any PostgreSQL instance (local or remote). For local development, install PostgreSQL on your machine and update the connection URL in your .env.local:
DATABASE_URL=postgresql://user:password@localhost:5432/mydb
- Dynamic Zones
Define your dynamic-zone fields in Strapi for each page. For example, you might have a “Hero” block, a “Card” block, etc.
- Start local dev:
npm run dev
- Build for production:
npm run build
- Run migrations (Drizzle):
Adjust your Drizzle config as needed in
npx drizzle-kit up
drizzle.config.ts.
- Strapi LaunchPad – for providing an excellent base to integrate Strapi quickly.
- Next.js + Auth.js + Drizzle Starter – for the authentication and Drizzle integration setup.
We combined and modified these templates to create our own boilerplate, tailored to our needs.
This project inherits licenses from the original templates. Please refer to their respective repositories for details on license terms:
Happy coding! If you run into any issues or have suggestions, feel free to open an issue or submit a pull request.
