Universal Project Structure Generator built in Rust
Features β’ Installation β’ Usage β’ Configuration β’ Examples
Automate your scaffolding process using JSON templates with intelligent conditional logic.
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.
- 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.
- π― 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.
cargo install quick-archgit clone https://github.com/AbdullahNamespace/quick-arch.git
cd quick-arch
cargo build --releaseThe binary will be available at ./target/release/quick-arch.
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
git clone https://github.com/AbdullahNamespace/quick-arch.git
cd quick-arch
# Generate a FastAPI project using the built-in template
quick-arch --config template/fastapi.json
# Generate a Rust backend
quick-arch --config template/rust.json --output ./my_rust_serverGenerate a project using a configuration file:
quick-arch --config path/to/config.jsonquick-arch --config rust.json --output ./my-rust-projectThe power of quick-arch lies in its JSON configuration. Below is the complete structure supported by v1.0.
Defines the basic info about the project.
{
"project": {
"name": "my_awesome_project",
"type": "rust", // or "fastapi", "flutter", etc.
"description": "A high performance backend"
}
}Define flags that control what gets generated. These are the variables you will use in your conditions.
{
"features": {
"cqrs": true,
"ddd": true,
"kubernetes": false
}
}List directories to create. You can use simple strings or complex objects with conditions.
{
"directories": [
"src", // Always created
{
"path": "k8s",
"condition": "$KUBERNETES == true"
// Only created if feature "kubernetes" is true
}
]
}List files to create. You can specify initial content inline.
{
"files": [
"README.md",
{
"path": "src/main.rs",
"content": "fn main() { println!(\"Hello World\"); }\n"
},
{
"path": "Dockerfile",
"condition": "$DOCKER == true"
}
]
}Define commands to run after the files and directories are generated.
{
"custom_scripts": {
"post_create": ["git init", "npm install", "cargo build"]
}
}- Linux/macOS: Commands run via
sh -c. - Windows: Commands run via
cmd /C. - Execution Directory: Commands run in the newly created project root.
- 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.
Assuming your JSON features are:
{ "kubernetes": false, "docker": true }β Valid Conditions:
{ "condition": "$KUBERNETES == true" }
{ "condition": "$DOCKER == 'yes'" }
{ "condition": "$AUTHENTICATION == false" }β Not Supported (yet):
// Complex logic (AND/OR) is not supported in v1.0
{ "condition": "$KUBERNETES == true && $DOCKER == true" }
// Only == is supported
{ "condition": "$KUBERNETES != false" }{
"project": {
"name": "microservices_platform"
},
"features": {
"user_service": true,
"payment_service": true,
"notification_service": false
},
"directories": [
"services",
{
"path": "services/user-service",
"condition": "$USER_SERVICE == true"
},
{
"path": "services/payment-service",
"condition": "$PAYMENT_SERVICE == true"
}
],
"files": [
{
"path": "docker-compose.yml",
"condition": "$USER_SERVICE == true",
"content": "version: '3.8'\nservices:\n ..."
}
]
}- 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).
Cause: The path provided is incorrect or relative path issues. Solution:
# Use absolute path
quick-arch --config /home/user/my_config.json
# Or verify current directory
ls -laCause: Remember that variable names in conditions are converted to UPPERCASE. Solution:
- JSON:
"docker": true - Condition:
$DOCKER == trueβ - Condition:
$docker == trueβ
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.
- 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).
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
Distributed under the MIT License. See LICENSE for more information.
Abdullah Abdulkhaleq
- GitHub: @AbdullahNamespace
- Project: https://github.com/AbdullahNamespace/quick-arch