-
Notifications
You must be signed in to change notification settings - Fork 0
2) Folder structure
gust/
├── src/
│ ├── main.rs # Entry point that redirects to the appropriate command
│ ├── lib.rs # Global setup & re-exports
│ ├── core/ # Business logic (independent of CLI)
│ │ ├── blob.rs
│ │ ├── tree.rs
│ │ ├── hash.rs
│ │ ├── object.rs
│ │ └── ...
│ ├── commands/ # Porcelain & plumbing commands
│ │ ├── init.rs
│ │ ├── hash_object.rs
│ │ └── ...
│ ├── terminal/ # TUI Ratatui
│ │ ├── mod.rs
│ │ ├── app.rs
│ │ ├── run_app.rs
│ │ └── ui.rs
│ └── cli.rs # CLI argument parsing using `clap`
├── tests/ # Integration tests
│ ├── test_init.rs
│ └── ...
├── fixtures/ # Test data (used by integration tests)
├── .gitignore
├── Cargo.toml # Project configuration
└── README.md
It launches the program
It calls the CLI parser cli.rs, then sends to the right commands (commands/...)
It reads the arguments that the user types into the terminal (gust init, gust commit...)
Informs main.rs which command was invoked.
🧠 Think of it as the interpreter between the user and the code.
It contains all the actions the user will perform, all the commands the user will use, and is where the functions created in the core folder will be used
Each file corresponds to a command: init, add, commit...
🧠 It's like buttons on a machine: each button triggers a specific behavior
Contains generic, reusable logic: create Git objects, calculate hashes, manage indexes...
Never talk to the terminal! Just business functions
🧠 It's like the machine's internal engine
It contains everything about the TUI - Ratatui
This is where you call up and configure the commands you created earlier.
🧠 This is the graphical part of the project
main.rsis the controller,cli.rsanalyzes user commands,commands/executes actions, andcore/contains the real technical building blocks. Andterminal/is just the grafical part of the project.
Everything is modular, testable and easy to evolve.