Thanks to visit codestin.com
Credit goes to github.com

Skip to content

macOS app built with Rust, Tauri, and Vue for Professional Peptide Management & AI-Enhanced Literature Search

License

Notifications You must be signed in to change notification settings

cboyd0319/PepTrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PepTrack – Professional Peptide Management & Research Platform

A secure, privacy-first desktop application for peptide protocol tracking, dose logging, and research management.

PepTrack is a macOS-first desktop application built with Rust, Tauri, and Vue 3, featuring military-grade encryption, local AI integration, and comprehensive backup capabilities. All data stays local and encryptedβ€”no cloud dependency required.


🎯 Current Capabilities

Core Features

  • Protocol Management - Create and manage peptide protocols with detailed tracking
  • Dose Logging - Complete dose tracking with calendar views and history
  • Supplier & Inventory - Track suppliers, manage vial inventory with expiry dates and batch tracking
  • Literature Search - Integrated search across PubMed, OpenAlex, and Crossref APIs with automatic peptide filtering
  • Local AI Summaries - Generate research summaries using local Codex CLI (GPT-5) or Claude CLI with peptide-specific context
  • AI-Powered Risk Matrix Analysis - Multi-paper safety analysis extracting critical risks, moderate concerns, and study limitations
  • AI-Powered Protocol Recommender - Get science-backed protocol recommendations from research papers
  • Comprehensive Backup System:
    • Manual and scheduled automatic backups (hourly/daily/weekly)
    • Google Drive OAuth integration for cloud backups
    • Google Calendar integration for dose schedules
    • Backup compression, preview, and restore functionality
    • Automatic cleanup with configurable retention policies
  • Desktop Notifications - Configurable notifications for backup events
  • Enterprise-Grade Security:
    • ChaCha20-Poly1305 envelope encryption for all data
    • macOS Keychain integration for encryption keys
    • Automatic key migration from file-based storage
    • Zero telemetry or tracking

UI/UX Features

  • Enhanced Dashboard - Comprehensive analytics with multiple visualization widgets:
    • πŸ“… Dose Calendar Heatmap - GitHub-style 365-day adherence visualization with streak tracking
    • πŸ“Š Protocol Progress Tracker - Circular progress rings showing protocol completion and milestones
    • πŸ’° Cost Analysis Dashboard - Supplier comparison, spending analytics, and optimization tips
    • πŸ“‹ Recent Activity Timeline - Chronological feed of all user actions with date grouping
  • Global Search - Lightning-fast search across all data (Cmd+K or Cmd+P)
  • Keyboard Shortcuts - Power user shortcuts for navigation and actions:
    • Press ? to view all available shortcuts
    • 1-8 for quick tab navigation
    • Cmd+K for global search
    • Tab-specific shortcuts for common actions
  • Quick Actions FAB - Floating action button for one-click access to common tasks
  • Onboarding Flow - Interactive 8-step guided tour for new users
  • Dark Mode - Full dark mode support with toggle in settings
  • Empty States - Beautiful, actionable empty states throughout the app
  • Loading Skeletons - Smooth loading animations for better perceived performance

πŸ—οΈ Architecture Overview

System Architecture

graph TB
    subgraph "Frontend Layer"
        Vue[Vue 3 SPA<br/>TypeScript + Vite]
        Pinia[Pinia State Management<br/>5 Stores]
        Components[Vue Components<br/>30+ Components]
    end

    subgraph "Tauri Bridge"
        IPC[Tauri IPC Layer<br/>~40 Commands]
        Plugins[Tauri Plugins<br/>Log, Notification, Dialog]
    end

    subgraph "Backend Layer"
        Commands[Command Handlers<br/>11 Modules]
        AppState[Application State<br/>Storage + AI Client]
    end

    subgraph "Core Libraries"
        Core[peptrack-core<br/>Storage + Encryption]
        LocalAI[peptrack-local-ai<br/>CLI Orchestrator]
        Literature[peptrack-literature<br/>API Fetchers]
    end

    subgraph "Data & External"
        SQLite[(SQLite Database<br/>Encrypted)]
        Keychain[macOS Keychain<br/>Key Storage]
        APIs[External APIs<br/>PubMed, OpenAlex,<br/>Crossref, Google Drive]
    end

    Vue --> Pinia
    Pinia --> Components
    Components --> IPC
    IPC --> Commands
    Commands --> AppState
    AppState --> Core
    AppState --> LocalAI
    Commands --> Literature
    Core --> SQLite
    Core --> Keychain
    Literature --> APIs
    Commands --> APIs
