This is a boilerplate project for building web applications using Next.js, Prisma, PostgreSQL, Shadcn/ui, Google & GitHub auth, and Next Auth v5. It provides a solid foundation for developing modern and scalable web applications.
- Next.js 14 with TypeScript: The latest version of Next.js, a popular React framework for building full-stack applications, with TypeScript support for enhanced type checking and developer productivity.
- Prisma: A modern database toolkit that simplifies database access and management.
- PostgreSQL: A powerful open-source relational database management system.
- Shadcn/ui: A UI component library for creating beautiful and responsive user interfaces.
- Google Login: Integration with Google authentication for user login and authorization.
- GitHub Login: Integration with GitHub authentication for user login and authorization.
- Next Auth v5: A flexible authentication library for Next.js applications.
To get started with this boilerplate, follow the steps below:
- Clone the repository to your local machine:
git clone https://github.com/ahmedibra28/nextjs-typescript-auth-boilerplate.git
- Install the dependencies:
cd nextjs-typescript-auth-boilerplate
pnpm install
- Set up the environment variables:
Create a .env
file in the root directory of the project and add the following variables:
# PostgreSQL database configuration
DATABASE_URL=your-database-connection
AUTH_SECRET=your-auth-secret
# Google Login configuration
AUTH_GOOGLE_ID=your-google-client-id
AUTH_GOOGLE_SECRET=your-google-client-secret
# GitHub Login configuration
AUTH_GITHUB_ID=your-github-client-id
AUTH_GITHUB_SECRET=your-github-client-secret
- Set up the database:
npx prisma migrate dev
- Start the development server:
pnpm dev
The project structure is organized as follows:
├── components/ # Reusable React components
├── app/ # Next.js app router
├── prisma/ # Prisma database schema and migrations
├── public/ # Publicly accessible files (e.g., images)
├── styles/ # CSS stylesheets
├── .env # Environment variables
└── next.config.ts # Next.js configuration
└── tsconfig.json # TypeScript configuration
Feel free to modify the folder structure to fit your project's needs.
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License.
Happy coding!