{"id":28497028,"url":"https://github.com/akdevv/next-auth-starter","last_synced_at":"2025-07-02T21:32:04.833Z","repository":{"id":292900691,"uuid":"981640718","full_name":"akdevv/next-auth-starter","owner":"akdevv","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-23T09:34:36.000Z","size":10895,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T10:33:21.037Z","etag":null,"topics":[],"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/akdevv.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,"zenodo":null}},"created_at":"2025-05-11T15:13:16.000Z","updated_at":"2025-06-23T09:34:40.000Z","dependencies_parsed_at":"2025-05-12T18:45:36.361Z","dependency_job_id":"e6a1ce90-7a36-42ba-b815-19526d55bbda","html_url":"https://github.com/akdevv/next-auth-starter","commit_stats":null,"previous_names":["akdevv/next-auth-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akdevv/next-auth-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akdevv%2Fnext-auth-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akdevv%2Fnext-auth-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akdevv%2Fnext-auth-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akdevv%2Fnext-auth-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akdevv","download_url":"https://codeload.github.com/akdevv/next-auth-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akdevv%2Fnext-auth-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263218204,"owners_count":23432445,"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":[],"created_at":"2025-06-08T12:32:01.591Z","updated_at":"2025-07-02T21:32:04.781Z","avatar_url":"https://github.com/akdevv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Next Auth Starter\n\nA production-ready Next.js authentication starter with modern features, comprehensive security, and excellent developer experience.\n\n## ✨ Features\n\n### 🔐 Authentication \u0026 Security\n- **Multiple Auth Methods**: Email/password, Google OAuth, magic links\n- **Two-Factor Authentication (2FA)**: TOTP with backup codes\n- **Session Management**: Secure sessions with device tracking\n- **Email Verification**: Automatic email verification flow\n- **Password Security**: bcrypt hashing with strength validation\n- **Rate Limiting**: Built-in protection against brute force attacks\n\n### 📧 Email System\n- **Transactional Emails**: Welcome, verification, password reset\n- **React Email Templates**: Beautiful, responsive email designs\n- **Security Notifications**: Login alerts and suspicious activity\n- **Resend Integration**: Reliable email delivery service\n\n### 🛡️ Advanced Security\n- **CSRF Protection**: Built-in cross-site request forgery protection\n- **Secure Headers**: Comprehensive security headers configuration\n- **Input Validation**: Zod schemas for type-safe validation\n- **Audit Logging**: Complete authentication event tracking\n\n### 👤 User Management\n- **Profile Management**: User profiles with avatar support\n- **Device Management**: View and revoke active sessions\n- **Account Recovery**: Multiple recovery options including backup codes\n- **Account Deletion**: GDPR-compliant data removal\n\n## 🎯 Why This Project?\n\nBuilding authentication from scratch is complex, time-consuming, and security-critical. This starter provides:\n\n- ✅ **Production-ready** authentication flows\n- ✅ **Security best practices** built-in\n- ✅ **Modern tech stack** with excellent DX\n- ✅ **Comprehensive documentation** and examples\n- ✅ **Type-safe** development experience\n- ✅ **Scalable architecture** for growth\n\n## 🛠️ Tech Stack\n\n### Core Framework\n- **[Next.js 15](https://nextjs.org/)** - React framework with App Router\n- **[TypeScript](https://www.typescriptlang.org/)** - Type-safe JavaScript\n- **[React 19](https://react.dev/)** - Latest React with concurrent features\n\n### Authentication \u0026 Security  \n- **[NextAuth.js v5](https://next-auth.js.org/)** - Complete authentication solution\n- **[Prisma](https://www.prisma.io/)** - Type-safe database ORM\n- **[PostgreSQL](https://www.postgresql.org/)** - Robust relational database\n- **[bcrypt](https://github.com/kelektiv/node.bcrypt.js)** - Password hashing\n- **[otplib](https://github.com/yeojz/otplib)** - 2FA/TOTP implementation\n\n### UI \u0026 Styling\n- **[shadcn/ui](https://ui.shadcn.com/)** - Beautiful, accessible React components\n- **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework\n- **[Radix UI](https://www.radix-ui.com/)** - Unstyled, accessible UI primitives\n- **[Lucide React](https://lucide.dev/)** - Beautiful \u0026 consistent icons\n\n### Email \u0026 Communication\n- **[Resend](https://resend.com/)** - Modern email API\n- **[React Email](https://react.email/)** - React components for emails\n\n### Development Tools\n- **[Bun](https://bun.sh/)** - Fast JavaScript runtime \u0026 package manager\n- **[ESLint](https://eslint.org/)** - Code linting and quality\n- **[Zod](https://zod.dev/)** - TypeScript-first schema validation\n\n## 🚀 Quick Start\n\n### Prerequisites\n- **Node.js 18+** or **Bun**\n- **PostgreSQL** database (we recommend [Supabase](https://supabase.com/))\n- **Google Cloud Console** account (for OAuth)\n- **Resend** account (for emails)\n\n### 1. Clone \u0026 Install\n\n```bash\ngit clone https://github.com/akdevv/next-auth-starter.git\ncd next-auth-starter\n\n# Install dependencies (recommended: use Bun)\nbun install\n# or npm install\n```\n\n### 2. Environment Setup\n\n```bash\n# Copy environment template\ncp .env.example .env\n\n# Fill in your environment variables\n# See docs for detailed setup: /docs/getting-started/environment-variables\n```\n\nRequired environment variables:\n```env\nNEXT_PUBLIC_BASE_URL=\"http://localhost:3000\"\nAUTH_SECRET=\"your-secret-key\"\nDATABASE_URL=\"your-postgresql-url\"\nGOOGLE_CLIENT_ID=\"your-google-client-id\"\nGOOGLE_CLIENT_SECRET=\"your-google-client-secret\"\nNEXT_PUBLIC_RESEND_API_KEY=\"your-resend-api-key\"\n```\n\n### 3. Database Setup\n\n```bash\n# Generate Prisma client\nbun prisma generate\n\n# Push schema to database\nbun prisma db push\n\n# (Optional) Seed database\nbun prisma db seed\n```\n\n### 4. Start Development\n\n```bash\nbun dev\n```\n\nVisit [http://localhost:3000](http://localhost:3000) - your auth system is ready! 🎉\n\n## 📖 Documentation\n\nComplete documentation is available at `/docs` when running the project:\n\n- **[Getting Started](/docs/getting-started)** - Setup and configuration\n- **[Authentication](/docs/auth)** - Auth flows and security\n- **[Database](/docs/database)** - Schema and migrations  \n- **[Security Features](/docs/security-features)** - Security implementations\n- **[Additional Concepts](/docs/additional)** - Educational resources\n\n## 🛠️ Development\n\n### Available Scripts\n\n```bash\n# Development\nbun dev              # Start development server with Turbopack\nbun build            # Build for production\nbun start            # Start production server\nbun lint             # Run ESLint\n\n# Database\nbun prisma studio    # Open database browser\nbun prisma migrate   # Run migrations\nbun prisma generate  # Generate Prisma client\nbun prisma reset     # Reset database\n\n# Email Development\nbun email            # Preview emails locally\n```\n\n### Project Structure\n\n```\nnext-auth-starter/\n├── app/                 # Next.js App Router\n│   ├── api/            # API routes\n│   ├── auth/           # Authentication pages\n│   └── profile/        # User profile pages\n├── components/         # React components\n│   ├── auth/          # Auth-specific components\n│   ├── ui/            # shadcn/ui components\n│   └── shared/        # Shared components\n├── content/           # Documentation (MDX)\n├── emails/            # Email templates\n├── lib/               # Utilities and configurations\n├── prisma/            # Database schema and migrations\n├── server/            # Server actions and utilities\n└── schema/            # Zod validation schemas\n```\n\n## 🔐 Security Features\n\n- **🛡️ CSRF Protection** - Built-in token validation\n- **🔒 Session Security** - Secure cookie-based sessions\n- **⚡ Rate Limiting** - Prevent brute force attacks\n- **📧 Email Verification** - Verify email ownership\n- **🔐 2FA Support** - TOTP with QR codes\n- **🔑 Backup Codes** - Emergency account recovery\n- **🚨 Security Alerts** - Login notifications\n- **🔄 Session Management** - Multi-device session control\n\n## 🌟 Production Ready\n\nThis starter includes production-ready features:\n\n- **Performance Optimized** - Server-side rendering, code splitting\n- **SEO Friendly** - Meta tags, structured data\n- **Accessibility** - WCAG compliant components  \n- **Mobile Responsive** - Works on all devices\n- **Error Handling** - Graceful error boundaries\n- **Monitoring Ready** - Built-in logging and analytics hooks\n\n## 🚀 Deployment\n\nDeploy to your favorite platform:\n\n### Vercel (Recommended)\n```bash\nvercel deploy\n```\n\n### Docker\n```bash\ndocker build -t next-auth-starter .\ndocker run -p 3000:3000 next-auth-starter\n```\n\n### Other Platforms\n- **Netlify** - Static export support\n- **Railway** - Database included\n- **AWS/GCP/Azure** - Serverless functions\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Setup\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- [NextAuth.js](https://next-auth.js.org/) for authentication\n- [shadcn/ui](https://ui.shadcn.com/) for beautiful components\n- [Vercel](https://vercel.com/) for hosting and platform\n- [Supabase](https://supabase.com/) for database infrastructure\n\n## 📞 Support\n\n- 📖 **Documentation**: Visit `/docs` in your running project\n- 💬 **Issues**: [GitHub Issues](https://github.com/akdevv/next-auth-starter/issues)\n- 🐛 **Bug Reports**: Use issue templates\n- 💡 **Feature Requests**: Open a discussion\n\n---\n\nBuilt with ❤️ by the community. Star ⭐ if this project helped you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakdevv%2Fnext-auth-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakdevv%2Fnext-auth-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakdevv%2Fnext-auth-starter/lists"}