Skip to content

Commit 15b4b2d

Browse files
committed
docs: Update README and CLAUDE.md for current architecture
- Remove all rusty-data references (crate deleted) - Update framework reference: GPUI -> Iced - Add arni as database access layer in architecture docs - Add module map, icon usage guide, CI notes - Update supported databases (MongoDB/SQL Server now fully supported) - Update build commands and local CI instructions
1 parent 7a2ce78 commit 15b4b2d

2 files changed

Lines changed: 104 additions & 108 deletions

File tree

CLAUDE.md

Lines changed: 67 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,111 +4,104 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
rusty-app is a universal database tool written in Rust using GPUI. The goal is to create a powerful, cross-platform database management application that supports multiple database systems with a modern, performant UI. In spirit similar to universal database tools like DBeaver, but with its own approach and identity.
8-
9-
## System Requirements
10-
11-
### All Platforms
12-
- Rust toolchain (stable)
13-
- Platform-specific graphics drivers for GPU acceleration (Iced uses wgpu)
7+
rusty-app is a universal database tool written in Rust using [Iced](https://github.com/iced-rs/iced). The goal is a powerful, cross-platform database management application supporting multiple database systems with a modern, performant UI — similar in spirit to DBeaver but with its own identity.
148

159
## Common Commands
1610

1711
```bash
18-
# Build the project
19-
cargo build
20-
21-
# Run the application
12+
# Build and run
2213
cargo run
2314

24-
# Check for errors without building
15+
# Check for errors (fast)
2516
cargo check
2617

27-
# Run linter
28-
cargo clippy
18+
# Lint (CI-equivalent — all warnings are errors)
19+
cargo clippy --features postgres,mysql,sqlite,mongodb,mssql -- -D warnings
2920

30-
# Format code
21+
# Format
3122
cargo fmt
3223

33-
# Run tests
34-
cargo test
24+
# Test
25+
cargo test --features postgres,mysql,sqlite,mongodb,mssql
26+
27+
# Full local CI check (mirrors GitHub Actions exactly)
28+
bash scripts/ci-check.sh
3529
```
3630

31+
> **Note**: Oracle requires native Oracle Instant Client libraries. Omit `oracle` from `--features` if not installed. The `default` feature set includes oracle; CI excludes it.
32+
3733
## Architecture
3834

3935
### UI Framework: Iced
4036

41-
The application uses Iced, a cross-platform GUI library which provides:
42-
- GPU-accelerated rendering via wgpu for high performance
43-
- Elm-inspired architecture with declarative UI
44-
- Clean, modern aesthetic suitable for polished applications
45-
- Native feel with cross-platform support (Windows, macOS, Linux)
37+
- GPU-accelerated rendering via wgpu
38+
- Elm-inspired architecture: `Message` enum → `update()``view()`
39+
- Declarative, stateless view functions
40+
- Cross-platform: macOS, Linux, Windows
4641

47-
### Target Database Systems
42+
### Database Access: arni
4843

49-
Priority support for:
50-
- **PostgreSQL** - Full-featured relational database
51-
- **MySQL/MariaDB** - Popular open-source RDBMS
52-
- **SQLite** - Embedded database for local files
53-
- **MongoDB** - Document-oriented NoSQL
54-
- **Redis** - In-memory data structure store
55-
- **SQL Server** - Microsoft's enterprise database (future)
44+
All database I/O goes through the [arni](https://github.com/aaroncroberts/arni) library via the `DbAdapter` trait. rusty-app never talks to databases directly.
5645

57-
### Core Modules (Planned Architecture)
46+
- `connection_manager.rs` — owns `ActiveConnection` (wraps `Arc<Mutex<Box<dyn DbAdapter>>>`)
47+
- `make_adapter()` — feature-gated factory dispatching to arni's per-database adapters
48+
- Supported: PostgreSQL, MySQL, SQLite, MongoDB, SQL Server, Oracle
5849

59-
- **Connection Manager** - Handle database connections, credential storage, connection pooling
60-
- **Query Editor** - SQL/query editor with syntax highlighting, autocomplete, execution
61-
- **Result Viewer** - Display query results in grid/table format with pagination
62-
- **Schema Browser** - Tree view of databases, tables, columns, indexes, relationships
63-
- **Data Editor** - In-place editing of table data
64-
- **Query History** - Track and replay previous queries
65-
- **Export/Import** - Data migration tools for various formats (CSV, JSON, SQL)
50+
### Module Map
6651

67-
### Layout Structure (Planned)
52+
| Module | Purpose |
53+
|---|---|
54+
| `main.rs` | App entry point, `DatabaseIDE` state, `Message` enum, `update()`, `view()` |
55+
| `connection_manager.rs` | Active connections, `ActiveConnection`, `ConnectionManager` |
56+
| `left_panel.rs` | Collapsible left panel with tab bar (28px icon rail when collapsed) |
57+
| `components/` | Reusable UI components: `ServerListComponent`, `TableListComponent`, `PropertiesComponent`, `ConnectionFormComponent` |
58+
| `icons.rs` | Nerd Font (Codicons) icon helpers — all icon functions return `String` glyphs |
59+
| `theme.rs` | `ThemeColors` struct — Tokyo Night Storm palette |
60+
| `button_styles.rs` | Shared button style helpers (`primary`, `secondary`, `danger`, `disabled`) |
61+
| `settings/` | User settings, persistence, `SettingsManager` |
62+
| `container/` | Podman container management for local dev databases |
63+
| `views.rs` | `ViewRegistry` — maps `RegionId` to enabled components |
64+
65+
### Layout
6866

6967
```
70-
┌─────────────────────────────────────────────┐
71-
│ Menu Bar & Toolbar │
72-
├──────────┬──────────────────┬───────────────┤
73-
│ │ │ │
74-
│ Database │ Query Editor │ Auxiliary │
75-
│ Navigator│ or │ Panel │
76-
│ (Tree) │ Result Grid │ │
77-
│ │ │ │
78-
└──────────┴──────────────────┴───────────────┘
68+
┌──────────────────────────────────────────┐
69+
│ Menu Bar │
70+
├──────────┬───────────────────────────────┤
71+
│ │ │
72+
│ Left │ Main Panel │
73+
│ Panel │ (Query Editor / Results) │
74+
│ (tabs) │ │
75+
│ │ │
76+
└──────────┴───────────────────────────────┘
77+
│ Status Bar │
78+
└──────────────────────────────────────────┘
7979
```
8080

81-
### Key Design Principles
81+
The left panel collapses to a 28px icon rail (`left_panel::ICON_RAIL_WIDTH`). Toggle via `Message::ToggleLeftPanel`.
8282

83-
1. **Async-First** - All database operations use `tokio` for non-blocking I/O
84-
2. **Connection Pooling** - Efficient connection management per database
85-
3. **Plugin Architecture** - Each database driver is a separate module with a common trait
86-
4. **Result Streaming** - Handle large result sets without loading everything into memory
87-
5. **Cross-Platform** - Support macOS, Linux, and Windows
83+
### Icons
8884

89-
## Development Workflow
85+
```rust
86+
use rusty_app::icons;
87+
text(icons::database()).font(icons::font()).size(14).color(theme.accent)
88+
```
9089

91-
### Adding a New Database Driver
90+
Font must be registered at app startup via `.font(icons::FONT_BYTES)` on the iced application builder (already wired in `main.rs`).
9291

93-
1. Create module in `src/drivers/` (e.g., `postgres.rs`)
94-
2. Implement the `DatabaseDriver` trait
95-
3. Add connection string parsing
96-
4. Implement query execution and result mapping
97-
5. Add schema introspection queries
92+
### Key Design Principles
9893

99-
### GPUI Component Pattern
94+
1. **Async-First** — All database operations are `async`, driven by `tokio`
95+
2. **Adapter trait**`DbAdapter` from arni; swap databases without changing UI code
96+
3. **Feature flags** — Each database adapter is a Cargo feature; oracle excluded from CI
97+
4. **No dead code in CI**`clippy -D warnings` is enforced; all warnings are errors
10098

101-
Components in GPUI:
102-
- Define state using structs
103-
- Implement rendering via the `Render` trait
104-
- Use actions for user interactions
105-
- Leverage reactive updates when state changes
99+
## CI
106100

107-
## Dependencies (Current/Planned)
101+
GitHub Actions runs on every push and PR to `main`:
102+
- `cargo fmt --check`
103+
- `cargo check`
104+
- `cargo clippy -- -D warnings`
105+
- `cargo test`
108106

109-
- **iced** - Cross-platform GUI framework with GPU acceleration
110-
- **tokio** - Async runtime for database operations
111-
- **serde / serde_json** - Serialization for configuration files
112-
- **mongodb** - MongoDB Rust driver (planned)
113-
- **sqlx** - SQL database driver with compile-time query checking (planned)
114-
- **redis** - Redis client (planned)
107+
Oracle excluded from CI (requires native OCI libs not available on runners).

README.md

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,74 @@
11
# rusty-app
22

3-
Universal database management tool written in Rust with GPUI.
3+
Universal database management tool written in Rust using [Iced](https://github.com/iced-rs/iced).
44

55
## Overview
66

7-
rusty-app is a cross-platform database tool that provides a modern interface for managing multiple database systems. Built with Rust and GPUI for performance and a native feel.
7+
rusty-app is a cross-platform desktop application for managing multiple database systems. It provides a modern, GPU-accelerated UI built with Iced and delegates all database access to the [arni](https://github.com/aaroncroberts/arni) library.
88

99
## Project Structure
1010

1111
```
1212
rusty-app/
1313
├── rusty-app/ # UI application crate
14-
├── rusty-data/ # Data access library crate
15-
│ ├── src/
16-
│ │ ├── adapters/ # Database adapters (PostgreSQL, MySQL, SQLite)
17-
│ │ ├── adapter.rs # DatabaseAdapter trait
18-
│ │ ├── config.rs # Configuration management
19-
│ │ └── error.rs # Error types
20-
│ └── podman-compose.yml # Database testing containers
14+
│ └── src/
15+
│ ├── components/ # Reusable UI components (ServerList, TableList, Properties, ...)
16+
│ ├── container/ # Podman container management for local dev databases
17+
│ ├── settings/ # Configuration and user preferences
18+
│ ├── icons.rs # Nerd Font (Codicons) icon helpers
19+
│ ├── theme.rs # Color theme (dark mode)
20+
│ └── main.rs # Application entry point
21+
├── rusty-logging/ # Structured logging configuration crate
22+
├── scripts/
23+
│ └── ci-check.sh # Local CI verification script
2124
└── docs/ # Documentation
22-
├── README.md # Documentation overview
23-
└── database/ # Database-specific docs
24-
└── testing.md # Testing environment setup
2525
```
2626

2727
## Supported Databases
2828

29-
- **PostgreSQL** - Full-featured relational database
30-
- **MySQL/MariaDB** - Popular open-source RDBMS
31-
- **SQLite** - Embedded database for local files
32-
- **MongoDB** - Document-oriented NoSQL (planned)
33-
- **SQL Server** - Microsoft's enterprise database (planned)
29+
| Database | Status |
30+
|---|---|
31+
| PostgreSQL | ✅ Supported |
32+
| MySQL / MariaDB | ✅ Supported |
33+
| SQLite | ✅ Supported |
34+
| MongoDB | ✅ Supported |
35+
| SQL Server | ✅ Supported |
36+
| Oracle | ✅ Supported (requires Oracle Instant Client) |
3437

3538
## Getting Started
3639

3740
### Prerequisites
3841

39-
- Rust (latest stable)
40-
- Xcode Command Line Tools (macOS)
41-
- Metal Toolchain (macOS, for GPUI GPU acceleration)
42-
- Podman (for database testing containers)
42+
- Rust stable toolchain
43+
- macOS: Xcode Command Line Tools
4344

4445
### Build and Run
4546

4647
```bash
47-
# Build the project
48-
cargo build
49-
50-
# Run the application
48+
# Build and run (all adapters including Oracle)
5149
cargo run
5250

53-
# Run tests
54-
cargo test
51+
# Build without Oracle (no Instant Client required)
52+
cargo run --no-default-features --features postgres,mysql,sqlite,mongodb,mssql
5553

56-
# Run tests with database features
57-
cargo test --features all-databases
54+
# Run tests
55+
cargo test --features postgres,mysql,sqlite,mongodb,mssql
5856
```
5957

60-
### Database Testing Environment
58+
### Local CI Check
59+
60+
Mirrors the GitHub Actions CI pipeline exactly:
61+
62+
```bash
63+
bash scripts/ci-check.sh
64+
```
6165

62-
See [Database Testing Documentation](docs/database/testing.md) for setting up local database containers using podman-compose.
66+
Runs: `cargo fmt --check``cargo check``cargo clippy -D warnings``cargo test`.
6367

6468
## Documentation
6569

66-
- **[Documentation Index](docs/README.md)** - Complete documentation overview
67-
- **[Database Testing](docs/database/testing.md)** - Setup testing databases
68-
- **[CLAUDE.md](CLAUDE.md)** - Guidelines for AI assistants working with this codebase
70+
- **[CLAUDE.md](CLAUDE.md)** — Architecture notes and development guidelines
71+
- **[docs/](docs/)** — Additional documentation
6972

7073
## License
7174

0 commit comments

Comments
 (0)