Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/devv-shayan/Trueears/llms.txt

Use this file to discover all available pages before exploring further.

Prerequisites

Before you begin, make sure you have the following installed:
RequirementVersionNotes
Node.jsv18+nodejs.org
RustLatest stableVia rustup
Visual Studio Build Tools2019+Windows only

Install Rust

winget install Rustlang.Rustup
After installation, verify with:
rustc --version
cargo --version

Clone and install

1

Clone the repository

git clone https://github.com/devv-shayan/Trueears.git
cd Trueears
2

Install dependencies

npm install
3

Configure environment variables

Copy the example environment file and fill in your values:
cp .env.example .env
Key variables to configure:
VariablePurpose
API_URLAuth server URL (default: https://trueears-backend.vercel.app)
GOOGLE_CLIENT_IDGoogle OAuth client ID
JWT_SECRETJWT signing secret
LEMONSQUEEZY_API_KEYLemonSqueezy API key for payments
LEMONSQUEEZY_STORE_IDLemonSqueezy store ID
LEMONSQUEEZY_WEBHOOK_SECRETWebhook signature secret
VITE_PAYMENT_SERVICE_URLPayment service URL for frontend
For local frontend development you only need the VITE_* variables. Backend services require the full set.
4

Start development mode

npm run dev
This starts the Tauri dev shell with hot-reload — the Vite frontend server (port 3000) and the Rust backend launch together.

Available scripts

ScriptDescription
npm run devStart Tauri dev mode with hot-reload
npm run dev:linuxLinux-specific dev launcher with clean environment
npm run vite:devStart frontend dev server only
npm run vite:buildBuild frontend assets only
npm run sync-versionSync version from package.json to tauri.conf.json

Code conventions

TypeScript

  • Strict mode — no any types without justification
  • Functional components — no class components
  • Custom hooks — extract all reusable stateful logic
  • Explicit return types — required on all exported functions
// Good: explicit types, functional style
export function useAudioRecorder(): AudioRecorderHook {
  const [isRecording, setIsRecording] = useState<boolean>(false);
  // ...
}

// Avoid: implicit any, missing return type
export function useAudioRecorder() {
  const [isRecording, setIsRecording] = useState(false);
  // ...
}

Rust

  • Use Result<T, E> for all fallible operations — no panics
  • Validate Tauri command inputs before processing
  • Prefer async/await for I/O operations
// Good: Result type, input validation
#[tauri::command]
async fn transcribe_audio(audio_data: Vec<u8>) -> Result<String, String> {
    if audio_data.is_empty() {
        return Err("Empty audio data".to_string());
    }
    // ...
}

// Avoid: panics on error
#[tauri::command]
fn transcribe_audio(audio_data: Vec<u8>) -> String {
    assert!(!audio_data.is_empty()); // Will panic!
    // ...
}

Architecture layers

Imports must flow downward only — never import UI components from services or controllers:
UI Components

   Hooks

 Services / Controllers

   Backend (Tauri)

Running tests

cd frontend && npm test

Build docs developers (and LLMs) love