Skip to content

DarcyJason/DryDrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DryDrop

Composable fullstack project generator

DryDrop is a composable full-stack project generator written in Rust. Its goal is to let you assemble a clean, maintainable full-stack project skeleton by choosing building blocks (web frameworks, databases, auth, UI, etc.) like Lego pieces.


✨ Features (Planned)

  • Modular Composition: Declare the modules your project needs; dependencies, conflicts, and file merging are handled automatically.
  • Virtual File System (VFS): Build and merge file trees entirely in memory with support for diff/patch/merge operations.
  • Template Rendering: Strong-typed templates powered by Askama for high-quality generated code.
  • Plugin System: Inject custom logic at various stages of generation via hooks.
  • Template Registry: Search, install, and update remote templates and modules.
  • Multiple Interfaces: CLI, TUI, and Desktop app (planned).
  • Safe File Operations: Read/write with automatic backups, suitable for updating existing projects.

πŸ—οΈ Architecture

DryDrop is organized as a Cargo workspace. Core logic lives under crates/, while user-facing applications are under apps/.

.
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ cli/           # Command-line interface (drydrop)
β”‚   β”œβ”€β”€ tui/           # Terminal UI (planned)
β”‚   └── desktop/       # Desktop application (planned)
β”‚
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ drydrop-core/       # Core domain models
β”‚   β”‚   β”œβ”€β”€ project/        # Project / ProjectName
β”‚   β”‚   β”œβ”€β”€ module/         # Module / ModuleId / ModuleName
β”‚   β”‚   β”œβ”€β”€ dependency.rs   # Module dependency declarations (required / conflicts)
β”‚   β”‚   └── error.rs
β”‚   β”‚
β”‚   β”œβ”€β”€ drydrop-vfs/        # Virtual File System
β”‚   β”‚   β”œβ”€β”€ path.rs         # VfsPath
β”‚   β”‚   β”œβ”€β”€ node.rs         # Node = File | Directory
β”‚   β”‚   β”œβ”€β”€ file/           # FileNode + FileContent
β”‚   β”‚   β”œβ”€β”€ directory/      # DirectoryNode
β”‚   β”‚   β”œβ”€β”€ tree.rs         # File tree structure
β”‚   β”‚   └── merge.rs        # Merge strategy for files from multiple modules
β”‚   β”‚
β”‚   β”œβ”€β”€ drydrop-template/   # Template abstraction and loading
β”‚   β”‚   β”œβ”€β”€ template/mod.rs # Template trait
β”‚   β”‚   β”œβ”€β”€ loader.rs       # Template loader
β”‚   β”‚   β”œβ”€β”€ manifest.rs     # Template manifest
β”‚   β”‚   └── metadata.rs
β”‚   β”‚
β”‚   β”œβ”€β”€ drydrop-generator/  # Generation pipeline
β”‚   β”‚   β”œβ”€β”€ planner.rs      # Plan file operations based on modules
β”‚   β”‚   β”œβ”€β”€ resolver.rs     # Resolve module dependency graph
β”‚   β”‚   β”œβ”€β”€ validator.rs    # Validation (conflicts, missing dependencies, etc.)
β”‚   β”‚   β”œβ”€β”€ pipeline.rs     # Execute the generation flow
β”‚   β”‚   └── generator.rs
β”‚   β”‚
β”‚   β”œβ”€β”€ drydrop-render/     # Rendering engine
β”‚   β”‚   └── askama.rs       # Askama integration
β”‚   β”‚
β”‚   β”œβ”€β”€ drydrop-diff/       # diff / patch / merge
β”‚   β”‚   └── ...             # Used for incremental updates on existing projects
β”‚   β”‚
β”‚   β”œβ”€β”€ drydrop-fs/         # Safe filesystem operations
β”‚   β”‚   β”œβ”€β”€ reader.rs
β”‚   β”‚   β”œβ”€β”€ writer.rs
β”‚   β”‚   └── backup.rs       # Automatic backup before writes
β”‚   β”‚
β”‚   β”œβ”€β”€ drydrop-plugin/     # Plugin system
β”‚   β”‚   β”œβ”€β”€ plugin.rs
β”‚   β”‚   β”œβ”€β”€ context.rs      # Plugin execution context
β”‚   β”‚   β”œβ”€β”€ hooks.rs        # Lifecycle hooks
β”‚   β”‚   └── exports.rs
β”‚   β”‚
β”‚   └── drydrop-registry/   # Template / plugin registry
β”‚       β”œβ”€β”€ registry.rs
β”‚       β”œβ”€β”€ search.rs
β”‚       β”œβ”€β”€ install.rs
β”‚       └── update.rs
β”‚
β”œβ”€β”€ templates/              # Built-in templates (Askama)
β”‚   └── askama/
β”‚       β”œβ”€β”€ axum/
β”‚       └── actix/
β”‚
β”œβ”€β”€ examples/               # Example projects
└── plugins/                # Plugin examples

Core Data Flow (Planned)

User selects modules
     β”‚
     β–Ό
drydrop-core (Project + Modules + Dependencies)
     β”‚
     β–Ό
drydrop-registry (Resolve remote modules/templates)
     β”‚
     β–Ό
drydrop-generator
  β”œβ”€ resolver   β†’ Build dependency graph
  β”œβ”€ planner    β†’ Produce VFS operation plan
  β”œβ”€ validator  β†’ Conflict / dependency checks
  └─ pipeline   β†’ Execute
     β”‚
     β–Ό
drydrop-vfs (Assemble final file tree in memory)
     β”‚
     β–Ό
drydrop-render (Askama template rendering)
     β”‚
     β–Ό
drydrop-fs (Write to disk with backup)
     β”‚
     β–Ό
drydrop-plugin (post-generate hooks)

πŸš€ Quick Start

Requirements

  • Rust (recommended to manage via mise)
  • The project pins Rust 1.96.0 (see mise.toml)
# Install the Rust version specified by the project
mise install

Build

cargo build --workspace

Run the CLI

# Show help
cargo run -p cli -- --help

# Create a new project (currently a placeholder)
cargo run -p cli -- new my-app

πŸ› οΈ Development Guide

Common Commands

# Check compilation (recommended during development)
cargo check --workspace

# Run tests
cargo test --workspace

# Build release
cargo build --release --workspace

# Build only the CLI
cargo build -p cli

Adding a New Module Type

  1. Extend Module / ModuleId definitions in drydrop-core.
  2. Add discovery and installation support in drydrop-registry.
  3. Add corresponding Askama templates under templates/.
  4. Handle module-specific logic (route registration, DI, etc.) in drydrop-generator's resolver/planner.
  5. Implement hooks in drydrop-plugin if custom behavior is needed.

Template Development

Templates currently live in templates/askama/<framework>/.

  • Files with the .askama suffix are processed by Askama.
  • Keep the template structure close to the final generated project to ease maintenance.

VFS and File Merging

drydrop-vfs is a core abstraction. Files generated by multiple modules are merged using strategies defined in merge.rs.

Common merge strategies (to be implemented):

  • Direct overwrite (new files)
  • Append content (routes, dependencies, etc.)
  • Smart merge (using diff/patch)

Error Handling

Currently uses drydrop-core::error::Result (a type alias over std::result::Result).

Future work may migrate to snafu for richer error context (already declared in the workspace).

Plugin Hook Points (Planned)

Hook Stage Description
pre_resolve Before dependency resolution
post_resolve After dependency resolution
pre_generate Before file generation
post_generate After file generation (VFS ready)
pre_write Before writing to disk
post_write After writing to disk

πŸ“Š Current Status

Component Status Notes
CLI (drydrop new) Skeleton Command parsing done; real logic is stub
drydrop-core Model defined Project / Module / Dependency etc.
drydrop-vfs Model defined Basic node and path structures
drydrop-template Interface Template trait + module layout
drydrop-generator Module layout pipeline/resolver/etc. modules created
Other crates Placeholder Most implementations are empty
Templates Directories Files are empty; real templates pending

Total code: ~200 lines of effective Rust (as of the initial commit).

This is a very early-stage project and is intended as a foundation for long-term evolution.


πŸ—ΊοΈ Suggested Development Roadmap

  1. MVP Generation Flow

    • Make drydrop new <name> --template axum produce a runnable project
    • Complete Askama rendering + VFS write path
  2. Module System

    • Define built-in modules (web, db, auth, ...)
    • Implement dependency resolution + conflict detection
  3. VFS Merge Strategies

    • File-level and content-level merging
    • Support drydrop add <module> on existing projects
  4. Plugin System

    • Define Hook traits
    • Implement a simple example plugin
  5. Registry

    • Local template index
    • Later: remote repository support
  6. TUI / Desktop

    • Interactive module selection UI

πŸ“ Directory Responsibilities (Quick Reference)

Path Responsibility
apps/cli CLI entry point + subcommand implementations
crates/drydrop-core Domain models (prefer immutable data)
crates/drydrop-vfs In-memory file tree + merge logic
crates/drydrop-generator Generation orchestration (most complex core)
crates/drydrop-template Template abstraction and loading
crates/drydrop-render Concrete renderer (Askama)
crates/drydrop-registry Distribution of templates/modules/plugins
crates/drydrop-plugin Extension points and lifecycle hooks
crates/drydrop-fs Disk I/O + backup
crates/drydrop-diff Diff & patch (for incremental updates)
templates/ Built-in template sources

🀝 Contributing

Contributions of any kind are welcome! At this stage, the most valuable contributions include:

  • Implementing core logic in any crate
  • Writing the first working Askama template
  • Designing and implementing the module dependency resolver
  • Adding tests and documentation

Before submitting a PR, please ensure:

cargo check --workspace
cargo test --workspace
cargo clippy --workspace -- -D warnings

πŸ“„ License

MIT Β© 2026 NotNOne


πŸ”— Related Resources

  • Askama β€” Type-safe template engine
  • Clap β€” Command line argument parsing
  • Snafu β€” Error handling

Note: This project is in an early design and scaffolding phase. The README will be updated continuously as implementation progresses. Before developing, it's recommended to first explore the module layout and public APIs of the relevant crates.


Chinese Documentation: See Docs/README_zh_CN.md

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages