Installation & Setup
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
OS Chat is an open-source AI personal assistant platform designed to combine multiple language models with background agents and service integrations. This guide outlines the necessary steps to install dependencies, configure the backend services, and initialize the development environment. The setup process leverages a modern full-stack tech stack centered around Bun, TanStack Start, and Convex.
The architecture relies on a "Privacy-First" approach where API keys are encrypted and stored securely using AES-GCM 256-bit encryption. The installation ensures that developers can run both the React-based frontend and the serverless Convex backend locally for development and testing.
Sources: README.md:1-12, src/routes/security.tsx:28-32
Prerequisites & Tech Stack
Before beginning the installation, ensure the following environment requirements are met. OS Chat utilizes specific tools for package management, linting, and type checking to maintain high code standards.
| Component | Technology | Description |
|---|---|---|
| Package Manager | Bun | Used for all package management and scripts. |
| Frontend Framework | TanStack Start | Full-stack React 19 framework with SSR. |
| Backend | Convex | Real-time database, authentication, and serverless functions. |
| Linter | oxlint | Type-aware linting via tsgolint. |
| Formatter | oxfmt | Primary code formatting tool. |
| Type Checker | tsgo | TypeScript native compiler. |
Sources: CLAUDE.md:20-40, AGENTS.md:20-40
Installation Steps
1. Clone and Dependency Installation
The project must be cloned from the GitHub repository and dependencies installed using Bun.
# Clone the repository
git clone https://github.com/ajanraj/OpenChat.git
cd OpenChat
# Install dependencies
bun install
Sources: README.md:144-148, CLAUDE.md:104
2. Backend Initialization (Convex)
OS Chat uses Convex for its real-time database and serverless logic. You must authenticate with Convex and start a development deployment.
# Login to Convex
bunx convex login
# Start Convex development server
bunx convex dev --once
Sources: README.md:150-151, CLAUDE.md:115
3. Environment Configuration
Environment variables are handled differently for client and server. Client-side variables must be prefixed with VITE_ and accessed via import.meta.env, while server-side variables use process.env.
# Copy the example environment file
cp .env.example .env
Sources: README.md:153-154, CLAUDE.md:32-34
4. Running the Development Server
Once the backend and environment are configured, the local development server can be started on port 3000.
# Run development server
bun dev
Sources: README.md:157, CLAUDE.md:105
System Architecture & Data Flow
OS Chat follows a full-stack architecture where TanStack Start manages the frontend and Nitro v3 serves as the universal server engine. The backend is managed by Convex, which provides real-time updates to all clients via subscriptions.
This diagram illustrates the flow from the user interface through the TanStack framework to the Convex backend and external integrations.
Sources: CLAUDE.md:65-90, AGENTS.md:65-90
Development Workflow & Commands
Code Quality Assurance
Developers are required to run linting and formatting checks before committing changes. The project uses oxlint and oxfmt exclusively.
| Task | Command |
|---|---|
| Format Code | bun run format |
| Check Formatting | bun run format:check |
| Lint Code | bun run lint |
| Type Check | bun run typecheck |
| Run Tests | bun run test |
Sources: CLAUDE.md:104-114, AGENTS.md:104-114
Committing Changes
The project follows strict conventional commit guidelines. Use the /commit command for automated staging and pre-commit checks.
The sequence shows the standard workflow for validating and committing code according to project standards.
Sources: agent_rules/commit.md:1-25
Conclusion
Setting up OS Chat involves a straightforward sequence of Bun-driven commands to initialize the React frontend and Convex backend. By adhering to the provided tech stack and development commands, contributors can ensure a consistent and high-quality development environment. The multi-layered security approach, including encrypted API key storage and OAuth authentication, is integrated directly into the setup via the Convex configuration.