Generate stunning, unique vector icons instantly using the power of AI. Create scalable SVG assets for your projects in seconds.
Website • Features • Tech Stack • Getting Started • Deployment
Iconvect is an AI-powered platform that generates custom SVG icons for web projects. Built with Next.js, React, Tailwind CSS, and PostgreSQL, it combines powerful server-side rendering, fast and modern UI development, and reliable relational data handling.
Live at: iconvect.com
- AI-Powered Generation: Generate unique SVG icons using OpenAI and Google Gemini
- Credit-Based System: Flexible credit system for managing icon generation
- User Authentication: Secure authentication with GitHub and Google OAuth providers
- Payment Integration: Stripe integration for credit purchases with invoice management
- Real-time Analytics: PostHog integration for user analytics and insights
- Type-Safe APIs: End-to-end type safety with tRPC
- Responsive UI: Modern, responsive interface built with Tailwind CSS
- Database Management: Robust data handling with Prisma ORM and PostgreSQL
- Server-Side Rendering: Fast page loads with Next.js 15
- Credit Transaction History: Complete audit trail of all credit purchases and usage
- Icon Library: Save and manage generated icons
- Next.js 15.3 - React framework with App Router
- React 18 - UI library
- TypeScript - Type safety
- tRPC - End-to-end type-safe APIs
- Prisma - Type-safe ORM
- PostgreSQL - Relational database
- NextAuth.js 5 - Authentication
- OpenAI API - AI icon generation
- Google Gemini - Alternative AI provider
- Tailwind CSS 4 - Utility-first CSS
- Radix UI - Accessible component primitives
- Framer Motion - Animation library
- Lucide React - Icon library
- next-themes - Dark mode support
- Zustand - Lightweight state management
- TanStack Query - Data fetching and caching
Before you begin, ensure you have the following installed:
- Node.js 18.x or later
- pnpm 10.6.5 or later (recommended) or npm/yarn
- PostgreSQL database
- Git
git clone https://github.com/project-kt/iconvect.git
cd iconvectpnpm installCreate a .env file in the root directory by copying the example:
cp .env.example .envConfigure the following environment variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/iconvect"
# Next Auth (Generate with: npx auth secret)
AUTH_SECRET="your-auth-secret"
AUTH_TRUST_HOST="http://localhost:3000"
# AI Providers (at least one required)
OPENAI_API_KEY="your-openai-api-key"
OPENAI_ORGANIZATION="your-openai-org-id"
OPENAI_PROJECT="your-openai-project-id"
# Or use Google Gemini
GOOGLE_API_KEY="your-google-gemini-api-key"
# Stripe Payment
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."# GitHub OAuth
AUTH_GITHUB_ID="your-github-client-id"
AUTH_GITHUB_SECRET="your-github-client-secret"
# Google OAuth
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"# PostHog
NEXT_PUBLIC_POSTHOG_KEY="your-posthog-key"
NEXT_PUBLIC_POSTHOG_HOST="https://app.posthog.com"NEXT_PUBLIC_API_URL="http://localhost:3000"Start the PostgreSQL database using the provided script:
./start-database.sh- Create a PostgreSQL database
- Update the
DATABASE_URLin your.envfile - Run Prisma migrations:
pnpm db:generate
pnpm db:migrateTo explore and manage your database with Prisma Studio:
pnpm db:studioThis will open a visual database browser at http://localhost:5555
pnpm devThe application will be available at http://localhost:3000
| Script | Description |
|---|---|
pnpm dev |
Start development server with Turbopack |
pnpm build |
Build production bundle |
pnpm start |
Start production server |
pnpm preview |
Build and start production server |
pnpm lint |
Run ESLint |
pnpm lint:fix |
Fix ESLint errors automatically |
pnpm typecheck |
Run TypeScript compiler check |
pnpm format:check |
Check code formatting |
pnpm format:write |
Format code with Prettier |
pnpm check |
Run lint and typecheck |
pnpm check:all |
Run format, typecheck, and lint |
pnpm db:generate |
Generate Prisma client and run migrations |
pnpm db:migrate |
Deploy database migrations |
pnpm db:push |
Push schema changes to database |
pnpm db:studio |
Open Prisma Studio |
iconvect/
├── prisma/
│ └── schema.prisma # Database schema
├── public/ # Static assets
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── api/ # API routes
│ │ ├── homepage/ # Homepage components
│ │ └── prices/ # Pricing page
│ ├── components/ # React components
│ │ └── ui/ # UI components (Radix/shadcn)
│ ├── hooks/ # Custom React hooks
│ │ └── mutations/ # tRPC mutation hooks
│ ├── lib/ # Utility libraries
│ │ └── types/ # TypeScript types
│ ├── server/ # Server-side code
│ │ ├── api/ # tRPC API routers
│ │ ├── auth/ # NextAuth configuration
│ │ └── services/ # Business logic services
│ ├── store/ # Zustand state stores
│ ├── styles/ # Global styles
│ └── trpc/ # tRPC client setup
├── .env # Environment variables (create from .env.example)
├── .env.example # Environment variables template
├── next.config.js # Next.js configuration
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Dependencies and scripts
The application uses the following main entities:
- Users: User accounts with credit balance and status (trial/subscribed/cancelled/banned)
- Accounts & Sessions: NextAuth authentication tables
- Orders: Credit purchase orders with Stripe integration
- Invoices: Payment invoices linked to orders
- CreditTransactions: Audit trail for all credit changes (purchases, generations, refunds)
- AiGenerationRequests: History of AI icon generation requests with status tracking
See prisma/schema.prisma for the complete database schema.
Users start with 15 trial credits and can purchase more through Stripe. Credits are spent when generating icons, with a complete transaction history for transparency.
Icons are generated using either OpenAI or Google Gemini APIs. Each generation request is tracked with:
- Prompt used
- Credits spent
- Generation status (pending/processing/completed/failed)
- Result SVG path (on success)
- Error messages (on failure)
- User selects a credit package
- Stripe checkout session is created
- Payment is processed
- Webhook confirms payment
- Credits are added to user account
- Invoice is generated
Supports multiple OAuth providers:
- GitHub OAuth
- Google OAuth
- Email/Password (via NextAuth)
- Push your code to GitHub
- Import project to Vercel
- Configure environment variables
- Deploy
Vercel automatically detects Next.js and configures the build settings.
Ensure all required environment variables from .env.example are set in your deployment platform.
Run migrations in production:
pnpm db:migrateFor Docker deployment, refer to the T3 Stack Docker guide.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Before submitting a PR, ensure your code passes all checks:
pnpm check:allThis project is built with the T3 Stack:
- Next.js Documentation
- React Documentation
- tRPC Documentation
- Prisma Documentation
- NextAuth.js Documentation
- Tailwind CSS Documentation
UNLICENSED - All rights reserved
kt - GitHub
Built with the T3 Stack
Made with ❤️ for developers who need amazing icons