This project showcases user authentication using AuthJS v5, Typescript, Prisma(PostgreSql), Shadcn/UI, and Tailwind CSS.
Make sure you have the following installed before running the project:
Clone the repository:
git clone https://github.com/khoido2003/Next-Auth-Example.git
cd Next-Auth-Example
Install dependencies:
npm install
Set up your environment variables:
Create a .env.local
file in the root directory and add the following:
DATABASE_URL=""
DIRECT_URL=""
AUTH_SECRET=''
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Add other necessary environment variables for Prisma and NextAuth
Run database migrations:
npx prisma migrate dev
Start the development server:
npm run dev
The application will be available at http://localhost:3000
.
pages/
: Next.js pagespublic/
: Static assetsstyles/
: Global styles and Tailwind CSS configurationscomponents/
: Reusable React componentsprisma/
: Prisma database schema and configurationsTo learn more about Next.js, take a look at the following resources:
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.