Loading

Data Flow Architecture

sequenceDiagram
    participant User
    participant Vue as Vue Component
    participant Store as Pinia Store
    participant IPC as Tauri IPC
    participant Cmd as Command Handler
    participant Core as Core Library
    participant DB as SQLite (Encrypted)

    User->>Vue: Create Protocol
    Vue->>Store: createProtocol(payload)
    Store->>Store: Optimistic Update
    Store->>IPC: invoke("save_protocol")
    IPC->>Cmd: save_protocol(payload)
    Cmd->>Core: upsert_protocol(data)
    Core->>Core: Encrypt with ChaCha20
    Core->>DB: INSERT encrypted blob
    DB-->>Core: Success
    Core-->>Cmd: Return protocol
    Cmd-->>IPC: Return protocol
    IPC-->>Store: Protocol created
    Store->>Vue: Update UI
    Vue->>User: Show success toast

    Note over Store,Vue: On error: rollback<br/>optimistic update
Loading

Encryption Pipeline

flowchart LR
    A[Raw Data<br/>JSON] --> B[Serialize to String]
    B --> C[Generate Random<br/>12-byte Nonce]
    C --> D[Get 32-byte Key<br/>from Keychain]
    D --> E[ChaCha20-Poly1305<br/>Encrypt]
    E --> F[Prepend Nonce<br/>to Ciphertext]
    F --> G[Store as BLOB<br/>in SQLite]

    G --> H[Read BLOB<br/>from SQLite]
    H --> I[Extract Nonce<br/>first 12 bytes]
    I --> J[Get Key<br/>from Keychain]
    J --> K[ChaCha20-Poly1305<br/>Decrypt]
    K --> L[Deserialize<br/>from String]
    L --> M[Rust Struct<br/>Decrypted Data]

    style E fill:#ff6b6b
    style K fill:#51cf66
Loading

πŸ’» Tech Stack

Backend (Rust)

Technology Version Purpose
Rust 1.91.1 Core application language
Tauri 2.9.2 Desktop app framework
SQLite bundled Local encrypted database
ChaCha20-Poly1305 0.11.0-rc.2 AEAD encryption
Tokio 1.41.1 Async runtime
Reqwest 0.12 HTTP client
OAuth2 4.4 Google Drive authentication
Security-framework 2.11 macOS Keychain integration

Frontend (Vue 3)

Technology Version Purpose
Vue 3.5.24 UI framework
Vite 7.2.2 Build tool & dev server
TypeScript 5.9.3 Type-safe JavaScript
Pinia 3.0.4 State management
@vueuse/core 14.0.0 Composition utilities
Vitest 4.0.8 Component testing (zero vulnerabilities)

External APIs

  • PubMed - Biomedical literature database
  • OpenAlex - Scholarly works catalog
  • Crossref - DOI metadata service
  • Google Drive - OAuth 2.0 cloud backup

πŸ“ Repository Structure

