Skip to content
/ Cursor-Template-Repo Public template

A collection of cursor rules templates for automated software development

License

Notifications You must be signed in to change notification settings

blopit/Cursor-Template-Repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

68 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Design-to-Deployment with Cursor

A comprehensive framework for transforming design files into deployed applications using Cursor AI. This framework provides a structured workflow for importing designs, generating components, integrating them into pages, validating against design specifications, and deploying to various platforms.

🎯 Purpose

This framework helps you:

  • Automate the conversion of design files (Figma, Sketch) into production-ready code
  • Maintain design fidelity throughout the development process
  • Generate consistent components based on design tokens
  • Validate implementations against design specifications
  • Streamline the deployment process to multiple platforms
  • Leverage AI for code generation and visual validation

πŸ“ Project Structure

.
β”œβ”€β”€ .cursor/                    # Cursor-specific configurations
β”‚   β”œβ”€β”€ rules/                 # Development rules and guidelines
β”‚   β”œβ”€β”€ logs/                 # Operation logs
β”‚   β”œβ”€β”€ temp/                 # Temporary files
β”‚   β”œβ”€β”€ workflows/            # Workflow records and reports
β”‚   └── deployments/          # Deployment records
β”œβ”€β”€ designs/                   # Design files and extracted assets
β”‚   β”œβ”€β”€ figma/                # Figma design files
β”‚   β”œβ”€β”€ sketch/               # Sketch design files
β”‚   β”œβ”€β”€ tokens/               # Design tokens (colors, typography, etc.)
β”‚   β”œβ”€β”€ components/           # Component specifications
β”‚   └── screens/              # Screen layouts and compositions
β”œβ”€β”€ src/                       # Source code
β”‚   β”œβ”€β”€ components/           # Generated components
β”‚   β”œβ”€β”€ pages/                # Integrated pages
β”‚   β”œβ”€β”€ styles/               # Generated stylesheets
β”‚   └── utils/                # Utility functions
β”œβ”€β”€ tools/                     # Workflow tools
β”‚   β”œβ”€β”€ design_importer.py    # Import designs from Figma/Sketch
β”‚   β”œβ”€β”€ design_analyzer.py    # Analyze design files and extract tokens
β”‚   β”œβ”€β”€ component_generator.py # Generate components from design tokens
β”‚   β”œβ”€β”€ integration_generator.py # Integrate components into pages
β”‚   β”œβ”€β”€ visual_validator.py   # Validate implementation against design
β”‚   β”œβ”€β”€ deployment_prep.py    # Prepare for deployment
β”‚   β”œβ”€β”€ deployment_automation.py # Automate deployment to various platforms
β”‚   └── workflow_orchestrator.py # Orchestrate the entire workflow
β”œβ”€β”€ validation/                # Validation results
β”‚   └── visual/               # Visual validation reports
β”œβ”€β”€ build/                     # Build output
β”œβ”€β”€ tests/                     # Test files
β”œβ”€β”€ .env.example              # Environment variables template
β”œβ”€β”€ .gitignore                # Git ignore rules
└── requirements.txt          # Python dependencies

πŸš€ Getting Started

  1. Clone the repository

    git clone https://github.com/yourusername/design-to-deployment.git
    cd design-to-deployment
  2. Set up Python environment

    python -m venv .venv
    source .venv/bin/activate  # or `.venv\Scripts\activate` on Windows
    pip install -r requirements.txt
  3. Configure environment

    cp .env.example .env
    # Edit .env with your API keys and configurations
  4. Add design files

    • Place Figma exports in designs/figma/
    • Place Sketch exports in designs/sketch/
  5. Run the workflow

    python tools/workflow_orchestrator.py

πŸ› οΈ Workflow Tools

Design Import

  • tools/design_importer.py: Imports designs from Figma or Sketch
    python tools/design_importer.py --source designs/figma --output-dir designs/imported

Design Analysis

  • tools/design_analyzer.py: Analyzes design files and extracts tokens
    python tools/design_analyzer.py --input-dir designs/imported --output-dir designs/analyzed

Component Generation

  • tools/component_generator.py: Generates components from design tokens
    python tools/component_generator.py --input-dir designs/analyzed --output-dir src/components --framework react

Integration

  • tools/integration_generator.py: Integrates components into pages
    python tools/integration_generator.py --components-dir src/components --screens-dir designs/analyzed/screens --output-dir src/pages

