{"id":30172889,"url":"https://github.com/domsen123/mrx-nuxt-template","last_synced_at":"2025-08-11T23:18:10.647Z","repository":{"id":307079330,"uuid":"1028229013","full_name":"domsen123/mrx-nuxt-template","owner":"domsen123","description":"🚀 Starter Project for Nuxt4 with better-auth and postgresql.","archived":false,"fork":false,"pushed_at":"2025-08-05T12:04:29.000Z","size":900,"stargazers_count":36,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-05T14:18:09.616Z","etag":null,"topics":["better-auth","docker","nuxtjs","postgres","starter-template"],"latest_commit_sha":null,"homepage":"","language":"Vue","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/domsen123.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-07-29T08:09:52.000Z","updated_at":"2025-08-05T12:19:06.000Z","dependencies_parsed_at":"2025-07-29T10:51:36.596Z","dependency_job_id":"17e2d43f-2a18-4261-a5f7-93a8c57a26b0","html_url":"https://github.com/domsen123/mrx-nuxt-template","commit_stats":null,"previous_names":["domsen123/mrx-nuxt-template"],"tags_count":4,"template":true,"template_full_name":null,"purl":"pkg:github/domsen123/mrx-nuxt-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domsen123%2Fmrx-nuxt-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domsen123%2Fmrx-nuxt-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domsen123%2Fmrx-nuxt-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domsen123%2Fmrx-nuxt-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/domsen123","download_url":"https://codeload.github.com/domsen123/mrx-nuxt-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domsen123%2Fmrx-nuxt-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269970135,"owners_count":24505476,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["better-auth","docker","nuxtjs","postgres","starter-template"],"created_at":"2025-08-11T23:18:04.874Z","updated_at":"2025-08-11T23:18:10.614Z","avatar_url":"https://github.com/domsen123.png","language":"Vue","funding_links":[],"categories":["Vue"],"sub_categories":[],"readme":"# Nuxt 4 + Better-Auth Starter Template\n\nA modern, production-ready starter template for building authenticated web applications with Nuxt 4 and Better-Auth. This template provides a complete authentication system with TypeScript, PostgreSQL, and a beautiful UI powered by Nuxt UI Pro.\n\n## 🚀 Features\n\n### Authentication \u0026 Security\n- 🔐 **Better-Auth Integration** - Modern authentication library with session management\n- 👤 **Complete Auth Flow** - Registration, login, logout, and session persistence\n- 🔑 **Password Reset** - Built-in password reset functionality (⚠️ currently logs to console - see configuration)\n- 🛡️ **Role-Based Access Control** - Admin roles and permissions\n- 🔒 **Secure Sessions** - HTTP-only cookies with 7-day persistence\n- 🚫 **User Management** - Ban/suspension system built-in\n\n### Tech Stack\n- ⚡ **Nuxt 4** - Latest version with full TypeScript support\n- 🎨 **Nuxt UI Pro** - Premium UI components library\n- 🗄️ **Drizzle ORM** - Type-safe database queries\n- 🐘 **PostgreSQL** - Robust database with Docker support\n- 📦 **Pinia** - State management with auth store\n- 🎯 **TypeScript** - Full type safety across the stack\n\n### Developer Experience\n- 🐳 **Docker Compose** - One-command database setup\n- 🔧 **Drizzle Studio** - Visual database management\n- 📝 **ESLint \u0026 TypeScript** - Code quality tools pre-configured\n- 🎭 **Multiple Layouts** - Separate auth and app layouts\n- 🌙 **Dark Mode** - Built-in color mode support\n\n## 📋 Prerequisites\n\n- Node.js 18+ and pnpm\n- Docker and Docker Compose (for PostgreSQL)\n- PostgreSQL (if not using Docker)\n\n## 🛠️ Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003cyour-repo-url\u003e\n   cd mrx-nuxt\n   ```\n\n2. **Install dependencies**\n   ```bash\n   pnpm install\n   ```\n\n3. **Set up environment variables**\n   ```bash\n   cp .env.example .env\n   ```\n\n   Update the `.env` file with your configuration:\n   ```env\n   NUXT_SITE_NAME=\"Your App Name\"\n   NUXT_SITE_ENV=\"development\"\n   NUXT_SITE_URL=\"http://localhost:3000\"\n   NUXT_DATABASE_URL=\"postgresql://user:password@localhost:5432/dbname\"\n   NUXT_AUTH_SECRET=\"your-secret-key\"\n   NUXT_SESSION_SECRET=\"your-session-secret\"\n   NUXT_ADMIN_EMAIL=\"admin@example.com\"\n   NUXT_ADMIN_PASSWORD=\"optional-secure-password\"  # Optional - random password generated if not set\n   ```\n\n4. **Start the database**\n   ```bash\n   pnpm docker:up\n   ```\n\n5. **Push the database schema**\n   ```bash\n   pnpm db:push\n   ```\n\n6. **Start the development server**\n   ```bash\n   pnpm dev\n   ```\n\n   Visit `http://localhost:3000` to see your app running!\n\n## 📁 Project Structure\n\n```\nmrx-nuxt/\n├── app/                    # Frontend application\n│   ├── assets/            # CSS and static assets\n│   ├── composables/       # Vue composables\n│   │   └── useAuthClient.ts  # Auth client composable\n│   ├── layouts/           # App layouts\n│   │   ├── auth.vue      # Auth pages layout\n│   │   └── default.vue   # Main app layout\n│   ├── middleware/        # Route middleware\n│   │   ├── is-authenticated.global.ts\n│   │   └── is-admin.ts\n│   ├── pages/             # Application pages\n│   │   ├── auth/         # Auth pages (login, register)\n│   │   ├── admin.vue     # Admin dashboard\n│   │   └── index.vue     # Home page\n│   ├── plugins/          # Nuxt plugins\n│   └── stores/           # Pinia stores\n│       └── auth.store.ts # Auth state management\n├── server/                # Backend API\n│   ├── api/              # API routes\n│   ├── config/           # Server configuration\n│   ├── database/         # Database schema\n│   │   └── schema.ts     # Drizzle schema definition\n│   ├── guards/           # Auth guards\n│   ├── middleware/       # Server middleware\n│   └── utils/            # Server utilities\n│       └── auth.ts       # Better-Auth configuration\n└── shared/               # Shared types and utilities\n```\n### Database Commands\n\n```bash\n# Start PostgreSQL with Docker\npnpm docker:up\n\n# Stop PostgreSQL\npnpm docker:down\n\n# Push schema changes\npnpm db:push\n\n# Open Drizzle Studio (database GUI)\npnpm db:studio\n```\n\n## 🎨 UI Components\n\nThis template uses **Nuxt UI Pro** for premium components. Key features:\n\n- Beautiful, accessible components\n- Dark mode support out of the box\n- Responsive design\n- Form components with validation\n- Toast notifications\n- Modal dialogs\n- And much more!\n\n## 🤖 Claude AI Agent Support\n\nThis project is pre-configured for Claude AI agent development with the following features:\n\n- **`.claude` directory** - Contains Claude-specific configuration and memory files\n- **`.mcp.json`** - Model Context Protocol configuration for enhanced AI interactions\n- **`./agent/**`** - Dedicated directory for AI agent-related code and utilities\n\nFeel free to utilize these resources for building AI-powered features:\n- Claude memory management and context persistence\n- Custom agent workflows and integrations\n- MCP tool configurations for extended capabilities\n\nThese files are optional and can be removed if you're not using Claude AI features.\n\n## 🚀 Deployment\n\n### Environment Variables\n\nEnsure all required environment variables are set in production:\n\n```env\nNUXT_SITE_NAME=\"Your Production App\"\nNUXT_SITE_ENV=\"production\"\nNUXT_SITE_URL=\"https://yourdomain.com\"\nNUXT_DATABASE_URL=\"your-production-db-url\"\nNUXT_AUTH_SECRET=\"strong-random-secret\"\nNUXT_SESSION_SECRET=\"another-strong-secret\"\n```\n\n### Build for Production\n\n```bash\n# Build the application\npnpm build\n\n# Preview production build\npnpm preview\n```\n\n## 📝 Scripts\n\n```bash\npnpm dev          # Start development server\npnpm build        # Build for production\npnpm preview      # Preview production build\npnpm typecheck    # Run TypeScript type checking\npnpm lint         # Run ESLint\npnpm lint:fix     # Fix ESLint issues\npnpm db:push      # Push database schema\npnpm db:studio    # Open Drizzle Studio\npnpm docker:up    # Start PostgreSQL container\npnpm docker:down  # Stop PostgreSQL container\n\n# Development utilities\npnpm exec -- tsx scripts/fake-seeder.ts  # Generate 100 fake users for testing\n```\n\n## 🔧 Configuration\n\n### Nuxt Config\n\nThe `nuxt.config.ts` file is pre-configured with:\n- TypeScript support\n- Nuxt UI Pro\n- SEO module\n- Authentication setup\n- Database integration\n\n### Better-Auth Config\n\nAuthentication is configured in `/server/utils/auth.ts` with:\n- Email/password authentication\n- Admin plugin for roles\n- Drizzle adapter\n- Session management\n- ULID for unique IDs\n- Password reset functionality\n\n⚠️ **Important Note on Password Reset**:\nThe password reset functionality in `/server/utils/auth.ts` currently logs reset links to the console (lines 16-17). This is intended for development only. For production, you must:\n\n1. Replace the `sendResetPassword` function to send actual emails:\n   ```typescript\n   sendResetPassword: async ({ url, user }) =\u003e {\n     // TODO: Implement email sending\n     // Example: await sendEmail(user.email, 'Password Reset', url)\n   }\n   ```\n\n2. Configure an email service (SendGrid, Postmark, AWS SES, etc.)\n3. Remove the console.log statements to prevent security risks\n\n### Admin User Creation\n\nFirst registered user is automatically set as admin. Check better-auth hook on `/server/utils/auth.ts` for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📄 License\n\nThis project is licensed under the MIT License.\n\n## 🙏 Acknowledgments\n\n- [Nuxt](https://nuxt.com) - The Intuitive Vue Framework\n- [Better-Auth](https://better-auth.com) - Modern Authentication for Full-Stack Apps\n- [Drizzle ORM](https://orm.drizzle.team) - TypeScript ORM\n- [Nuxt UI Pro](https://ui.nuxt.com/pro) - Premium Vue Components\n\n---\n\nBuilt with ❤️ using Nuxt 4 and Better-Auth\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomsen123%2Fmrx-nuxt-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomsen123%2Fmrx-nuxt-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomsen123%2Fmrx-nuxt-template/lists"}