2024-09-18 20:39:03 +03:00
# Yoda - Browser for [Gemini protocol](https://geminiprotocol.net)
2024-09-18 20:52:52 +03:00
Rust / GTK 4 implementation
2024-09-18 20:39:03 +03:00
> [!IMPORTANT]
> Project in development!
2024-09-18 20:51:18 +03:00
>
2024-10-11 05:21:55 +03:00
![image ](https://github.com/user-attachments/assets/cfbbc3fb-61d2-4afd-a21f-8e36ee329941 )
2024-10-10 16:17:59 +03:00
## Build
2024-09-18 20:51:18 +03:00
2024-10-10 16:17:59 +03:00
### Dependencies
2024-10-10 22:26:09 +03:00
Make sure system support:
* GTK 4.8+
* Libadwaita 1.4+
Use [rustup installer ](https://rustup.rs ) to setup latest Rust compiler and package manager:
2024-10-10 16:17:59 +03:00
``` bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
#### Debian
_todo_
#### Fedora
``` bash
sudo dnf install git gcc\
cairo-devel glib2-devel gtk4-devel libadwaita-devel pango-devel\
sqlite-devel
```
### Install
#### Stable
2024-09-20 17:54:28 +03:00
``` bash
cargo install Yoda
```
2024-10-10 16:17:59 +03:00
#### Repository
2024-09-19 13:23:28 +03:00
``` bash
git clone https://github.com/YGGverse/Yoda.git
cd Yoda
git checkout Rust-GTK4
2024-10-10 16:17:59 +03:00
cargo build
2024-09-19 13:23:28 +03:00
```
2024-09-23 14:26:24 +03:00
## Development
2024-09-27 23:00:20 +03:00
Guide and protocol draft
2024-09-23 14:26:24 +03:00
2024-09-27 23:00:20 +03:00
### `browser`
2024-09-23 14:26:24 +03:00
2024-09-27 23:00:20 +03:00
#### Filesystem
2024-09-23 14:26:24 +03:00
2024-09-27 22:35:53 +03:00
* Use [modern path pattern ](https://doc.rust-lang.org/edition-guide/rust-2018/path-changes.html#no-more-modrs )
* One module implements one GTK widget, it may include additional helper files in same location (like template, CSS or DB API)
2024-09-27 22:37:53 +03:00
* For children widget - create children module, located according to hierarchy
2024-09-27 23:00:20 +03:00
#### Codebase
2024-10-04 03:35:44 +03:00
* Every module should be as minimal as possible, separate:
2024-09-27 22:35:53 +03:00
* different tasks
* massive structures
* structures with implementation
2024-09-26 00:29:08 +03:00
* Every module must:
2024-09-27 23:00:20 +03:00
* encapsulate it members: compose childs and stay composable for parents
* access 1 level of childs, never parents (e.g. through `super` )
2024-10-04 03:27:46 +03:00
* implement only one public API `struct` per file (same as one file for one class)
2024-10-02 02:21:20 +03:00
* implementable `struct` is public, where it members - private
2024-09-27 20:49:44 +03:00
* contain main `struct` implementation:
2024-10-03 01:30:13 +03:00
* at least one constructor that must:
2024-10-08 06:38:37 +03:00
* have common for application name: `new` or/and `new_arc` , `new_mutex` , etc - on return object in container
2024-10-03 01:30:13 +03:00
* grant ownership for new `Self` object created
2024-10-04 03:27:46 +03:00
* public `activate` action if the new object can not be activated on construct
2024-10-04 03:34:01 +03:00
* public `link` getter for GTK `widget` (parental composition)
2024-09-28 01:29:05 +03:00
* Public API oriented to simple (`integer` , `boolean` ), standard (`std::*` ) or system-wide (`gio` , `glib` , etc) data types usage to reduce internal dependencies from app implementation
2024-10-05 15:59:12 +03:00
#### Database
2024-10-05 16:01:25 +03:00
* [SQLite ](https://sqlite.org ) used to operate with user profile: for example, restore and save widget sessions, manage auth, history, bookmarks, etc
* Database stored in system config directory (could be detected simply using browser tools menu)
2024-10-05 15:59:12 +03:00
* Every `browser` mod may have own table, where table must:
* contain same name as mod location, for example `app_browser_widget` for `src/app/browser/widget.rs`
* every table include autoincrement `id` column and parental primary ID if exist
* column name for parental ID must have absolute namespace prefix, for example `app_browser_id` column for `app_browser_widget` table. For example, if the table has few parental keys, column set could be `id` , `parent_one_id` , `parent_two_id` , `some_data`
2024-10-05 16:16:07 +03:00
* _todo_
2024-10-05 16:15:44 +03:00
* [ ] version control for auto-migrations
2024-10-06 00:43:35 +03:00
* [x] transactions support for update operations
2024-10-05 15:59:12 +03:00
2024-09-28 01:29:05 +03:00
#### GTK
2024-09-28 01:31:03 +03:00
* Operate with [action objects ](https://docs.gtk.org/gio/class.SimpleAction.html ) instead of names like `win.action` . This allows to follow encapsulation, by the our goal, module must know nothing about parent presets. For example, define some action in parent, then delegate object created as construction argument
2024-10-05 16:08:50 +03:00
* Started refactory on separate widgets implementation to separated mods, because widgets may contain own tables in database and require additional mods dependencies like ORM API _todo_
2024-09-26 00:29:08 +03:00
2024-09-23 14:26:24 +03:00
### Contribution
2024-10-08 07:42:10 +03:00
* Before commit, please make sure:
2024-09-23 14:26:24 +03:00
* new branch created for every new PR `git checkout -b 'contribution-name'`
* new code follows common [rustfmt ](https://rust-lang.github.io/rustfmt/ ) style `cargo fmt --check`
2024-10-08 07:42:10 +03:00
### Releases
2024-10-08 07:54:07 +03:00
* Package version in repository should be increased immediately after stable release on [crates.io ](https://crates.io/crates/yoda ) and before apply new changes
2024-10-08 07:48:48 +03:00
* Currently, profile data stored in separated sub-directory, for every new release version
2024-10-08 07:42:10 +03:00
2024-09-18 20:52:52 +03:00
## See also
2024-09-18 20:56:04 +03:00
* [CPP-GTK4 ](https://github.com/YGGverse/Yoda/tree/CPP-GTK4 ) - C++ / GTK 4 implementation
2024-10-11 05:21:55 +03:00
* [PHP-GTK3 ](https://github.com/YGGverse/Yoda/tree/PHP-GTK3 ) - PHP / GTK 3 experimental branch