PepTrack/
β”œβ”€β”€ frontend/                      # Vue 3 + Vite SPA
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.vue               # Main application
β”‚   β”‚   β”œβ”€β”€ components/           # 30+ Vue components
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.vue            # Enhanced dashboard with analytics
β”‚   β”‚   β”‚   β”œβ”€β”€ DoseCalendarHeatmap.vue  # 365-day adherence heatmap
β”‚   β”‚   β”‚   β”œβ”€β”€ ProtocolProgressTracker.vue # Protocol progress rings
β”‚   β”‚   β”‚   β”œβ”€β”€ CostAnalysisDashboard.vue   # Cost analytics & tips
β”‚   β”‚   β”‚   β”œβ”€β”€ RecentActivityTimeline.vue  # Activity feed
β”‚   β”‚   β”‚   β”œβ”€β”€ GlobalSearch.vue            # Global search (Cmd+K)
β”‚   β”‚   β”‚   β”œβ”€β”€ KeyboardShortcutsHelp.vue   # Shortcuts help (?)
β”‚   β”‚   β”‚   β”œβ”€β”€ OnboardingFlow.vue          # 8-step guided tour
β”‚   β”‚   β”‚   β”œβ”€β”€ QuickActionsFAB.vue         # Floating action button
β”‚   β”‚   β”‚   β”œβ”€β”€ EmptyState.vue              # Reusable empty states
β”‚   β”‚   β”‚   β”œβ”€β”€ LoadingSkeleton.vue         # Loading animations
β”‚   β”‚   β”‚   └── ... (20+ more components)
β”‚   β”‚   β”œβ”€β”€ stores/               # 5 Pinia stores
β”‚   β”‚   β”œβ”€β”€ composables/          # Vue composables
β”‚   β”‚   β”œβ”€β”€ api/                  # Tauri IPC wrappers
β”‚   β”‚   └── utils/                # Helper functions
β”‚   β”œβ”€β”€ package.json              # Node dependencies
β”‚   └── vitest.config.ts          # Test configuration
β”‚
β”œβ”€β”€ src-tauri/                     # Tauri application shell
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ lib.rs               # App initialization
β”‚   β”‚   β”œβ”€β”€ state.rs             # AppState bootstrap
β”‚   β”‚   └── commands/            # 11 IPC command modules
β”‚   β”‚       β”œβ”€β”€ protocols.rs     # Protocol CRUD
β”‚   β”‚       β”œβ”€β”€ doses.rs         # Dose logging
β”‚   β”‚       β”œβ”€β”€ suppliers.rs     # Supplier & inventory
β”‚   β”‚       β”œβ”€β”€ ai.rs            # AI summarization
β”‚   β”‚       β”œβ”€β”€ literature.rs    # Literature search
β”‚   β”‚       β”œβ”€β”€ backup.rs        # Manual backups
β”‚   β”‚       β”œβ”€β”€ restore.rs       # Restore functionality
β”‚   β”‚       β”œβ”€β”€ scheduler_v2.rs  # Scheduled backups
β”‚   β”‚       └── drive.rs         # Google Drive OAuth
β”‚   β”œβ”€β”€ Cargo.toml               # Rust dependencies
β”‚   └── tauri.conf.json          # Tauri configuration
β”‚
β”œβ”€β”€ crates/                        # Rust library crates
β”‚   β”œβ”€β”€ core/                     # Core functionality
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ db.rs            # SQLite StorageManager
β”‚   β”‚       β”œβ”€β”€ models.rs        # Domain types
β”‚   β”‚       β”œβ”€β”€ encryption.rs    # ChaCha20-Poly1305
β”‚   β”‚       β”œβ”€β”€ keychain.rs      # macOS Keychain
β”‚   β”‚       └── backup_encryption.rs
β”‚   β”‚
β”‚   β”œβ”€β”€ local-ai/                 # Local AI integration
β”‚   β”‚   └── src/
β”‚   β”‚       └── lib.rs           # Codex/Claude orchestrator
β”‚   β”‚
β”‚   └── literature/               # Literature APIs
β”‚       └── src/
β”‚           β”œβ”€β”€ pubmed.rs        # PubMed integration
β”‚           β”œβ”€β”€ openalex.rs      # OpenAlex integration
β”‚           └── crossref.rs      # Crossref integration
β”‚
β”œβ”€β”€ docs/                         # Technical documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md          # Detailed architecture guide
β”‚   β”œβ”€β”€ future_self.md           # Developer onboarding
β”‚   └── ai_assistant_persona.md  # AI collaboration guide
β”‚
β”œβ”€β”€ README.md                     # This file
β”œβ”€β”€ SETUP.md                      # User setup guide
β”œβ”€β”€ TESTING.md                    # Testing scenarios
└── Cargo.toml                    # Workspace manifest

πŸš€ Getting Started

