Yoda/README.md

114 lines
4.3 KiB
Markdown
Raw Normal View History

2024-09-18 20:39:03 +03:00
# Yoda - Browser for [Gemini protocol](https://geminiprotocol.net)
2024-10-11 22:45:00 +03:00
GTK 4 / Libadwaita client written in Rust
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-12 04:24:17 +03:00
### Requirements
2024-10-10 16:17:59 +03:00
2024-10-12 04:24:17 +03:00
Make sure your system support:
2024-10-10 22:26:09 +03:00
2024-10-13 01:22:00 +03:00
* Glib 2.56+
2024-10-13 08:52:53 +03:00
* GTK 4.10+
2024-10-13 20:41:10 +03:00
* Libadwaita 1.6+
2024-10-10 22:26:09 +03:00
2024-10-12 04:25:34 +03:00
Use [rustup](https://rustup.rs) installer to setup latest Rust compiler and Cargo 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
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-10-12 04:31:06 +03:00
Quick start guide and maintenance protocol
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-12 07:10:56 +03:00
* have common for application names: `from`, `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-12 04:24:17 +03:00
* Structure of table should not be modified on `CARGO_PKG_VERSION_PATCH` change
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
* Currently, profile data stored in separated sub-directories, auto-created on every `CARGO_PKG_VERSION_MAJOR` or/and `CARGO_PKG_VERSION_MINOR` change