{"id":48056171,"url":"https://github.com/sethdavis512/rapidalle","last_synced_at":"2026-04-04T14:27:57.186Z","repository":{"id":309151282,"uuid":"1035312095","full_name":"sethdavis512/rapidalle","owner":"sethdavis512","description":"React Router 7 + BetterAuth + Trigger.dev + Prisma - AI-powered image generation with DALL-E 3","archived":false,"fork":false,"pushed_at":"2025-08-30T15:55:53.000Z","size":330,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"dalle-trigger","last_synced_at":"2025-08-30T17:41:11.204Z","etag":null,"topics":["ai-image-generation","authentication","better-auth","dalle3","dark-mode","fullstack","openai","postgresql","prisma","react","react-router","react-router-7","ssr","tailwindcss","trigger-dev","typescript"],"latest_commit_sha":null,"homepage":null,"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/sethdavis512.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-10T05:51:13.000Z","updated_at":"2025-08-28T21:59:50.000Z","dependencies_parsed_at":"2025-08-30T17:41:16.686Z","dependency_job_id":"d5da972a-bc82-4006-9ec6-d82804311d19","html_url":"https://github.com/sethdavis512/rapidalle","commit_stats":null,"previous_names":["sethdavis512/tws-trigger-dev","sethdavis512/rapidalle"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sethdavis512/rapidalle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethdavis512%2Frapidalle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethdavis512%2Frapidalle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethdavis512%2Frapidalle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethdavis512%2Frapidalle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sethdavis512","download_url":"https://codeload.github.com/sethdavis512/rapidalle/tar.gz/refs/heads/dalle-trigger","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sethdavis512%2Frapidalle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ai-image-generation","authentication","better-auth","dalle3","dark-mode","fullstack","openai","postgresql","prisma","react","react-router","react-router-7","ssr","tailwindcss","trigger-dev","typescript"],"created_at":"2026-04-04T14:27:56.940Z","updated_at":"2026-04-04T14:27:57.131Z","avatar_url":"https://github.com/sethdavis512.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RapiDall•E\n\nA modern, full-stack AI-powered image generation platform built with React Router 7, BetterAuth, Trigger.dev, and Prisma.\n\n## ✨ Features\n\n- 🎨 **AI Typography \u0026 Art Generation** - Create stunning typography designs and artistic compositions with OpenAI's DALL-E 3\n- 🔐 **Complete Authentication** - Secure user accounts with BetterAuth\n- ⚡ **Real-time Updates** - Live task monitoring with Trigger.dev\n- 💳 **Credit System** - User-based credit management for generation limits\n- 🌙 **Dark Mode** - Comprehensive light/dark theme support\n- 📱 **Responsive Design** - Beautiful UI that works on all devices\n- 🚀 **Server-Side Rendering** - Fast, SEO-friendly React Router 7\n- 🗃️ **Type-Safe Database** - Prisma ORM with PostgreSQLA modern, full-stack AI-powered image generation platform built with React Router 7, BetterAuth, Trigger.dev, and Prisma.\n\n## ✨ Features\n\n- 🎨 **AI Image Generation** - Create stunning images with OpenAI's DALL-E 3\n- 🔐 **Complete Authentication** - Secure user accounts with BetterAuth\n- ⚡ **Real-time Updates** - Live task monitoring with Trigger.dev\n- 💳 **Credit System** - User-based credit management for generation limits\n- 🌙 **Dark Mode** - Comprehensive light/dark theme support\n- 📱 **Responsive Design** - Beautiful UI that works on all devices\n- 🚀 **Server-Side Rendering** - Fast, SEO-friendly React Router 7\n- �️ **Type-Safe Database** - Prisma ORM with PostgreSQL\n\n## 🛠️ Tech Stack\n\n### Frontend\n\n- **React Router 7** - Modern SSR framework with file-based routing\n- **React 19** - Latest React with concurrent features\n- **TypeScript** - Type-safe development\n- **TailwindCSS v4** - Utility-first styling with automatic dark mode\n- **Lucide React** - Beautiful, customizable icons\n\n### Backend\n\n- **Prisma** - Type-safe database ORM\n- **PostgreSQL** - Robust relational database\n- **BetterAuth** - Modern authentication with Prisma adapter\n- **Trigger.dev v3** - Background task processing and monitoring\n\n### AI \u0026 APIs\n\n- **OpenAI DALL-E 3** - State-of-the-art typography and art generation\n- **OpenAI GPT-4o** - Enhanced prompt processing and artistic captions\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Node.js 18+\n- PostgreSQL database\n- OpenAI API key\n- Trigger.dev account\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/sethdavis512/tws-trigger-dev.git\n   cd tws-trigger-dev\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables**\n\n   ```bash\n   cp .env.example .env\n   ```\n\n   Fill in your environment variables:\n\n   ```env\n   DATABASE_URL=\"postgresql://user:password@localhost:5432/rapidalle\"\n   OPENAI_API_KEY=\"your_openai_api_key\"\n   TRIGGER_SECRET_KEY=\"your_trigger_secret_key\"\n   ```\n\n4. **Set up the database**\n\n   ```bash\n   npx prisma migrate dev\n   npx prisma generate\n   ```\n\n### Development\n\nStart the development servers:\n\n```bash\n# Terminal 1: React Router dev server\nnpm run dev\n\n# Terminal 2: Trigger.dev dev server  \nnpm run trigger:dev\n```\n\nYour application will be available at `http://localhost:5173`.\n\n## 📁 Project Structure\n\n```text\n├── app/\n│   ├── lib/              # Auth configuration and utilities\n│   ├── models/           # Database operations (Prisma)\n│   ├── routes/           # Pages and API endpoints\n│   │   ├── authenticated.tsx  # Protected route layout\n│   │   ├── api/          # API routes\n│   │   └── ...\n│   ├── components/       # Reusable UI components\n│   └── ...\n├── trigger/\n│   └── generateContent.ts    # Background image generation task\n├── prisma/\n│   ├── schema.prisma     # Database schema\n│   └── migrations/       # Database migrations\n└── ...\n```\n\n## 🔐 Authentication\n\nThe app uses **BetterAuth** with email/password authentication:\n\n- **Session-based auth** with 7-day expiry\n- **Prisma adapter** for database integration\n- **Layout-based protection** for authenticated routes\n- **Custom user fields** including credit system\n\n### Key Auth Files\n\n- `app/lib/auth.server.ts` - BetterAuth server configuration\n- `app/lib/auth.client.ts` - Client-side auth setup\n- `app/lib/session.server.ts` - Auth helper functions\n- `app/routes/authenticated.tsx` - Protected route wrapper\n\n## 🎨 Image Generation Workflow\n\n1. **User creates prompt** in the responsive prompt card interface\n2. **Credit validation** ensures user has sufficient credits\n3. **Background task** triggered via Trigger.dev for async processing\n4. **Real-time updates** show generation progress to user\n5. **Image persistence** saves results to database with metadata\n6. **Gallery display** shows generated images in responsive grid\n\n### Key Generation Files\n\n- `trigger/generateContent.ts` - Main generation task\n- `app/routes/api/dalle.ts` - Generation API endpoint\n- `app/components/PromptCard.tsx` - Generation interface\n- `app/routes/library.tsx` - Image gallery\n\n## 🗄️ Database Schema\n\n### Core Models\n\n- **User** - Authentication and credits management\n- **Prompt** - Reusable generation prompts\n- **Image** - Generated images with metadata\n- **Auth Tables** - Account, Session, Verification for BetterAuth\n\n### Key Features\n\n- **Cascading deletes** for data integrity\n- **Credit system** with atomic operations\n- **Relationship mapping** between users, prompts, and images\n\n## 🚀 Deployment\n\n### Environment Setup\n\nEnsure these environment variables are set:\n\n```env\nDATABASE_URL=your_production_postgres_url\nOPENAI_API_KEY=your_openai_key\nTRIGGER_SECRET_KEY=your_trigger_key\n```\n\n### Build for Production\n\n```bash\nnpm run build\nnpm run start\n```\n\n### Docker Deployment\n\n```bash\ndocker build -t rapidalle .\ndocker run -p 3000:3000 rapidalle\n```\n\nCompatible with: AWS ECS, Google Cloud Run, Azure Container Apps, Railway, Fly.io\n\n## 🧪 Development Commands\n\n```bash\nnpm run dev          # Start React Router dev server\nnpm run trigger:dev  # Start Trigger.dev dev server\nnpm run build        # Build for production\nnpm run typecheck    # TypeScript validation\nnpx prisma studio    # Visual database browser\nnpx prisma migrate dev    # Apply database migrations\n```\n\n## 🎯 Key Features Deep Dive\n\n### Credit System\n\n- Users start with 10 free credits\n- Each image generation costs 1 credit\n- Atomic credit deduction prevents race conditions\n- Extensible for future payment integration\n\n### Real-time Monitoring\n\n- Live task status updates via Trigger.dev hooks\n- Progress indicators during generation\n- Error handling and retry logic\n- No polling - efficient WebSocket connections\n\n### Dark Mode\n\n- System preference detection\n- Comprehensive component coverage\n- Smooth transitions and proper contrast ratios\n- TailwindCSS media strategy implementation\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License.\n\n## 🙏 Acknowledgments\n\n- [React Router](https://reactrouter.com/) - Modern React framework\n- [BetterAuth](https://better-auth.com/) - Simple, powerful authentication\n- [Trigger.dev](https://trigger.dev/) - Background job processing\n- [Prisma](https://prisma.io/) - Next-generation ORM\n- [OpenAI](https://openai.com/) - AI-powered image generation\n\n---\n\nBuilt with ❤️ using React Router 7, BetterAuth, Trigger.dev, and Prisma.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsethdavis512%2Frapidalle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsethdavis512%2Frapidalle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsethdavis512%2Frapidalle/lists"}