{"id":17965938,"url":"https://github.com/lskeey/next-auth-v5","last_synced_at":"2026-04-09T09:33:54.488Z","repository":{"id":258923229,"uuid":"875642667","full_name":"lskeey/next-auth-v5","owner":"lskeey","description":"Authentication solution for Next.js apps, providing seamless and secure user login with NextAuth.js v5.","archived":false,"fork":false,"pushed_at":"2024-11-02T13:56:44.000Z","size":729,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T08:42:06.348Z","etag":null,"topics":["authjs","nextjs","postgresql","shadcn-ui","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lskeey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-20T14:20:37.000Z","updated_at":"2024-11-02T13:56:48.000Z","dependencies_parsed_at":"2024-10-26T09:39:46.108Z","dependency_job_id":"492006a3-a4ac-49a2-9009-a2a7846ea785","html_url":"https://github.com/lskeey/next-auth-v5","commit_stats":{"total_commits":48,"total_committers":1,"mean_commits":48.0,"dds":0.0,"last_synced_commit":"5f3fa5c2c332c6d3510c87e6569a9810de43c377"},"previous_names":["lskeey/next-auth-v5"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lskeey%2Fnext-auth-v5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lskeey%2Fnext-auth-v5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lskeey%2Fnext-auth-v5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lskeey%2Fnext-auth-v5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lskeey","download_url":"https://codeload.github.com/lskeey/next-auth-v5/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247073014,"owners_count":20878980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authjs","nextjs","postgresql","shadcn-ui","tailwindcss"],"created_at":"2024-10-29T13:06:13.341Z","updated_at":"2025-12-30T23:09:06.880Z","avatar_url":"https://github.com/lskeey.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e🛡️ NEXT-AUTH-V5\u003c/h1\u003e\n  \u003cp\u003eSeamless Security, Limitless Possibilities\u003c/p\u003e\n\n  \u003cp\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/lskeey/next-auth-v5?style=flat-square\u0026color=black\" alt=\"Last Commit\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/typescript-97.6%25-blue?style=flat-square\u0026logo=typescript\u0026logoColor=white\" alt=\"TypeScript Percentage\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/languages/count/lskeey/next-auth-v5?style=flat-square\u0026color=black\" alt=\"Languages Count\"\u003e\n  \u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"./public/images/auth_login.png\" alt=\"Login Page\" width=\"600\" /\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003eBuilt with the tools and technologies:\u003c/p\u003e\n\n  \u003cp\u003e\n    \u003cimg src=\"https://img.shields.io/badge/json-white?style=flat-square\u0026logo=json\u0026logoColor=black\" alt=\"JSON\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/markdown-black?style=flat-square\u0026logo=markdown\u0026logoColor=white\" alt=\"Markdown\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/resend-black?style=flat-square\u0026logo=resend\u0026logoColor=white\" alt=\"Resend\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/npm-E32230?style=flat-square\u0026logo=npm\u0026logoColor=white\" alt=\"NPM\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/postcss-black?style=flat-square\u0026logo=postcss\u0026logoColor=white\" alt=\"PostCSS\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/javascript-F7DF1E?style=flat-square\u0026logo=javascript\u0026logoColor=black\" alt=\"JavaScript\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/react-61DAFB?style=flat-square\u0026logo=react\u0026logoColor=black\" alt=\"React\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/typescript-3178C6?style=flat-square\u0026logo=typescript\u0026logoColor=white\" alt=\"TypeScript\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/prisma-2D3748?style=flat-square\u0026logo=prisma\u0026logoColor=white\" alt=\"Prisma\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/zod-3E67A3?style=flat-square\u0026logo=zod\u0026logoColor=white\" alt=\"Zod\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/eslint-4B32C3?style=flat-square\u0026logo=eslint\u0026logoColor=white\" alt=\"ESLint\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/react%20hook%20form-EC5990?style=flat-square\u0026logo=reacthookform\u0026logoColor=white\" alt=\"React Hook Form\"\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nThis project is a robust, full-featured authentication system built with Next.js App Router and Next-Auth v5. It provides a modern, secure, and highly customizable foundation for your web applications, handling everything from user registration to multi-factor authentication.\n\n## ✨ Key Features\n\n-   **Credentials \u0026 Social Authentication**: Secure login via email and password, or seamlessly with Google and GitHub OAuth providers.\n-   **Email Verification**: A streamlined process to confirm new user accounts through email, enhancing security and preventing spam.\n-   **Password Reset**: Built-in functionality for users to securely reset their forgotten passwords.\n-   **Two-Factor Authentication (2FA)**: An extra layer of security with two-factor authentication, using an OTP sent to the user's email.\n-   **Role-Based Access Control**: Protect your routes and server actions based on user roles (Admin/User), ensuring proper authorization throughout your application.\n-   **Client \u0026 Server Component Protection**: Middleware protects routes from unauthorized access, both on the client and server sides.\n-   **Modern UI**: Beautiful and responsive design, crafted using **Shadcn/UI** and **Tailwind CSS**.\n\n\n## 🚀 Getting Started\n\nFollow these simple steps to get the project up and running on your local machine.\n\n### Prerequisites\n\n-   Node.js (\u003e= 18.17.0)\n-   PostgreSQL or another supported database for Prisma\n-   A **Resend** API key for sending emails.\n-   **Google** and **GitHub** OAuth client IDs and secrets for social logins.\n\n### Installation\n\n1.  **Clone the repository**:\n    ```bash\n    git clone https://github.com/lskeey/next-auth-v5.git\n    cd next-auth-v5\n    ```\n\n2.  **Install dependencies**:\n    ```bash\n    npm install\n    # or\n    yarn install\n    # or\n    pnpm install\n    ```\n\n3.  **Set up environment variables**:\n    Create a `.env` file at the root of the project and copy the contents from `.env.example`. Replace the placeholder values with your own keys.\n    ```env\n    # Prisma connection string\n    DATABASE_URL=\n\n    # Next-Auth secret\n    AUTH_SECRET=\n\n    # OAuth providers\n    GOOGLE_CLIENT_ID=\n    GOOGLE_CLIENT_SECRET=\n    GITHUB_CLIENT_ID=\n    GITHUB_CLIENT_SECRET=\n\n    # Resend API key for emails\n    RESEND_API_KEY=\n    ```\n\n4.  **Database Setup**:\n    Initialize and migrate your database using Prisma.\n    ```bash\n    npx prisma migrate dev\n    ```\n\n5.  **Run the development server**:\n    ```bash\n    npm run dev\n    ```\n    Open [http://localhost:3000](http://localhost:3000) in your browser.\n\n\n## 📂 Project Structure\n\n-   `actions/`: Server actions for handling authentication logic (e.g., login, register, reset).\n-   `app/`: Next.js App Router for all pages and API routes.\n-   `components/`: Reusable UI components including form wrappers, buttons, and user information displays.\n-   `data/`: Data access layer for interacting with the database using Prisma.\n-   `hooks/`: Custom React hooks for client-side state management, like fetching the current user or role.\n-   `lib/`: Core utility functions, including database connection, authentication helpers, and mailer setup.\n-   `prisma/`: Prisma schema and database configuration.\n-   `schemas/`: Zod schemas for form validation.\n\n\n## 🤝 Contribution\n\nContributions are welcome! If you'd like to improve this project, please feel free to open an issue or submit a pull request.\n\n\n## 📄 License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flskeey%2Fnext-auth-v5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flskeey%2Fnext-auth-v5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flskeey%2Fnext-auth-v5/lists"}