ReFlow is a revolutionary approach to brand identity that treats logos as living code rather than static images. Using mathematical wave functions and programmatic generation, ReFlow enables brands to have dynamic, adaptable identities that maintain consistency while responding to different contexts.
- ๐ Wave-Based Generation: Mathematical wave functions create unique, flowing designs
- ๐ต Multiple Visualization Modes: Wave Lines, Audio Bars, and Wave Bars
- ๐ Seed-Based Identity: Your brand's "digital DNA" - same seed always generates the same logo
- ๐ป Live Code Editor: View and customize the generation code in real-time
- ๐ฏ Precise Control: Fine-tune frequency, amplitude, complexity, chaos, and more
- ๐ฆ Export Options: Download as PNG or SVG (coming soon)
- ๐ Shareable Links: Share your exact logo configuration with a URL
- Node.js 18 or higher
- pnpm (required) - install instructions
# Clone the repository
git clone https://github.com/yourusername/reflow.git
cd reflow
# Install dependencies (pnpm required)
pnpm install
# Approve native module builds when prompted
# This is needed for better-sqlite3
# Copy environment variables
cp .env.local.example .env.local
# Start the development server
pnpm dev
Open http://localhost:3002 to see ReFlow in action.
๐ก Pro Tip: Set up a local domain for better development experience. See LOCAL_DOMAIN_SETUP.md to use
http://local.reflow.dev:3002
instead.
You can start using ReFlow immediately without any authentication setup:
- Visit http://localhost:3002
- Click "Continue as Guest" or start designing right away
- All features work locally in your browser
- To save settings across sessions, create a free account
ReFlow uses Better Auth for authentication, providing:
- ๐ Self-hosted authentication - No external services required
- ๐พ Local SQLite database - Your data stays on your machine
- ๐ Secure API key storage - Save OpenAI keys per user account
- ๐ Multiple auth methods - Email/password, Google, GitHub
- ๐ฐ Free forever - No usage limits or paid tiers
- ๐ Modern architecture - Edge-ready, TypeScript-first
-
Generate a secret key (required for session encryption):
openssl rand -base64 32
-
Add to
.env.local
:BETTER_AUTH_SECRET=your-generated-secret-here
-
Run database migration (first time only):
npx @better-auth/cli migrate
This creates
reflow-auth.db
with user tables.
Enable social sign-in by adding OAuth providers:
Google OAuth:
- Visit Google Cloud Console
- Create OAuth 2.0 credentials (Web application)
- Add redirect URI:
http://localhost:3002/api/auth/callback/google
- Add to
.env.local
:GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=your-client-secret
GitHub OAuth:
- Visit GitHub Developer Settings
- Create a new OAuth App
- Set callback URL:
http://localhost:3002/api/auth/callback/github
- Add to
.env.local
:GITHUB_CLIENT_ID=your-client-id GITHUB_CLIENT_SECRET=your-client-secret
- Type: SQLite 3 (via better-sqlite3)
- Location:
./reflow-auth.db
(auto-created) - Tables: user, session, account, verification
- Backup: Simply copy the
.db
file - Reset: Delete
.db
file and run migration again
ReFlow includes several AI-powered features to help create the perfect brand identity:
For quick setup during development:
- Copy the environment example file:
cp .env.local.example .env.local
- Add your OpenAI API key to
.env.local
:
OPENAI_API_KEY=sk-your-api-key-here
- Restart the development server
The AI Brand Consultant allows users to use their own OpenAI API keys:
- Users enter their API key once (stored in localStorage)
- Keys are never sent to your servers
- Users pay for their own API usage
- Perfect for production deployments
- AI Brand Consultant - Describe your brand in natural language and get personalized design recommendations
- AI Suggestions - Context-aware parameter refinements based on industry and current design
- Brand Personality Mapping - Translate personality traits into mathematical parameters
reflow/
โโโ app/ # Next.js app directory
โ โโโ page.tsx # Main application UI
โ โโโ layout.tsx # Root layout
โ โโโ visualization-templates.ts # Code templates for each mode
โโโ core/ # Core logic
โ โโโ wave-generator.ts # Mathematical wave generation engine
โโโ components/ # Reusable UI components
โ โโโ ui/ # Base UI components (buttons, cards, etc.)
โโโ lib/ # Utility functions
- Framework: Next.js 14 with App Router
- Language: TypeScript with strict mode
- Styling: Tailwind CSS with custom design system
- UI Components: Custom components built on Radix UI primitives
- Code Editor: CodeMirror with syntax highlighting
- Canvas Rendering: HTML5 Canvas API for real-time visualization
The heart of ReFlow is the WaveGenerator
class, which implements:
interface WaveParameters {
amplitude: number // Wave height
frequency: number // Wave cycles
phase: number // Wave offset
complexity: number // Harmonic additions
chaos: number // Randomness factor
damping: number // Layer decay
layers: number // Number of wave layers
}
-
Choose a Visualization Mode
- Wave Lines: Classic sine wave patterns
- Audio Bars: Vertical bars like audio visualizers
- Wave Bars: Bars that follow a wave envelope
-
Set Your Seed
- This is your brand's unique identifier
- Same seed = same logo every time
- Think of it as your logo's DNA
-
Adjust Parameters
- Use sliders to fine-tune the visual output
- See changes in real-time
- Find the perfect balance for your brand
-
Export Your Logo
- Download as PNG for immediate use
- SVG export coming soon
- Share a link to your exact configuration
- Click "Clone & Edit" on any visualization
- Modify the JavaScript code directly
- Create entirely new visualization algorithms
- Full access to Canvas API and wave generation utilities
- Click the play button to animate your logo
- Perfect for dynamic brand presentations
- Smooth 60fps animations
Quick-start with pre-configured designs:
- Gentle Wave
- Audio Spectrum
- Wave Flow
# Development
pnpm dev # Start dev server (port 3002)
pnpm build # Build for production
pnpm start # Start production server
# Code Quality
pnpm lint # Run ESLint
pnpm typecheck # Run TypeScript compiler
# Database
npx @better-auth/cli migrate # Create/update auth tables
# Testing
pnpm test # Run tests (coming soon)
- Identity as Code: Logos are generated, not designed
- Reproducibility: Seed-based generation ensures consistency
- Flexibility: Multiple visualization modes for different contexts
- Extensibility: Custom code mode for unlimited possibilities
We welcome contributions! Please see our Contributing Guide (coming soon) for details.
MIT License - see LICENSE file for details.
ReFlow represents a paradigm shift in brand identity. Instead of static logo files scattered across your organization, you have a single source of truth - code that generates your identity on demand. This enables:
- Consistency: One algorithm, infinite applications
- Adaptability: Respond to context while maintaining identity
- Efficiency: No more managing hundreds of logo variations
- Innovation: Push the boundaries of what a logo can be
Built with โค๏ธ by the ReFlow Team