Skip to content

Repository files navigation

πŸš€ PromptCraft - AI Prompt Generator

PromptCraft Logo

Transform your simple ideas into powerful AI prompts

Next.js Supabase Tailwind CSS License

Demo β€’ Documentation β€’ Features β€’ Setup


✨ Features

🎨 Modern UI/UX

  • Glassmorphism Design - Beautiful glass-effect cards with backdrop blur
  • Gradient Accents - Vibrant purple-pink gradient theme
  • Smooth Animations - Floating, pulse, fade-in, and hover effects
  • Fully Responsive - Optimized for mobile, tablet, and desktop
  • Dark Theme - Premium dark mode with gradient backgrounds

πŸ” Authentication (Supabase)

  • Email/Password - Traditional authentication
  • OAuth Providers - Google & GitHub sign-in
  • Email Verification - Secure account activation
  • Password Reset - Self-service password recovery
  • Session Management - Persistent login with auto-refresh

πŸ€– AI-Powered Features

  • Prompt Generation - Transform simple ideas into detailed prompts
  • Smart Suggestions - Quick-start templates
  • History Management - Save and access previous prompts
  • Character Counter - Real-time input tracking
  • Debounced Input - Optimized performance

πŸ“Š Database Integration

  • User Prompts - Save generated prompts to database
  • Templates Marketplace - Browse and purchase prompt templates
  • Favorites System - Bookmark favorite templates
  • Reviews & Ratings - Community feedback
  • User Profiles - Extended user information

⚑ Performance Optimizations

  • Debouncing - Reduce unnecessary API calls
  • Local Storage - Client-side caching
  • Lazy Loading - Conditional component rendering
  • Memoization - Prevent unnecessary re-renders
  • Custom Hooks - Reusable logic patterns

πŸ› οΈ Tech Stack

Category Technology
Framework Next.js 14.2.3 (App Router)
Authentication Supabase Auth
Database Supabase (PostgreSQL)
Styling Tailwind CSS 3.4.1
UI Components Custom React Components
Fonts Inter, Space Grotesk (Google Fonts)
AI API OpenRouter
Deployment Vercel

πŸ“¦ Quick Start

Prerequisites

  • Node.js 14+ installed
  • npm or yarn package manager
  • Supabase account (free tier available)
  • OpenRouter API key

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/promptcraft.git
    cd promptcraft
  2. Install dependencies

    npm install
  3. Setup environment variables

    copy .env.example .env.local

    Edit .env.local with your credentials:

    NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
    OPENROUTER_API_KEY=your-openrouter-key
  4. Setup Supabase database

  5. Run development server

    npm run dev
  6. Open in browser

    http://localhost:3000
    

πŸ“– Documentation

Project Structure

promptcraft/
β”œβ”€β”€ app/                      # Next.js app directory
β”‚   β”œβ”€β”€ auth/                # Authentication pages
β”‚   β”‚   β”œβ”€β”€ signin/         # Sign in page
β”‚   β”‚   β”œβ”€β”€ signup/         # Sign up page
β”‚   β”‚   └── callback/       # OAuth callback
β”‚   β”œβ”€β”€ marketplace/        # Marketplace pages
β”‚   β”œβ”€β”€ api/                # API routes
β”‚   β”œβ”€β”€ globals.css         # Global styles
β”‚   β”œβ”€β”€ layout.js           # Root layout
β”‚   └── page.jsx            # Homepage
β”œβ”€β”€ components/             # React components
β”‚   β”œβ”€β”€ AuthProvider.js    # Auth context provider
β”‚   β”œβ”€β”€ Navbar.jsx         # Navigation bar
β”‚   β”œβ”€β”€ Footer.jsx         # Footer component
β”‚   └── ...
β”œβ”€β”€ lib/                    # Utility libraries
β”‚   β”œβ”€β”€ supabase.js        # Supabase client & helpers
β”‚   β”œβ”€β”€ hooks.js           # Custom React hooks
β”‚   β”œβ”€β”€ utils.js           # Utility functions
β”‚   └── constants.js       # App constants
β”œβ”€β”€ supabase/              # Supabase configuration
β”‚   └── schema.sql         # Database schema
β”œβ”€β”€ public/                # Static assets
└── ...

Key Files

  • lib/supabase.js - Supabase client configuration and helper functions
  • components/AuthProvider.js - Global authentication state management
  • app/globals.css - Design system with CSS variables and animations
  • lib/hooks.js - Custom React hooks (useDebounce, useLocalStorage, etc.)
  • lib/constants.js - Application constants and configuration

🎨 Design System

Color Palette

/* Primary Gradient */
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

/* Secondary Gradient */
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);

/* Accent Gradient */
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

Typography

  • Headings: Space Grotesk (Google Fonts)
  • Body: Inter (Google Fonts)
  • Code: Monospace

Components

  • Glass Cards: glass-card class
  • Gradient Text: gradient-text class
  • Hover Scale: hover-scale class
  • Animations: float, pulse-glow, shimmer, fade-in, shake

πŸ”§ Configuration

Environment Variables

Variable Description Required
NEXT_PUBLIC_SUPABASE_URL Supabase project URL βœ…
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase anonymous key βœ…
DATABASE_URL PostgreSQL connection string βœ…
OPENROUTER_API_KEY OpenRouter API key βœ…
NEXT_PUBLIC_SITE_URL Site URL (for OAuth) βœ…
MIDTRANS_SERVER_KEY Midtrans payment key ❌
MIDTRANS_CLIENT_KEY Midtrans client key ❌

Supabase Setup

See detailed guide: SUPABASE_SETUP.md

  1. Create Supabase project
  2. Get API keys
  3. Run database schema
  4. Configure OAuth providers
  5. Setup email templates

πŸš€ Deployment

Vercel (Recommended)

  1. Push to GitHub

    git add .
    git commit -m "Initial commit"
    git push origin main
  2. Import to Vercel

    • Go to vercel.com
    • Click "New Project"
    • Import your GitHub repository
  3. Add Environment Variables

    • Add all variables from .env.local
    • Update NEXT_PUBLIC_SITE_URL to your Vercel domain
  4. Deploy

    • Click "Deploy"
    • Wait for build to complete
  5. Update OAuth Redirects

    • Update Google/GitHub OAuth redirect URLs
    • Update Supabase redirect URLs

πŸ“Š Database Schema

Tables

  • prompts - User generated prompts
  • templates - Marketplace templates
  • purchases - Template purchases
  • favorites - User favorites
  • reviews - Template reviews
  • profiles - Extended user profiles

Security

  • βœ… Row Level Security (RLS) enabled
  • βœ… User-specific data isolation
  • βœ… Public/private content separation
  • βœ… Secure authentication flow

🎯 Roadmap

  • Modern UI/UX with glassmorphism
  • Supabase authentication
  • Email/password sign up/in
  • OAuth (Google, GitHub)
  • Database integration
  • Prompt history
  • Local storage caching
  • Marketplace functionality
  • Template creation
  • Payment integration (Midtrans)
  • Real-time collaboration
  • API access for developers
  • Mobile app (React Native)

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Your Name


πŸ™ Acknowledgments


πŸ“ž Support

Need help?


Made with ❀️ by the PromptCraft Team

⭐ Star us on GitHub β€” it helps!

Website β€’ Twitter β€’ Discord

About

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages