{"id":29408776,"url":"https://github.com/ytdev/next-auth-starter","last_synced_at":"2025-07-11T03:07:34.987Z","repository":{"id":302934832,"uuid":"1008643798","full_name":"YTDev/Next-Auth-Starter","owner":"YTDev","description":"Next.js 15 template with Auth.js (NextAuth.js v5), Prisma ORM, PostgreSQL, and Shadcn UI","archived":false,"fork":false,"pushed_at":"2025-07-04T20:30:38.000Z","size":288,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-04T21:31:16.777Z","etag":null,"topics":["authjs","neon","nextjs","postgresql","prisma-orm","shadcn","tailwindcss"],"latest_commit_sha":null,"homepage":"https://authx-starter.vercel.app/","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/YTDev.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-06-25T21:43:56.000Z","updated_at":"2025-07-04T20:30:41.000Z","dependencies_parsed_at":"2025-07-04T21:31:19.157Z","dependency_job_id":"31dbe648-cdb9-4fb7-a6dc-9b412eea4e20","html_url":"https://github.com/YTDev/Next-Auth-Starter","commit_stats":null,"previous_names":["ytdev/next-auth-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YTDev/Next-Auth-Starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YTDev%2FNext-Auth-Starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YTDev%2FNext-Auth-Starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YTDev%2FNext-Auth-Starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YTDev%2FNext-Auth-Starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YTDev","download_url":"https://codeload.github.com/YTDev/Next-Auth-Starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YTDev%2FNext-Auth-Starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264719240,"owners_count":23653542,"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","neon","nextjs","postgresql","prisma-orm","shadcn","tailwindcss"],"created_at":"2025-07-11T03:07:33.948Z","updated_at":"2025-07-11T03:07:34.969Z","avatar_url":"https://github.com/YTDev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Next.js OAuth Starter Template\n\nA modern, production-ready Next.js 15 template with **Auth.js (NextAuth.js v5)**, **Prisma ORM**, **PostgreSQL**, and **Shadcn UI**. Perfect for building secure, scalable web applications with OAuth authentication.\n\n![Next.js](https://img.shields.io/badge/Next.js-15.3.4-black?style=for-the-badge\u0026logo=next.js)\n![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue?style=for-the-badge\u0026logo=typescript)\n![Auth.js](https://img.shields.io/badge/Auth.js-5.0--beta.29-green?style=for-the-badge\u0026logo=auth.js)\n![Prisma](https://img.shields.io/badge/Prisma-6.11.1-2D3748?style=for-the-badge\u0026logo=prisma)\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-13+-336791?style=for-the-badge\u0026logo=postgresql)\n\n## ✨ Features\n\n- 🔐 **OAuth Authentication** - Google, GitHub, and Discord providers\n- 🎨 **Modern UI** - Shadcn UI components with Tailwind CSS v4\n- 🗄️ **Database** - Prisma ORM with PostgreSQL (Neon)\n- 🔄 **Account Linking** - Automatic linking of multiple OAuth providers\n- 🌙 **Dark Mode** - Built-in theme switching\n- 📱 **Responsive Design** - Mobile-first approach\n- ⚡ **Performance** - Next.js 15 with Turbopack\n- 🛡️ **Type Safety** - Full TypeScript support\n- 🚀 **Production Ready** - Optimized for Vercel deployment\n  \n## ⚡ Performance\n\nThis template is built with performance in mind, achieving excellent Lighthouse scores:\n\n![Lighthouse Performance](https://github.com/YTDev/Next-Auth-Starter/blob/f0fc5a77e4186ff70a37fb5dcfb27ef4ffb4dcb6/screenshot.png)\n\n### 🎯 Lighthouse Scores\n\n| Category           | Score   |\n| ------------------ | ------- |\n| **Performance**    | 100/100 |\n| **Accessibility**  | 100/100 |\n| **Best Practices** | 100/100 |\n| **SEO**            | 100/100 |\n\n## 🏗️ Architecture\n\n```\n├── app/                    # Next.js 15 App Router\n│   ├── (auth)/            # Authentication routes\n│   ├── (dashboard)/       # Protected dashboard routes\n│   └── (marketing)/       # Public marketing pages\n├── components/            # Reusable UI components\n│   ├── ui/               # Shadcn UI components\n│   └── providers/        # Context providers\n├── lib/                  # Utility functions\n├── prisma/              # Database schema and migrations\n└── types/               # TypeScript type definitions\n```\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Node.js 18+\n- PostgreSQL database (Neon recommended)\n- OAuth app credentials for Google, GitHub, and/or Discord\n\n### 1. Clone and Install\n\n```bash\ngit clone https://github.com/YTDev/Next-Auth-Starter.git\ncd next-auth-starter\nnpm install\n```\n\n### 2. Environment Setup\n\nCreate a `.env.local` file in the root directory:\n\n```env\n# Database\nDATABASE_URL=\"postgresql://username:password@host:port/database\"\n\n# Auth.js\nAUTH_SECRET=\"your-super-secret-key-here\"\nAUTH_URL=\"http://localhost:3000\"\n\n# OAuth Providers\nGOOGLE_CLIENT_ID=\"your-google-client-id\"\nGOOGLE_CLIENT_SECRET=\"your-google-client-secret\"\n\nGITHUB_CLIENT_ID=\"your-github-client-id\"\nGITHUB_CLIENT_SECRET=\"your-github-client-secret\"\n\nDISCORD_CLIENT_ID=\"your-discord-client-id\"\nDISCORD_CLIENT_SECRET=\"your-discord-client-secret\"\n\n# Site Configuration\nNEXT_PUBLIC_SITE_URL=\"http://localhost:3000\"\n```\n\n### 3. Database Setup\n\n```bash\n# Generate Prisma client\nnpx prisma generate\n\n# Run database migrations\nnpx prisma db push\n\n# (Optional) Open Prisma Studio\nnpx prisma studio\n```\n\n### 4. Start Development Server\n\n```bash\nnpm run dev\n```\n\nVisit [http://localhost:3000](http://localhost:3000) to see your app!\n\n## 🔧 OAuth Provider Setup\n\n### Google OAuth\n\n1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n2. Create a new project or select existing one\n3. Enable Google+ API\n4. Create OAuth 2.0 credentials\n5. Add authorized redirect URI: `http://localhost:3000/api/auth/callback/google`\n\n### GitHub OAuth\n\n1. Go to [GitHub Developer Settings](https://github.com/settings/developers)\n2. Create a new OAuth App\n3. Set Authorization callback URL: `http://localhost:3000/api/auth/callback/github`\n\n### Discord OAuth\n\n1. Go to [Discord Developer Portal](https://discord.com/developers/applications)\n2. Create a new application\n3. Add OAuth2 redirect: `http://localhost:3000/api/auth/callback/discord`\n\n## 📁 Project Structure\n\n### Key Files\n\n- `app/api/auth/[...nextauth]/route.ts` - Auth.js configuration\n- `prisma/schema.prisma` - Database schema\n- `components/auth-card.tsx` - Authentication UI component\n- `app/(dashboard)/dashboard/page.tsx` - Protected dashboard\n- `middleware.ts` - Route protection middleware\n\n## 🎨 Customization\n\n### Adding New OAuth Providers\n\n1. Install the provider package (if needed)\n2. Add provider configuration in `app/api/auth/[...nextauth]/route.ts`\n3. Add environment variables\n4. Update the UI components\n\n### Styling\n\nThe template uses Tailwind CSS v4 with Shadcn UI components. Customize by:\n\n- Modifying `tailwind.config.ts`\n- Updating component variants in `components/ui/`\n- Adding custom CSS in `app/globals.css`\n\n### Database Changes\n\n```bash\n# After modifying schema.prisma\nnpx prisma generate\nnpx prisma db push\n```\n\n## 🚀 Deployment\n\n### Vercel (Recommended)\n\n1. Push your code to GitHub\n2. Connect your repository to Vercel\n3. Set environment variables in Vercel dashboard\n4. Deploy!\n\n### Environment Variables for Production\n\n```env\n# Update AUTH_URL to your production domain\nAUTH_URL=\"https://your-domain.vercel.app\"\n\n# Update OAuth redirect URIs\n# Google: https://your-domain.vercel.app/api/auth/callback/google\n# GitHub: https://your-domain.vercel.app/api/auth/callback/github\n# Discord: https://your-domain.vercel.app/api/auth/callback/discord\n```\n\n### Database Migration\n\n```bash\n# For production database\nnpx prisma db push\n```\n\n## 🔒 Security Features\n\n- **CSRF Protection** - Built into Auth.js\n- **Session Management** - Secure session handling\n- **Account Linking** - Automatic linking of multiple providers\n- **Environment Variables** - Secure credential management\n- **Type Safety** - Prevents runtime errors\n\n## 🛠️ Development Scripts\n\n```bash\nnpm run dev          # Start development server with Turbopack\nnpm run build        # Build for production\nnpm run start        # Start production server\nnpm run lint         # Run ESLint\n```\n\n## 📚 Learning Resources\n\n- [Next.js Documentation](https://nextjs.org/docs)\n- [Auth.js Documentation](https://authjs.dev/)\n- [Prisma Documentation](https://www.prisma.io/docs)\n- [Shadcn UI Documentation](https://ui.shadcn.com/)\n- [Tailwind CSS Documentation](https://tailwindcss.com/docs)\n\n## 🤝 Contributing\n\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## 🙏 Acknowledgments\n\n- [Auth.js](https://authjs.dev/) for authentication\n- [Shadcn UI](https://ui.shadcn.com/) for components\n- [Prisma](https://www.prisma.io/) for database ORM\n- [Vercel](https://vercel.com/) for hosting\n\n---\n\n**Built with ❤️ by YTDev**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytdev%2Fnext-auth-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fytdev%2Fnext-auth-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytdev%2Fnext-auth-starter/lists"}