Prerequisites

  1. Rust Toolchain

    rustup default 1.91.1
    rustup component add rustfmt clippy
    cargo install tauri-cli --version 2.9.4
  2. Node.js (β‰₯ 22)

    node -v  # Should be 22+
  3. Optional: AI CLIs (for summarization features)

    # Option 1: Codex CLI (recommended)
    npm install -g codex-cli
    
    # Option 2: Claude CLI (fallback)
    curl https://code.claude.com/install.sh | bash

Installation

  1. Clone the repository

    git clone https://github.com/your-username/PepTrack.git
    cd PepTrack
  2. Install frontend dependencies

    cd frontend
    npm install
    cd ..
  3. Run in development mode

    cargo tauri dev

Development Workflow

# Format code
cargo fmt

# Lint with clippy
cargo clippy --workspace --all-targets

# Run Rust tests
cargo test --workspace

# Build frontend
cd frontend && npm run build

# Run frontend tests
cd frontend && npm run test -- --run

# Build production release
cargo tauri build

πŸ”’ Data & Security

Data Storage

  • Location: ~/Library/Application Support/PepTrack/
  • Database: peptrack.sqlite (encrypted)
  • Encryption Keys: Stored in macOS Keychain (primary) or peptrack.key (fallback)

Encryption Details

  • Algorithm: ChaCha20-Poly1305 (AEAD)
  • Key Size: 32 bytes (256-bit)
  • Nonce: 12 bytes, randomly generated per record
  • Key Storage: macOS Keychain with automatic migration from file-based storage

Privacy Guarantees

  • βœ… All data encrypted at rest
  • βœ… No telemetry or analytics
  • βœ… No cloud sync without explicit user action
  • βœ… No data leaves your computer except:
    • Research searches to PubMed/OpenAlex/Crossref (search queries only)
    • AI summaries to your local CLI (your credentials)
    • Google Drive backups to YOUR Google Drive (optional, user-initiated)

πŸ“š Documentation


πŸ—ΊοΈ Roadmap

Completed βœ…

  • βœ… Protocol management with full CRUD operations
  • βœ… Dose logging with calendar views
  • βœ… Supplier & inventory management
  • βœ… Literature search (PubMed, OpenAlex, Crossref)
  • βœ… Local AI summarization (Codex/Claude)
  • βœ… AI-powered protocol recommender
  • βœ… Manual and scheduled backups
  • βœ… Google Drive OAuth integration
  • βœ… Google Calendar integration
  • βœ… macOS Keychain integration
  • βœ… Desktop notifications
  • βœ… Comprehensive error handling
  • βœ… Enhanced dashboard with analytics widgets
  • βœ… Dose calendar heatmap (365-day visualization)
  • βœ… Protocol progress tracker
  • βœ… Cost analysis dashboard
  • βœ… Recent activity timeline
  • βœ… Global search (Cmd+K)
  • βœ… Keyboard shortcuts system
  • βœ… Quick Actions FAB
  • βœ… Onboarding flow
  • βœ… Dark mode support
  • βœ… Empty states and loading skeletons

In Progress 🚧

  • Background reminders for dose schedules
  • Vial expiry notifications

Planned πŸ“‹

  • Cloud restore (restore directly from Google Drive)
  • Multi-cloud support (Dropbox, OneDrive)
  • Backup encryption with user-managed passwords
  • Data export (CSV/JSON)
  • Mobile companion app

🀝 Contributing

Quick Start for Contributors

  1. Read docs/future_self.md for environment setup
  2. Check TESTING.md for testing requirements
  3. Follow the coding standards in docs/ai_assistant_persona.md

Development Guidelines

  • Rust: Follow Rust 2021 edition best practices, use anyhow for errors
  • Vue/TypeScript: Use Composition API, 2-space indent, PascalCase components
  • Testing: All new features require tests
  • Documentation: Update relevant docs with any changes

πŸ“„ License

[Add your license here]


πŸ™ Acknowledgments

Built with:

  • Tauri - Desktop app framework
  • Vue.js - Progressive JavaScript framework
  • Rust - Systems programming language
  • Pinia - Vue state management

PepTrack - Your peptides, your data, your control. πŸ§ͺ

About

macOS app built with Rust, Tauri, and Vue for Professional Peptide Management & AI-Enhanced Literature Search

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •