
Gradient Generator
An advanced web application for creating, customizing, previewing and exporting sophisticated CSS gradients - featuring AI-powered generation, ~980 presets, community sharing, and 20+ device mockups.
Lines of Code
51,186
TypeScript + React + Prisma
React Components
142
87 custom + 55 shadcn/ui
Gradient Presets
~980
In 10 categories, 80+ subcategories
Device Mockups
20+
iPhone, MacBook, iPad, browsers...
Project Overview
What Gradient Generator is and why it exists
Gradient Generator is a web application designed for designers, front-end developers, and creatives who need to quickly generate sophisticated CSS gradients. The tool supports linear, radial, conic, and mesh gradients with real-time preview, a rich library of ~980 presets, and multi-format export (CSS, SVG, PNG, JPEG).
Unlike existing tools (cssgradient.io, webgradients.com), this project pushes the boundaries with a layer system with blend modes, AI-powered gradient generation via OpenAI, device mockup previews, and a community sharing platform with likes, forks, and discovery. It supports 11 CSS color interpolation spaces including the cutting-edge OKLab and OKLCH standards.
Linear
Linear - Direction-based color transitions with angle control
Radial
Radial - Circular gradients with center position and shape control
Conic
Conic - Angular gradients rotating around a center point
Mesh
Mesh - Multi-point gradients with complex color distributions
Objectives, Context & Risks
The strategic vision behind the project
The project was driven by clear, ambitious objectives:
Intuitive UX
Designer-grade
Fluid, responsive, and visually polished interface
Gradient Coverage
4 types
Linear, radial, conic, and mesh
Preset Library
~980
Organized in 10 categories, 80+ subcategories
AI Integration
GPT-4o-mini
Generate gradients from text descriptions
Export Formats
4 formats
CSS, SVG, PNG, JPEG
Context
This personal project was conceived as both a productivity tool for designers and a portfolio demonstration of modern React/Next.js expertise. The application was built from scratch in just 3 days using the latest versions of the stack: Next.js 16, React 19, TypeScript strict, Tailwind CSS 4, Prisma 7. Development was accelerated through AI-assisted coding, with Jose DA COSTA serving as architect, product owner, and technical reviewer.
Stakes
The project needed to differentiate itself from existing tools through completeness (mesh gradients, layers, AI, mockups, community) and visual quality. Performance was critical: the editor had to remain fluid with complex multi-layer gradients, real-time effects, and animations without any lag. The project also served as a concrète demonstration of rapid AI-augmented development capabilities.
State Management Complexity
8 interconnected Zustand stores managing gradient, layers, history, preview, selections, saved gradients, community, and presets.
Browser Compatibility
Mesh gradients and modern color interpolation spaces (OKLab, OKLCH) have limited browser support.
OpenAI Dependency
AI generation feature relies entirely on the OpenAI API (gpt-4o-mini model) for text-to-gradient conversion.
No Test Coverage
Zero test files discovered - a significant regression risk for 142 components and 12 API endpoints.
Implementation Phases
A chronological walkthrough of 3 days of intensive development
- Scaffolded Next.js 16 with App Router, TypeScript strict mode, Tailwind CSS 4
- Set up Zustand store architecture for gradient, layers, and history management
- Implemented interactive gradient editor with linear, radial, and conic support
- Built advanced color picker with HEX/RGB/HSL input and 2D color zone
- Implemented IndexedDB persistence for local gradient saving via idb library
- Built a library of ~980 gradient presets organized in 10 categories and 80+ subcategories
- Implemented visual effects engine: grain, vignette, fade, and blend modes
- Added color adjustments: brightness, saturation, contrast, hue rotation
- Created multi-format export module: CSS, SVG, PNG (via html2canvas), JPEG
- Built 20+ device mockup components (iPhone 15 Pro, MacBook, iPad, iMac, browsers)
- Integrated OpenAI API (gpt-4o-mini) for text-to-gradient generation with structured prompts
- Implemented mesh gradient support with multi-point color distribution
- Built community "Explore" section with Prisma + SQLite (publish, like, fork, view)
- Created layer system with blend modes, opacity control, and reordering
- Added 11 CSS color interpolation spaces (sRGB, OKLab, OKLCH, Lab, LCH, etc.)
- Built static pages: Contact, Privacy, Terms, Copyright, Changelog
- Designed animated hero section with community highlights
- Implemented CSS animations: rotation, color shift, movement, glow effects
- Fixed alignment and overflow bugs across responsive breakpoints
- Configured PWA manifest for standalone installation
Actors & Interactions
The human and technological ecosystem
This is a solo project conceived, designed, and shipped by Jose DA COSTA. The development followed a "human-in-the-loop" workflow: specification and architectural decisions by the developer, AI-assisted code generation via Claude Code, and manual review and validation of all generated code.
The brainstorming phase involved 4 different AI assistants (ChatGPT, Gemini, Grok, Mistral) for ideation and competitive analysis, with exports stored in the project repository. The production codebase was primarily generated through Claude Code, with Jose DA COSTA directing specifications via a detailed CLAUDE.md project manifest.
| Source | Lines | % of Total | Detail |
|---|---|---|---|
| Scaffold (create-next-app) | ~336 | 0.7% | Next.js boilerplate |
| Committed code | ~1,560 | 3.0% | 3 commits (page, configs, modal) |
| AI-assisted code | ~49,476 | 96.7% | 142 components, 8 stores, 12 APIs |
| Total | ~51,186 | 100% |
External Dependencies
Key external integrations include OpenAI API (gpt-4o-mini for gradient generation), Radix UI (25 primitive components via shadcn/ui), html2canvas (image export), and idb (IndexedDB abstraction for local persistence).
Results
Measurable outcomes for the project and for personal growth
For the Product
Features Delivered
20
Complete feature set in 3 days
Gradient Presets
~980
10 categories, 80+ subcategories
Color Spaces
11
Including OKLab, OKLCH, Display-P3
API Endpoints
12
7 GET + 5 POST
DB Tables
3
Author, PublicGradient, Like
Dependencies
66
54 production + 12 development
For Me
This project reinforced and expanded several key competencies:
- Modern React/Next.js mastery - hands-on experience with the absolute latest versions (Next.js 16, React 19) and their newest patterns
- Advanced CSS expertise - deep understanding of modern CSS gradient specifications, color interpolation spaces (OKLab/OKLCH), and mesh gradients
- Complex state management - architecting 8 interconnected Zustand stores with persistence, undo/redo, and cross-store coordination
- AI integration patterns - structured prompt engineering for creative content generation, parsing OpenAI responses into typed data structures
- Rapid prototyping with AI assistance - validating that a complex, feature-rich application can be built in 3 days with AI-augmented development
- Design system creation - building a complete CSS token system with editor/site/shared themes supporting dark and light modes
What Came After
Life beyond the initial development sprint
Immediate Aftermath
The application was functional locally after 3 days of development. However, several elements were missing for a production launch: a robust database strategy (SQLite is insufficient for concurrent access in a community platform), proper test coverage, and CI/CD pipelines. The project remained in its development state with only 3 git commits and a largely non-committed working tree.
Medium Term
The project served its primary purpose as a portfolio demonstration piece, showcasing the ability to build a complex, feature-rich application rapidly. The ~980 presets and the AI generation feature represent reusable intellectual property that could be extracted into standalone libraries or integrated into other design tools.
Current State
The project is functional locally but not deployed in production. It remains a compelling demonstration of what modern web development tools and AI-assisted coding can achieve in an extremely compressed timeline. The architecture and patterns established (feature-driven components, multi-store Zustand, Prisma + SQLite community backend) provide a solid foundation for future production deployment.
Critical Reflection
An honest retrospective analysis
- Exceptional feature richness for a 3-day project - editor, layers, AI, mockups, community, presets
- Bleeding-edge stack: Next.js 16, React 19, Tailwind CSS 4, Prisma 7 - all latest versions
- Exhaustive TypeScript type system (479 lines for gradient types alone) providing excellent safety
- Coherent design system with CSS tokens, dark/light themes, and editor-specific theming
- ~980 presets provide immediate value - users can start creating without learning the interface
- Feature-driven component architecture enables independent maintainability per module
- Zero test coverage - no unit, integration, or E2E tests for a 51K-line codebase
- Only 3 git commits - virtually no traceability of decisions and changes
- SQLite is inadequate for production community features (concurrent access, scalability)
- No CI/CD pipeline configured - no automated quality gates
- Default Next.js README with no project-specific documentation
- No rate limiting or real authentication (browser hash only) on API routes
Lasting Lessons
- Modern tooling maximizes productivity - shadcn/ui, Zustand, Prisma, and Next.js App Router eliminate boilerplate and allow focusing on business logic
- Feature-driven architecture scales - organizing by feature (color-picker, mockups, presets, layers) keeps each module autonomous and maintainable
- Strong typing is an investment - the 479-line type file seems costly but prevents entire categories of bugs across the application
- Content-rich tools win users - the ~980 presets make the tool immediately useful, proving that pre-built content is as valuable as the editor itself
Architecture
Related journey
Professional experience linked to this achievement
Skills applied
Technical and soft skills applied
Image gallery
Project screenshots and visuals





