{"id":30228235,"url":"https://github.com/dakdevs/kiro-devhack","last_synced_at":"2025-08-14T19:39:41.836Z","repository":{"id":308119674,"uuid":"1031604946","full_name":"dakdevs/kiro-devhack","owner":"dakdevs","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-12T05:44:45.000Z","size":111101,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"production","last_synced_at":"2025-08-12T06:28:46.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"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/dakdevs.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-08-04T04:10:19.000Z","updated_at":"2025-08-12T05:44:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"e42f2678-08d9-4437-9c22-f50d1e8174bb","html_url":"https://github.com/dakdevs/kiro-devhack","commit_stats":null,"previous_names":["dakdevs/kiro-devhack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dakdevs/kiro-devhack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakdevs%2Fkiro-devhack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakdevs%2Fkiro-devhack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakdevs%2Fkiro-devhack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakdevs%2Fkiro-devhack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dakdevs","download_url":"https://codeload.github.com/dakdevs/kiro-devhack/tar.gz/refs/heads/production","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakdevs%2Fkiro-devhack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270474737,"owners_count":24590069,"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-14T02:00:10.309Z","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":[],"created_at":"2025-08-14T19:39:39.060Z","updated_at":"2025-08-14T19:39:41.827Z","avatar_url":"https://github.com/dakdevs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Better Profile App\n\nA Next.js application with authentication powered by Better Auth, PostgreSQL database with pgvector support, and modern tooling.\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- **Node.js** (v18 or higher)\n- **pnpm** (v10.14.0 or higher) - This project uses pnpm as the package manager\n- **Docker** and **Docker Compose** - For running the PostgreSQL database\n- **Google OAuth App** - For authentication (see setup instructions below)\n\n## Quick Start\n\n### 1. Clone and Install Dependencies\n\n```bash\ngit clone \u003crepository-url\u003e\ncd better-profile-app\npnpm install\n```\n\n### 2. Environment Configuration\n\n**⚠️ CRITICAL: You must create a `.env.local` file before running the application.**\n\nCopy the example environment file and configure it:\n\n```bash\ncp .env.local.example .env.local\n```\n\nGenerate a secure secret for Better Auth:\n\n```bash\n# Generate a random 32-character base64 secret\nopenssl rand -base64 32\n```\n\nCopy the output and use it as your `BETTER_AUTH_SECRET` value.\n\nEdit `.env.local` with your actual values:\n\n```bash\n# Better Auth Configuration\nBETTER_AUTH_SECRET=\"your-super-secret-key-here\"  # Generate using: openssl rand -base64 32\nBETTER_AUTH_URL=\"http://localhost:3000\"\n\n# Google OAuth (REQUIRED - see setup instructions below)\nGOOGLE_CLIENT_ID=\"your-google-client-id\"\nGOOGLE_CLIENT_SECRET=\"your-google-client-secret\"\n\n# PostgreSQL Database Configuration (can keep defaults for local development)\nPOSTGRES_DB=\"myapp\"\nPOSTGRES_USER=\"postgres\"\nPOSTGRES_PASSWORD=\"password\"\nDATABASE_URL=\"postgresql://postgres:password@localhost:5432/myapp\"\n```\n\n### 3. Google OAuth Setup\n\nTo enable authentication, you need to create a Google OAuth application:\n\n1. Go to the [Google Cloud Console](https://console.cloud.google.com/)\n2. Create a new project or select an existing one\n3. Enable the Google+ API\n4. Go to \"Credentials\" → \"Create Credentials\" → \"OAuth 2.0 Client IDs\"\n5. Set application type to \"Web application\"\n6. Add authorized redirect URIs:\n   - `http://localhost:3000/api/auth/callback/google`\n7. Copy the Client ID and Client Secret to your `.env.local` file\n\n### 4. Start the Application\n\nThe easiest way to start everything:\n\n```bash\npnpm dev\n```\n\nThis command will:\n- Start the PostgreSQL database with Docker Compose\n- Run the Next.js development server with Turbopack\n\nAlternatively, you can run components separately:\n\n```bash\n# Start only the database\npnpm run dev:db\n\n# Start only the Next.js app (in another terminal)\npnpm run dev:app\n```\n\n### 5. Database Setup\n\nThe database will automatically start with Docker, but you may need to run migrations:\n\n```bash\n# Generate migration files (if schema changes)\npnpm run db:generate\n\n# Apply migrations to database\npnpm run db:migrate\n\n# Or push schema directly (for development)\npnpm run db:push\n```\n\n**⚠️ Important**: Always use `pnpm run db:generate` to create migrations. Never create manual SQL migration files. All schema changes should be made in `src/db/schema.ts` and then generate migrations using drizzle-kit.\n\n### 6. Access the Application\n\n- **Application**: http://localhost:3000\n- **Database Studio**: `pnpm run db:studio` (opens Drizzle Studio)\n\n## Available Scripts\n\n| Command | Description |\n|---------|-------------|\n| `pnpm dev` | Start database and Next.js app |\n| `pnpm run dev:db` | Start only PostgreSQL database |\n| `pnpm run dev:app` | Start only Next.js application |\n| `pnpm build` | Build the application for production |\n| `pnpm start` | Start production server |\n| `pnpm lint` | Run ESLint |\n| `pnpm run db:stop` | Stop the database |\n| `pnpm run db:generate` | Generate database migrations |\n| `pnpm run db:migrate` | Run database migrations |\n| `pnpm run db:push` | Push schema to database |\n| `pnpm run db:studio` | Open Drizzle Studio |\n\n## Project Structure\n\n```\n├── src/\n│   ├── app/                 # Next.js App Router pages\n│   ├── components/          # React components\n│   ├── config/             # Configuration files\n│   ├── db/                 # Database schema and utilities\n│   └── lib/                # Utility libraries\n├── drizzle/                # Database migrations\n├── public/                 # Static assets\n├── .env.local.example      # Environment variables template\n└── docker-compose.yml      # PostgreSQL database setup\n```\n\n## Technology Stack\n\n- **Framework**: Next.js 15 with App Router\n- **Authentication**: Better Auth\n- **Database**: PostgreSQL with pgvector extension\n- **ORM**: Drizzle ORM\n- **Styling**: Tailwind CSS\n- **Package Manager**: pnpm\n- **Development**: Turbopack, ESLint, TypeScript\n\n## Troubleshooting\n\n### Database Connection Issues\n\nIf you encounter database connection errors:\n\n1. Ensure Docker is running\n2. Check if PostgreSQL container is healthy: `docker ps`\n3. Verify environment variables in `.env.local`\n4. Restart the database: `pnpm run db:stop \u0026\u0026 pnpm run dev:db`\n\n### Authentication Issues\n\n1. Verify Google OAuth credentials in `.env.local`\n2. Check that redirect URIs match in Google Cloud Console\n3. Ensure `BETTER_AUTH_SECRET` is set and sufficiently random\n\n### Port Conflicts\n\nIf port 3000 or 5432 is already in use:\n- For Next.js: `pnpm run dev:app -- -p 3001`\n- For PostgreSQL: Modify the port mapping in `docker-compose.yml`\n\n## Environment Variables Reference\n\n| Variable | Required | Description | Example |\n|----------|----------|-------------|---------|\n| `BETTER_AUTH_SECRET` | ✅ | Secret key for auth encryption | `\"random-32-char-string\"` |\n| `BETTER_AUTH_URL` | ✅ | Base URL of your application | `\"http://localhost:3000\"` |\n| `GOOGLE_CLIENT_ID` | ✅ | Google OAuth Client ID | `\"123456789.apps.googleusercontent.com\"` |\n| `GOOGLE_CLIENT_SECRET` | ✅ | Google OAuth Client Secret | `\"GOCSPX-abcdef123456\"` |\n| `DATABASE_URL` | ✅ | PostgreSQL connection string | `\"postgresql://user:pass@localhost:5432/db\"` |\n| `POSTGRES_DB` | ⚠️ | Database name (for Docker) | `\"myapp\"` |\n| `POSTGRES_USER` | ⚠️ | Database user (for Docker) | `\"postgres\"` |\n| `POSTGRES_PASSWORD` | ⚠️ | Database password (for Docker) | `\"password\"` |\n\n**✅ Required**: Must be set for the application to work  \n**⚠️ Docker**: Used by Docker Compose, can keep defaults for local development\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Run tests and linting\n5. Submit a pull request\n\n## License\n\nThis project is private and proprietary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdakdevs%2Fkiro-devhack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdakdevs%2Fkiro-devhack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdakdevs%2Fkiro-devhack/lists"}