# rishad13/rust-practice-projects architecture

> Architecture diagram of the GitHub repository rishad13/rust-practice-projects, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rishad13/rust-practice-projects
- Repository: https://github.com/rishad13/rust-practice-projects

## Overview

##### Project Type and Purpose
- Review the README: It explains that each folder represents a unique Rust project focused on specific Rust concepts such as ownership, concurrency, modules, web development, and security.
- Recognize the diversity: Some projects (like notes_api and expense_tracker) have web or database elements and are more “full-stack” in nature, whereas others (like number_guessing_game, reversed_string, string_split_iterator, word_frequency_counter) are self-contained command-line or algorithm-focused utilities.

##### File Structure
- Look at Folder Names:
– For example, the “notes_api” project has directories like entity, migration, routes, and utils. These indicate a web API with data models (entity), database migration support (migration), request handling (routes), and common utility functionality (utils).
– Similarly, the “database” project contains Cargo.toml, a main and lib file, and well-organized utility submodules—suggesting it’s designed as a library or service layer for database operations.
- Notice Patterns:
– Many projects have a clear separation of concerns via modules (e.g., routes, models, utils in notes_api or expense functions in expense_tracker). This suggests an architectural pattern where you logically isolate business logic, data models, and external communication.
- Build & Configuration Files:
– Each Rust project has its own Cargo.toml, which confirms they are independent crates.
– Environment files (like in notes_api: “.env”) imply configuration management for deployment or local development.

- Out the entry point (e.g., main.rs) and trace the module imports to see which parts call or depend on others.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Notes API Project
    subgraph "Notes API"
        notesEntry["Notes API: API Entry Point"]:::rust
        routeHandlers["Notes API: Route Handlers"]:::rust
        entities["Notes API: Data Modeling/Entities"]:::rust
        migration["Notes API: Database Migration & Configuration"]:::db
        utils["Notes API: Utilities & Shared Services"]:::rust
        notesEntry -->|"handles"| routeHandlers
        routeHandlers -->|"uses"| entities
        routeHandlers -->|"calls"| utils
        entities -->|"interacts"| migration
    end

    %% Expense Tracker Project
    subgraph "Expense Tracker"
        expenseMain["Expense Tracker: Main Program Entry & Business Logic"]:::rust
        expenseFn["Expense Tracker: Expense Functions"]:::rust
        expenseMain -->|"executes"| expenseFn
    end

    %% Database Project
    subgraph "Database Project"
        dbLib["Database Project: Library/Service Layer"]:::db
        dbUtils["Database Project: Database Utilities"]:::db
        dbLib -->|"utilizes"| dbUtils
    end

    %% Password Manager Project
    subgraph "Password Manager"
        pmMain["Password Manager: CLI Entry & Application Logic"]:::rust
        pmCli["Password Manager: CLI Logic"]:::rust
        pmModel["Password Manager: Data Models"]:::rust
        pmUtils["Password Manager: Encryption Utilities"]:::rust
        pmMain -->|"executes"| pmCli
        pmMain -->|"uses"| pmModel
        pmMain -->|"calls"| pmUtils
    end

    %% Number Guessing Game Project
    subgraph "Number Guessing Game"
        ngMain["Number Guessing Game: Command-Line Utility"]:::rust
    end

    %% Click Events for Notes API
    click notesEntry "https://github.com/rishad13/rust-practice-projects/blob/main/notes_api/src/main.rs"
    click routeHandlers "https://github.com/rishad13/rust-practice-projects/tree/main/notes_api/src/routes"
    click entities "https://github.com/rishad13/rust-practice-projects/tree/main/notes_api/entity"
    click migration "https://github.com/rishad13/rust-practice-projects/tree/main/notes_api/migration"
    click utils "https://github.com/rishad13/rust-practice-projects/tree/main/notes_api/src/utils"

    %% Click Events for Expense Tracker
    click expenseMain "https://github.com/rishad13/rust-practice-projects/blob/main/expense_tracker/src/main.rs"
    click expenseFn "https://github.com/rishad13/rust-practice-projects/tree/main/expense_tracker/src/expense"

    %% Click Events for Database Project
    click dbLib "https://github.com/rishad13/rust-practice-projects/tree/main/database/src"
    
    %% Click Events for Password Manager
    click pmMain "https://github.com/rishad13/rust-practice-projects/blob/main/password_manager/src/main.rs"
    click pmCli "https://github.com/rishad13/rust-practice-projects/blob/main/password_manager/src/cli.rs"
    click pmModel "https://github.com/rishad13/rust-practice-projects/tree/main/password_manager/src/models"
    click pmUtils "https://github.com/rishad13/rust-practice-projects/tree/main/password_manager/src/utils"

    %% Click Event for Number Guessing Game
    click ngMain "https://github.com/rishad13/rust-practice-projects/blob/main/number_guessing_game/src/main.rs"

    %% Styles
    classDef rust fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef db fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
```
