A Next.js starter template to help you build scalable, modern web applications. This template includes:
- Authentication via NextAuth.js with support for email/password and Google provider.
- Database Integration: Prisma ORM with PostgreSQL.
- Code Quality Tools: Prettier and ESLint pre-configured for consistent code formatting and linting.
- Authentication: Email/password and Google provider integrated with NextAuth.js.
- Prisma ORM: Database integration with PostgreSQL.
- Prettier: Automatic code formatting.
- ESLint: Linting to ensure clean, error-free code.
Ensure you have the following installed on your machine:
- Node.js (LTS version recommended)
- pnpm
- PostgreSQL: Make sure you have a running PostgreSQL instance.
- Prisma CLI (Optional for Prisma setup)
git clone https://github.com/abhishek-shivale/nextjs-starter
cd nextjs-starter
Using pnpm:
pnpm install
Create a .env.local
file in the root of your project and add the following values:
# Database
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public"
# Google OAuth
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
# Authentication
NEXTAUTH_SECRET=""
NEXTAUTH_URL=""
Replace placeholders with your own credentials:
- For PostgreSQL: Set
USER
,PASSWORD
,HOST
,PORT
, andDATABASE
to match your PostgreSQL setup.- For Google OAuth: Set
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
from the Google Cloud Console.
Run the following command to generate the Prisma client and migrate the database:
pnpm prisma migrate dev
pnpm prisma generate
This will apply any pending migrations to your PostgreSQL database and generate the Prisma client for querying the database.
pnpm dev
Visit http://localhost:3000 in your browser.
- Users can sign up or log in using their email and password.
- Integrated via NextAuth.js. Make sure to configure
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
in.env.local
.
- The project uses Prisma ORM for interacting with a PostgreSQL database.
- Make sure your database is set up correctly and the
DATABASE_URL
in.env.local
is configured.
pnpm prettier
pnpm lint
pnpm lint:fix
Feel free to fork, submit issues, or create pull requests. Contributions are always welcome!
This project is licensed under the MIT License.