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.
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
.
βββ .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
-
Clone the repository
git clone https://github.com/yourusername/design-to-deployment.git cd design-to-deployment -
Set up Python environment
python -m venv .venv source .venv/bin/activate # or `.venv\Scripts\activate` on Windows pip install -r requirements.txt
-
Configure environment
cp .env.example .env # Edit .env with your API keys and configurations -
Add design files
- Place Figma exports in
designs/figma/ - Place Sketch exports in
designs/sketch/
- Place Figma exports in
-
Run the workflow
python tools/workflow_orchestrator.py
tools/design_importer.py: Imports designs from Figma or Sketchpython tools/design_importer.py --source designs/figma --output-dir designs/imported
tools/design_analyzer.py: Analyzes design files and extracts tokenspython tools/design_analyzer.py --input-dir designs/imported --output-dir designs/analyzed
tools/component_generator.py: Generates components from design tokenspython tools/component_generator.py --input-dir designs/analyzed --output-dir src/components --framework react
tools/integration_generator.py: Integrates components into pagespython tools/integration_generator.py --components-dir src/components --screens-dir designs/analyzed/screens --output-dir src/pages
tools/visual_validator.py: Validates implementation against designpython tools/visual_validator.py --design-dir designs/imported --implementation-url http://localhost:3000 --output-dir validation/visual
tools/deployment_prep.py: Prepares for deploymentpython tools/deployment_prep.py --env production --build-dir build
tools/deployment_automation.py: Automates deployment to various platformspython tools/deployment_automation.py --target vercel --env production --build-dir build
tools/workflow_orchestrator.py: Orchestrates the entire workflowpython tools/workflow_orchestrator.py --config workflow_config.json
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
}
}The component generator supports multiple frontend frameworks:
- React (default)
- Vue.js
- Angular
- Svelte
Example:
python tools/component_generator.py --framework vueThe deployment automation supports multiple targets:
- Vercel (default)
- Netlify
- AWS
- Custom servers
Example:
python tools/deployment_automation.py --target netlify- Fork the repository
- Create your feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m "[Cursor] Add amazing feature" - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Cursor - The AI-first IDE
- OpenAI - For GPT models
- Anthropic - For Claude models
- Figma and Sketch - For design tools integration
- Cursor Documentation
- Figma API Documentation
- Sketch API Documentation
- Vercel Documentation
- Netlify Documentation
This repository demonstrates best practices for environment configuration in Express.js applications.
Proper environment configuration is crucial for application security, maintainability, and deployment flexibility. This repository provides:
- Standardized environment file structure
- Environment variable validation
- Environment setup tools
- Documentation of best practices
.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 usagetools/validate-env.js: Script to validate environment variablestools/setup-env.js: Script to help developers set up their environment files
- Clone the repository
- Run the setup script to create your environment file:
node tools/setup-env.js- Validate your environment configuration:
node tools/validate-env.js- Never commit sensitive information to version control
- Use environment-specific files for different environments
- Standardize naming conventions (use uppercase for all variables)
- Group related variables with comments
- Document all variables in
.env.md - Validate environment variables on application startup
- Use a single format for connection strings (e.g., URL format for database and Redis)
- Provide clear examples in the
.env.examplefile - Rotate API keys regularly for security
- Use placeholder values in example files
- Local development environment
- Debug mode enabled
- Detailed logging
- Local database and services
- Automated testing environment
- Isolated test database
- Mock external services when possible
- Debug mode enabled
- Live environment
- Debug mode disabled
- Minimal logging (warnings and errors only)
- Strict security settings
- Real external services
For detailed documentation of environment variables and their usage, see .env.md.
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
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
MIT