|
1 |
| -# Windmill Overview |
2 |
| - |
3 |
| -Windmill is an open-source developer platform for building internal tools, API integrations, background jobs, workflows, and user interfaces. It offers a unified system where scripts are automatically turned into sharable UIs and can be composed into flows or embedded in custom applications. |
4 |
| - |
5 |
| -## Core Capabilities |
6 |
| - |
7 |
| -- **Script Development and Execution**: Write and run scripts in Python, TypeScript/JavaScript (Deno/Bun), Go, Bash, SQL, and other languages |
8 |
| -- **Workflow Orchestration**: Compose scripts into multi-step flows with conditional logic, loops, and error handling |
9 |
| -- **UI Generation**: Automatically generate UIs from scripts or build custom applications with a low-code editor |
10 |
| -- **Job Scheduling**: Trigger scripts and flows on schedules, webhooks, or external events |
11 |
| -- **Resource Management**: Securely store and use credentials, databases, and other connections |
12 |
| - |
13 |
| -## Platform Architecture |
14 |
| - |
15 |
| -The Windmill platform consists of several key components: |
16 |
| - |
17 |
| -- **Frontend UI**: Web-based interface for script and flow development, app building, and result visualization |
18 |
| -- **API Server**: Central API that handles authentication, resource management, and job coordination |
19 |
| -- **Workers**: Execute scripts in their respective environments with proper sandboxing |
20 |
| -- **Database**: PostgreSQL database for storage of scripts, flows, resources, job results, and more |
21 |
| -- **Job Queue**: Queue system for managing job execution, implemented in PostgreSQL |
22 |
| -- **Client Libraries**: Libraries for interacting with Windmill from Python, TypeScript, or command line |
23 |
| - |
24 |
| -# Windmill Backend Architecture |
25 |
| - |
26 |
| -The Windmill backend is written in Rust and consists of several services working together. These services are designed for horizontal scaling with stateless API servers and workers that can be deployed across multiple machines. |
27 |
| - |
28 |
| -## Key Components |
29 |
| - |
30 |
| -- **API Server (`windmill-api`)**: Handles HTTP requests, authentication, and resource management |
31 |
| -- **Queue Manager (`windmill-queue`)**: Manages the job queue in PostgreSQL |
32 |
| -- **Worker System (`windmill-worker`)**: Executes jobs in sandboxed environments |
33 |
| -- **Common Utilities (`windmill-common`)**: Shared code used by multiple services |
34 |
| -- **Git Sync (`windmill-git-sync`)**: Synchronizes scripts with Git repositories |
35 |
| - |
36 |
| -## Job Execution System |
37 |
| - |
38 |
| -The job execution process follows these steps: |
39 |
| - |
40 |
| -1. The API server receives a request to run a script or flow and creates a job record in the database |
41 |
| -2. The job is added to the queue system in PostgreSQL |
42 |
| -3. Workers continuously poll the queue for jobs matching their capabilities |
43 |
| -4. When a job is picked up, it's routed to the appropriate language executor |
44 |
| -5. The script is executed in a sandboxed environment using NSJAIL for security |
45 |
| -6. Results are processed and stored in the database |
46 |
| -7. For flows, each step creates a new job that goes through the same process |
47 |
| - |
48 |
| -Windmill supports worker tags and groups to route jobs to workers with specific capabilities or resource access. |
49 |
| - |
50 |
| -# Windmill Frontend Architecture |
51 |
| - |
52 |
| -The Windmill frontend is built with Svelte and provides several key interfaces for interacting with the platform. |
53 |
| - |
54 |
| -## Key Components |
55 |
| - |
56 |
| -- **Script Builder**: Code editor with language support, schema inference, and dependency management |
57 |
| -- **Flow Builder**: Visual editor for creating multi-step workflows with branching and looping |
58 |
| -- **App Editor**: Grid-based editor for building custom UIs that integrate scripts and flows |
59 |
| -- **Schema Form System**: Generates form interfaces from script parameters automatically |
60 |
| -- **Result Viewer**: Visualizes job results, logs, and execution status |
61 |
| - |
62 |
| -The frontend uses the Monaco editor (same as VS Code) for code editing, with specialized language support for all supported script languages. |
63 |
| - |
64 |
| -## UI Framework |
65 |
| - |
66 |
| -The frontend is built with Svelte, providing a reactive and component-based architecture. Key frontend technologies include: |
67 |
| - |
68 |
| -- **Svelte/SvelteKit**: Core framework for UI components and routing |
69 |
| -- **Monaco Editor**: Code editing experience similar to VS Code |
70 |
| -- **Schema Form**: Automatic UI generation from TypeScript/JSON schemas |
71 |
| -- **Tailwind CSS**: Utility-first CSS framework for styling |
| 1 | +To have an overview of what this app does, see @.cursor/rules/windmill-overview.mdc |
| 2 | +For backend modifications, follow the rules mentioned here @.cursor/rules/rust-best-practices.mdc |
| 3 | +For frontend modifications, follow the rules mentioned here @.cursor/rules/svelte5-best-practices.mdc |
0 commit comments