Visual Validation

  • tools/visual_validator.py: Validates implementation against design
    python tools/visual_validator.py --design-dir designs/imported --implementation-url http://localhost:3000 --output-dir validation/visual

Deployment Preparation

  • tools/deployment_prep.py: Prepares for deployment
    python tools/deployment_prep.py --env production --build-dir build

Deployment Automation

  • tools/deployment_automation.py: Automates deployment to various platforms
    python tools/deployment_automation.py --target vercel --env production --build-dir build

Workflow Orchestration

  • tools/workflow_orchestrator.py: Orchestrates the entire workflow
    python tools/workflow_orchestrator.py --config workflow_config.json

πŸ“‹ Workflow Configuration

The workflow can be configured using a JSON file:

{
  "workflow": {
    "name": "Design to Deployment",
    "description": "Transform design files into deployed applications",
    "version": "1.0.0"
  },
  "steps": [
    {
      "name": "design_import",
      "tool": "design_importer.py",
      "enabled": true,
      "params": {
        "source": "designs/figma",
        "output_dir": "designs/imported"
      }
    },
    // Additional steps...
  ],
  "settings": {
    "continue_on_error": false,
    "parallel_execution": false,
    "notification_email": "user@example.com",
    "save_artifacts": true
  }
}

πŸ” Supported Frameworks

The component generator supports multiple frontend frameworks:

  • React (default)
  • Vue.js
  • Angular
  • Svelte

Example:

python tools/component_generator.py --framework vue

🚒 Deployment Targets

The deployment automation supports multiple targets:

  • Vercel (default)
  • Netlify
  • AWS
  • Custom servers

Example:

python tools/deployment_automation.py --target netlify

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m "[Cursor] Add amazing feature"
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“ License

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

πŸ™ Acknowledgments

  • Cursor - The AI-first IDE
  • OpenAI - For GPT models
  • Anthropic - For Claude models
  • Figma and Sketch - For design tools integration

πŸ”— Useful Links

Environment Configuration Best Practices

This repository demonstrates best practices for environment configuration in Express.js applications.

Overview

Proper environment configuration is crucial for application security, maintainability, and deployment flexibility. This repository provides:

  1. Standardized environment file structure
  2. Environment variable validation
  3. Environment setup tools
  4. Documentation of best practices

Files

  • .env.example: Template file with placeholder values (committed to version control)
  • .env.dev: Development environment configuration (not committed to version control)
  • .env.test: Testing environment configuration (not committed to version control)
  • .env.production: Production environment configuration (not committed to version control)
  • .env.md: Documentation of environment variables and their usage
  • tools/validate-env.js: Script to validate environment variables
  • tools/setup-env.js: Script to help developers set up their environment files

Getting Started

  1. Clone the repository
  2. Run the setup script to create your environment file:
node tools/setup-env.js
  1. Validate your environment configuration:
node tools/validate-env.js

Best Practices

  1. Never commit sensitive information to version control
  2. Use environment-specific files for different environments
  3. Standardize naming conventions (use uppercase for all variables)
  4. Group related variables with comments
  5. Document all variables in .env.md
  6. Validate environment variables on application startup
  7. Use a single format for connection strings (e.g., URL format for database and Redis)
  8. Provide clear examples in the .env.example file
  9. Rotate API keys regularly for security
  10. Use placeholder values in example files

Environment Types

Development (dev)

  • Local development environment
  • Debug mode enabled
  • Detailed logging
  • Local database and services

Testing (test)

  • Automated testing environment
  • Isolated test database
  • Mock external services when possible
  • Debug mode enabled

Production (prod)

  • Live environment
  • Debug mode disabled
  • Minimal logging (warnings and errors only)
  • Strict security settings
  • Real external services

Documentation

For detailed documentation of environment variables and their usage, see .env.md.

Tools

Environment Setup Script

The tools/setup-env.js script helps developers set up their environment files correctly. It:

  • Creates environment files based on .env.example
  • Sets environment-specific values
  • Prompts for sensitive information
  • Organizes variables by category

Environment Validation Script

The tools/validate-env.js script validates that all required environment variables are set and follows best practices. It:

  • Checks for missing required variables
  • Validates naming conventions
  • Detects potentially sensitive information
  • Provides a validation summary

License

MIT

About

A collection of cursor rules templates for automated software development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published