Thanks to visit codestin.com
Credit goes to github.com

Skip to content

urstruelysv/tintly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎨 Tintly - Complete Theme Generator

A full-stack theme generator that creates beautiful, customizable themes for shadcn/ui components. Built with a backend-first approach to showcase strong system design and API development skills.

✨ Features

  • 🎨 Advanced Theme Editor - Complete color, typography, and spacing customization
  • πŸ”„ Real-time Preview - Live preview with shadcn/ui components
  • πŸ“€ Multiple Export Formats - Tailwind config, CSS variables, and JSON tokens
  • πŸš€ Theme Presets - Quick-start themes for common use cases
  • 🐳 Docker Support - Easy deployment with Docker Compose
  • πŸ§ͺ Comprehensive Testing - Full test coverage for backend API
  • πŸ“± Responsive Design - Works perfectly on desktop and mobile

πŸš€ Quick Start

Option 1: Docker (Recommended)

# Clone the repository
git clone <repository-url>
cd tintly

# Start both services with one command
./start.sh

# Or use Docker Compose directly
docker-compose up --build -d

Access the application:

Option 2: Manual Setup

# Install dependencies for both services
npm run install:all

# Start both services in development
npm run dev

# Or start individually
npm run dev:backend    # Backend on port 3001
npm run dev:frontend   # Frontend on port 3000

πŸ—οΈ Architecture

Backend-First Design

  • Express.js API with comprehensive REST endpoints
  • SQLite database for persistent theme storage
  • Export service generating multiple file formats
  • Joi validation for robust data validation
  • Comprehensive testing with Jest and Supertest

Frontend Consumer

  • Next.js 15 with App Router
  • shadcn/ui components for consistent design
  • Real-time preview with live theme updates
  • Advanced color picker with HSL/HSV support
  • Typography editor with font selection
  • Spacing controls for precise customization

πŸ“ Project Structure

tintly/
β”œβ”€β”€ πŸ“¦ package.json              # Root package with scripts
β”œβ”€β”€ 🐳 docker-compose.yml        # Docker orchestration
β”œβ”€β”€ πŸš€ start.sh                  # Startup script
β”œβ”€β”€ πŸ“– README-Docker.md          # Docker documentation
β”œβ”€β”€ πŸ–₯️ server/                   # Backend API
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ—„οΈ models/          # Database models
β”‚   β”‚   β”œβ”€β”€ πŸ›£οΈ routes/          # API routes
β”‚   β”‚   β”œβ”€β”€ βš™οΈ services/        # Business logic
β”‚   β”‚   └── πŸ–₯️ server.js        # Express server
β”‚   β”œβ”€β”€ πŸ§ͺ tests/               # Unit tests
β”‚   β”œβ”€β”€ πŸ—ƒοΈ data/                # SQLite database
β”‚   └── 🐳 Dockerfile           # Backend container
└── 🎨 tintly-client/           # Frontend UI
    β”œβ”€β”€ πŸ“ src/
    β”‚   β”œβ”€β”€ πŸ“± app/             # Next.js app
    β”‚   β”œβ”€β”€ 🧩 components/      # React components
    β”‚   └── πŸ”§ lib/             # Utilities
    β”œβ”€β”€ 🐳 Dockerfile           # Frontend container
    └── πŸ“¦ package.json         # Frontend dependencies

🎯 Core Features

🎨 Theme Editor

  • Color Customization - Primary, secondary, accent, and semantic colors
  • Advanced Color Picker - HSL/HSV sliders with hex input
  • Typography Control - Font family, size, and weight selection
  • Spacing & Radius - Precise control over padding and border radius
  • Live Preview - Real-time updates as you edit

πŸ“€ Export System

  • Tailwind Config - Ready-to-use tailwind.config.js
  • CSS Variables - HSL-based CSS custom properties
  • JSON Tokens - Design tokens for other tools
  • Multiple Formats - Download in your preferred format

πŸš€ Theme Presets

  • Default - Clean shadcn/ui theme
  • Dark Mode - High contrast dark theme
  • Ocean Blue - Calming blue color scheme
  • Forest Green - Natural green palette
  • Royal Purple - Elegant purple theme
  • Sunset Orange - Warm orange scheme

πŸ”§ API Reference

Theme Management

GET    /api/themes                    # List all themes
POST   /api/themes                    # Create new theme
GET    /api/themes/:id                # Get specific theme
PUT    /api/themes/:id                # Update theme
DELETE /api/themes/:id                # Delete theme
GET    /api/themes/default/template   # Get default template

Export System

POST   /api/export                    # Export theme (format: tailwind|css|json)
POST   /api/export/tailwind           # Export Tailwind config
POST   /api/export/css                # Export CSS variables
POST   /api/export/json               # Export JSON tokens

Health Check

GET    /health                        # Service health status

πŸ§ͺ Testing

# Run all backend tests
npm run test

# Run specific test file
cd server && bun run test themes.test.js

# Run tests in watch mode
cd server && bun run test:watch

🐳 Docker Deployment

Development

# Start with Docker Compose
docker-compose up --build

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Production

# Build and start in production mode
docker-compose up --build -d

# Check service health
curl http://localhost:3001/health
curl http://localhost:3000

πŸ“Š Monitoring

Health Checks

  • Backend: http://localhost:3001/health
  • Frontend: http://localhost:3000

Logs

# All services
docker-compose logs -f

# Specific service
docker-compose logs -f backend
docker-compose logs -f frontend

πŸ› οΈ Development

Prerequisites

  • Node.js 18+
  • Bun (recommended) or npm
  • Docker (for containerized development)

Available Scripts

npm run dev              # Start both services
npm run dev:backend      # Backend only
npm run dev:frontend     # Frontend only
npm run build            # Build both services
npm run test             # Run backend tests
npm run docker:up        # Start with Docker
npm run docker:down      # Stop Docker services
npm run clean            # Clean Docker resources

🎨 Usage Examples

Creating a Theme

  1. Open the theme editor
  2. Customize colors using the advanced color picker
  3. Adjust typography with font selection
  4. Fine-tune spacing and border radius
  5. Preview your changes in real-time
  6. Save your theme
  7. Export in your preferred format

Exporting Themes

  • Tailwind: Download tailwind.config.js for your project
  • CSS: Get CSS variables for custom styling
  • JSON: Use design tokens in other tools

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

πŸ“„ License

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

πŸ™ Acknowledgments


Built with ❀️ to showcase backend-first development and system design skills

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published