From 17682ceba150104e86cbba576b733516803182a9 Mon Sep 17 00:00:00 2001 From: Jakub Olan Date: Tue, 31 Dec 2024 12:30:02 +0100 Subject: [PATCH] update application name to `neuronek` merge side-project which was intented to build small dosage tracker into main branch of project. since now `psylog` will be developed as `neuronek` as fundamentally it's the same thing. Enough research on `psylog` was made to be implemented into `neuronek` --- .github/workflows/main.yaml | 2 + .github/workflows/release.yml | 2 +- .mise.toml | 2 + Cargo.toml | 6 +- README.md | 64 ++--- dist-workspace.toml | 2 +- src/lib/mod.rs | 2 +- src/main.rs | 17 +- tests/log_ingestion.rs | 2 +- tests/update_ingestion.rs | 4 +- wix/main.wxs | 456 +++++++++++++++++----------------- 11 files changed, 275 insertions(+), 284 deletions(-) create mode 100644 .mise.toml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7091e0f4..e5e5e8d5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -5,6 +5,7 @@ on: branches: - main - next + - trunk - release/* - feature/* - bugfix/* @@ -14,6 +15,7 @@ on: branches: - next - main + - trunk - release/* - feature/* - bugfix/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2937408e..c82de444 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -280,7 +280,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - repository: "keinsell/psylog" + repository: "keinsell/neuronek" token: ${{ secrets.HOMEBREW_TAP_TOKEN }} # So we have access to the formula - name: Fetch homebrew formulae diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 00000000..bc64ee04 --- /dev/null +++ b/.mise.toml @@ -0,0 +1,2 @@ +[tools] +rust = "nightly" diff --git a/Cargo.toml b/Cargo.toml index fad66453..0b816b7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,15 @@ cargo-features = ["edition2024"] [package] -name = "psylog" +name = "neuronek" description = "🧬 Intelligent dosage tracker application for monitoring supplements, nootropics and psychoactive substances along with their long-term influence on one's mind and body." authors = ["Jakub Olan "] version = "0.0.0-dev.5" edition = "2024" -repository = "https://github.com/keinsell/psylog" +repository = "https://github.com/keinsell/neuronek" [[bin]] -name = "psylog" +name = "neuronek" path = "src/main.rs" [package.metadata.wix] diff --git a/README.md b/README.md index f63f1846..62d8e839 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Psylog +# Neuronek 🧬 Intelligent dosage tracker application for monitoring supplements, nootropics and psychoactive substances along with their long-term influence on one's mind and body. @@ -7,20 +7,15 @@ their long-term influence on one's mind and body. ## About -Psylog is an intelligent dosage tracking application designed to monitor and log the use of supplements, nootropics, and -psychoactive substances. By recording and analyzing ingestions, it helps users better understand the long-term effects +Neuronek is an intelligent dosage tracking application designed to monitor and log the use of supplements, nootropics, and +psychoactive substances. By recording and analyzing ingestion, it helps users better understand the long-term effects of these compounds on their physical and mental health. -The project originated as a streamlined, minimal viable product (MVP), branching out from -the [Neuronek](https://github.com/keinsell/neuronek) project. While Neuronek focuses on broader neurological insights, -Psylog provides a laser-focused solution for personal consumption tracking and journaling, offering a simple yet robust -interface to build meaningful reports and integrations. - ## Getting Started ### Installation -To install the application, please visit the [GitHub Releases Page](https://github.com/keinsell/psylog/releases) for +To install the application, please visit the [GitHub Releases Page](https://github.com/keinsell/neuronek/releases) for pre-built binaries and installation instructions for your platform. Alternatively, you can install the application from supported package managers or build it from source. @@ -36,17 +31,17 @@ supported package managers or build it from source. [//]: # (|----------------------------|-----------------|------------------------------------|) -[//]: # (| **macOS** | Homebrew | `brew install keinsell/tap/psylog` |) +[//]: # (| **macOS** | Homebrew | `brew install keinsell/tap/neuronek` |) -[//]: # (| **Windows** | Scoop | `scoop install psylog` |) +[//]: # (| **Windows** | Scoop | `scoop install neuronek` |) -[//]: # (| **Linux (Debian/Ubuntu)** | APT | `apt install psylog` |) +[//]: # (| **Linux (Debian/Ubuntu)** | APT | `apt install neuronek` |) -[//]: # (| **Linux (Arch Linux)** | Pacman | `pacman -S psylog` |) +[//]: # (| **Linux (Arch Linux)** | Pacman | `pacman -S neuronek` |) -[//]: # (| **Linux (Fedora/CentOS)** | DNF | `dnf install psylog` |) +[//]: # (| **Linux (Fedora/CentOS)** | DNF | `dnf install neuronek` |) -[//]: # (| **Linux/NixOS/nix-darwin** | Nix | `dnf install psylog` |) +[//]: # (| **Linux/NixOS/nix-darwin** | Nix | `dnf install neuronek` |) #### Installation from source (Advanced) @@ -54,7 +49,7 @@ Application can be installed with `cargo` and providing url to this repository, this may be the most conformable way for users which are looking for the latest version of application. ``` -cargo install --git https://github.com/keinsell/psylog +cargo install --git https://github.com/keinsell/neuronek ``` **Note:** This method might be best for users who always want the absolute newest version of the application. However, @@ -90,7 +85,7 @@ This data is stored in a low-level database that serves as the foundation for fu such as journaling, analytics, or integrations with external tools. While power users may prefer to work directly with this raw data, many user-friendly abstractions are planned to make this process seamless, -such as simplified commands (e.g., `psylog a coffee`) for quicker entries. +such as simplified commands (e.g., `neuronek a coffee`) for quicker entries. Logging ingestions not only serves the purpose of record-keeping but also helps users build a personalized database of their consumption habits. @@ -100,7 +95,7 @@ providing insights into the long-term effects of different substances on physica An example usage of the `log ingestion` feature is shown below: ```bash -❯ psylog ingestion log caffeine 80mg +❯ neuronek ingestion log caffeine 80mg +----+----------------+--------+----------------------+-------------------------------+ | id | substance_name | route | dosage | ingested_at | @@ -123,7 +118,7 @@ ensuring that users stay informed about their habits and their long-term impact ##### List Ingestions ```bash -❯ psylog ingestion list +❯ neuronek ingestion list +----+----------------+---------------+----------------------+----------------------------+ | id | substance_name | route | dosage | ingested_at | @@ -148,7 +143,7 @@ except `id` and `created_at` can be updated, providing flexibility in maintainin useful when correcting data entry errors or adding additional information to an existing record. Users can update ingestions using the following command structure: -```psylog ingestion update [options]``` +```neuronek ingestion update [options]``` Available update options: @@ -158,7 +153,7 @@ Available update options: - `-t, --time`: Adjust the ingestion timestamp (can be represented in a relative format eg. "now" or "1 hour ago") ```bash -❯ psylog ingestion list +❯ neuronek ingestion list +----+----------------+---------------+----------------------+----------------------------+ | id | substance_name | route | dosage | ingested_at | @@ -183,14 +178,14 @@ unique ID. Here's how it works: Command syntax: ``` -psylog ingestion delete +neuronek ingestion delete ``` Example usage: ```bash # View current ingestions -❯ psylog ingestion list +❯ neuronek ingestion list +----+----------------+--------+----------+----------------------------+ | id | substance_name | route | dosage | ingested_at | +----+----------------+--------+----------+----------------------------+ @@ -198,7 +193,7 @@ Example usage: +----+----------------+--------+----------+----------------------------+ # Delete ingestion with ID 36 -❯ psylog ingestion delete 36 +❯ neuronek ingestion delete 36 ``` The command removes the specified ingestion record permanently. Verify deletion by running `psylog ingestion list` @@ -234,26 +229,19 @@ friendly human interface. *Roadmap is a subject to change and one that is presented here is a high-level overview of direction of the project.* -Psylog is an ongoing project with many planned features and improvements. Some of the key areas of development include: +neuronek is an ongoing project with many planned features and improvements. Some of the key areas of development include: - **Journaling**: A user-friendly interface for creating and managing journal entries related to ingestions, thoughts, and experiences. -- **Analytics**: Advanced data analysis tools to help users visualize trends, patterns, and correlations in their - consumption habits. -- **Integrations**: Seamless integration with external tools, APIs, and services to enhance the user experience and - provide additional insights. -- **Customization**: Personalization options for tailoring the application to individual preferences, such as themes, - layouts, and data views. -- **Security**: Enhanced security features to protect user data and ensure privacy, including encryption, - authentication, and access controls. -- **Cloud Sync**: Synchronization capabilities for storing data in the cloud and accessing it across multiple devices or - platforms. +- **Terminal User Interface**: Friendly and efficient interactive interface for terminal application. +- **Web Application** +- **Desktop/Mobile Application** +- **Cloud Sync** + ## Contributing -Project do not expect any external contribution. If you want to contribute, please take a look -at [keinsell/neuronek](https://github.com/keinsell/neuronek) -project or contact me directly via [keinsell@protonmail.com]() and we can discuss the project together and move code to +Project do not expect any external contribution. If you want to contribute, please contact me directly via [keinsell@protonmail.com]() and we can discuss the project together and move code to organization out of my profile. See [CONTRIBUTING.md](CONTRIBUTING.md) for more information. diff --git a/dist-workspace.toml b/dist-workspace.toml index 08325131..c4c69e90 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -10,7 +10,7 @@ ci = "github" # The installers to generate for each app installers = ["shell", "powershell", "homebrew", "msi"] # A GitHub repo to push Homebrew formulas to -tap = "keinsell/psylog" +tap = "keinsell/neuronek" # Target platforms to build apps for (Rust target-triple syntax) targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"] # Path that installers should place binaries in diff --git a/src/lib/mod.rs b/src/lib/mod.rs index 5a6189e8..652d0794 100644 --- a/src/lib/mod.rs +++ b/src/lib/mod.rs @@ -53,7 +53,7 @@ impl Default for Config if cfg!(test) || cfg!(debug_assertions) { - journal_path = temp_dir().join("psylog.sqlite"); + journal_path = temp_dir().join("neuronek.sqlite"); } info!("Using database file at: {}", journal_path.display()); diff --git a/src/main.rs b/src/main.rs index ffb5a0f4..fcd86e10 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,7 @@ lazy_static! { std::str::from_utf8(&Resources::get("small.flf").unwrap().data).unwrap() ) .unwrap(); - static ref FIGURE: figlet_rs::FIGure<'static> = FIGFONT.convert("psylog").unwrap(); + static ref FIGURE: figlet_rs::FIGure<'static> = FIGFONT.convert("neuronek").unwrap(); } fn default_output_format() -> OutputFormat { @@ -75,7 +75,7 @@ pub enum OutputFormat { fn default_complete_shell() -> clap_complete::Shell { - clap_complete::shells::Shell::from_env().unwrap() + clap_complete::shells::Shell::from_env().unwrap_or(clap_complete::Shell::Bash) } #[derive(Debug, Parser)] @@ -129,13 +129,15 @@ impl CommandHandler for ApplicationCommands } #[async_std::main] -async fn main() +async fn main() -> miette::Result<()> { setup_diagnostics(); setup_logger(); let cli = CLI::parse(); + migrate_database(&DATABASE_CONNECTION).await?; + // TODO: Perform a check of completion scripts existance and update them or install them // https://askubuntu.com/a/1188315 // https://github.com/scop/bash-completion#faq @@ -147,12 +149,9 @@ async fn main() output_format: cli.output_format, }; - migrate_database(context.database_connection) - .await - .expect("Database migration failed!"); - cli.command .handle(context) - .await - .expect("Failed to execute command!"); + .await?; + + Ok(()) } diff --git a/tests/log_ingestion.rs b/tests/log_ingestion.rs index 78028c62..bfb80a13 100644 --- a/tests/log_ingestion.rs +++ b/tests/log_ingestion.rs @@ -4,7 +4,7 @@ use std::process::Command; #[test] fn test_log_ingestion() -> Result<(), Box> { - let mut cmd = Command::cargo_bin("psylog")?; + let mut cmd = Command::cargo_bin("neuronek")?; cmd.arg("ingestion").arg("log").arg("caffeine").arg("100mg"); cmd.assert().success(); diff --git a/tests/update_ingestion.rs b/tests/update_ingestion.rs index fb8f81e1..9cac673d 100644 --- a/tests/update_ingestion.rs +++ b/tests/update_ingestion.rs @@ -4,11 +4,11 @@ use std::process::Command; #[test] fn test_update_ingestion() -> Result<(), Box> { - let mut cmd = Command::cargo_bin("psylog")?; + let mut cmd = Command::cargo_bin("neuronek")?; cmd.arg("ingestion").arg("log").arg("caffeine").arg("100mg"); cmd.assert().success(); - let mut cmd2 = Command::cargo_bin("psylog")?; + let mut cmd2 = Command::cargo_bin("neuronek")?; cmd2.arg("ingestion").arg("update").arg("1").arg("-d 200mg"); cmd2.assert().success(); diff --git a/wix/main.wxs b/wix/main.wxs index acefac04..f6de3b16 100644 --- a/wix/main.wxs +++ b/wix/main.wxs @@ -1,228 +1,228 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + + + + + + + + + + + + + + + + + +