Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 2.92 KB

DEVELOPMENT.md

File metadata and controls

91 lines (63 loc) · 2.92 KB

Development Notes and (some) Documentation

Table of Contents

Getting Started

  1. Make sure you have Rust installed.

  2. Clone the repository (or a fork)

git clone https://github.com/dezoito/ollama-grid-search.git
cd ollama-grid-search
  1. Install the frontend dependencies.

    cd <project root>
    # I'm using bun to manage dependencies,
    # but feel free to use yarn or npm
    bun install
  2. Make sure rust-analyzer is configured to run Clippy when checking code.

    If you are running VS Code, add this to your settings.json file

    {
       ...
       "rust-analyzer.check.command": "clippy",
    }

    (or, better yet, just use the settings file provided with the code)

  3. Run the app in development mode

    cd <project root>/
    bun tauri dev
  4. Go grab a cup of coffee because this may take a while.

Understanding the Project

Please refer to the workflow chart and sequence diagram to get a better understanding of how information is passed from one component to the other.

This is mostly focused on the React code, which drives the flow and interactions (whereas the Rust code is a bridge to the LLMs and Database).

App Workflow

App Workflow You can access the mermaid file for this workflow in the ./docs folder.

Sequence Diagram

Sequence Diagram

Database Migrations

The project uses SQLx for database operations. When making changes to the database schema, create new migration files in the migrations directory. These files are executed in order based on their timestamps. For more details about SQLx migrations, check out the Migrations Guide in the documentation.

Here's an example of a migration file that creates an experiments table:

-- migration_example.sql
CREATE TABLE IF NOT EXISTS experiments (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT NOT NULL,
    created TEXT NOT NULL,
    contents TEXT NOT NULL,
    experiment_uuid TEXT UNIQUE NOT NULL
);

CREATE INDEX IF NOT EXISTS idx_experiments_uuid ON experiments(experiment_uuid);

For more details on how we implemented SQLite in this application, check out this article: Rust - Embedding a SQLite database in a Tauri Application.

Getting Help

If you need help, or spot any inconsistencies in this documentation, please open a new issue.