π quick-arch
Universal Project Structure Generator built in Rust
Features β’ Installation β’ Usage β’ Configuration β’ Examples
Automate your scaffolding process using JSON templates with intelligent conditional logic.
π About
quick-arch is a blazing-fast Command Line Interface (CLI) tool built with Rust. It automates the process of creating project structures (scaffolding) by reading JSON configuration files. Whether you are building a FastAPI backend, a Flutter mobile app, or a complex Rust microservices architecture, quick-arch generates thousands of files and directories in seconds.
Why quick-arch?
- Blazing Fast: Built on Rust for maximum performance and zero runtime overhead.
- JSON Driven: Define your entire project structure in a simple, human-readable JSON file.
- Smart Conditions: Include or exclude files/directories based on architecture choices (e.g., CQRS, DDD).
- Zero Dependencies: A single binary executableβno need for Python, Node, or
jqinstalled on the target machine. - Cross-Platform: Works seamlessly on Linux, macOS, and Windows.
β¨ Key Features
- π― Flexible Templates: Support for any language or framework via JSON configuration.
- π§ Conditional Logic: Use simple equality checks within JSON to toggle features like Kubernetes, Docker, or specific design patterns.
- π Single Binary: Distribute and run anywhere without installation headaches.
- π¨ Beautiful Output: Color-coded terminal logs showing created vs. skipped items.
- π οΈ DevOps Ready: Generate Dockerfiles, Kubernetes manifests, and CI/CD pipelines out of the box.
- π€ Post-Creation Scripts: Automatically run shell commands (like
git initornpm install) after generation.
π¦ Installation
From Crates.io
Build from Source
The binary will be available at ./target/release/quick-arch.
π Included Templates
Note: If you installed
quick-archviacargo install, the templates are not included in the binary. You must clone the repository or download the JSON files manually to use them.
The repository includes several pre-configured templates inside the template/ directory. You can use these as-is or customize them for your needs.
Available templates:
template/fastapi.json: Complete FastAPI project with Clean Architecture, CQRS, DDD, and Docker support.template/rust.json: Advanced Rust backend (Axum/Tonic) with Workspace, Domain-Driven Design, and gRPC support.template/flutter.json: Clean architecture structure for Flutter apps.template/frontend.json: A generic modern frontend structure (React/Vue/Next.js) ready for TypeScript.
How to use an example:
# Clone the repo first to get the templates
# Generate a FastAPI project using the built-in template
# Generate a Rust backend
π Usage
Basic Usage
Generate a project using a configuration file:
Specify Output Directory
βοΈ Configuration
The power of quick-arch lies in its JSON configuration. Below is the complete structure supported by v1.0.
1. Project Metadata
Defines the basic info about the project.
2. Features (Variables)
Define flags that control what gets generated. These are the variables you will use in your conditions.
3. Directories
List directories to create. You can use simple strings or complex objects with conditions.
4. Files
List files to create. You can specify initial content inline.
5. Post-Creation Scripts
Define commands to run after the files and directories are generated.
- Linux/macOS: Commands run via
sh -c. - Windows: Commands run via
cmd /C. - Execution Directory: Commands run in the newly created project root.
π§ Condition Logic (v1.0)
How it Works
- Features to Uppercase: The tool automatically converts all feature keys in the JSON configuration to UPPERCASE internally.
- Comparison: When writing a condition, you must reference the variable in UPPERCASE.
- Operators: Currently, only the equality operator
==is supported.
Important: Comparison is case-insensitive for values (e.g., True, true, TRUE are all valid), but the variable name must match the uppercase key.
Syntax Examples
Assuming your JSON features are:
β Valid Conditions:
β Not Supported (yet):
// Complex logic (AND/OR) is not supported in v1.0
// Only == is supported
π Examples
Example 1: Microservices Architecture
β οΈ Known Limitations (v1.0)
- Logic Engine: Only supports basic equality checks (
==). Complex logic (&&,||,!=,>) is planned for v2.0. - Variable Interpolation: You cannot use variables inside file content (e.g.,
Created by ${PROJECT_NAME}) yet. - Templates: Not embedded in binary (must provide JSON file path).
π Troubleshooting
Issue: "Config file not found"
Cause: The path provided is incorrect or relative path issues. Solution:
# Use absolute path
# Or verify current directory
Issue: "Condition is not working"
Cause: Remember that variable names in conditions are converted to UPPERCASE. Solution:
- JSON:
"docker": true - Condition:
$DOCKER == trueβ - Condition:
$docker == trueβ
Issue: Script Failed
Cause: If you see red output during the "Running Scripts" phase, the command failed on your OS. Solution: Check the error message in the terminal. Verify the command syntax is correct for your operating system (Linux/macOS vs Windows) and run it manually in the project folder to debug.
π Roadmap
- v1.1: Support for nested conditions and boolean operators (
&&,||). - v1.2: Variable interpolation in file contents (e.g.,
${PROJECT_NAME}). - v2.0: Embedded templates (no need to clone repo).
- v2.0: Interactive mode (
quick-arch init). - v2.0: Flag to skip script execution (
--no-scripts).
π€ Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
π License
Distributed under the MIT License. See LICENSE for more information.
π€ Author
Abdullah Abdulkhaleq
- GitHub: @AbdullahNamespace
- Project: https://github.com/AbdullahNamespace/quick-arch