# ๐Ÿš€ Roo Code Cloud Monorepo - [๐Ÿ“‹ Prerequisites](#-prerequisites) - [๐Ÿ” Environment Setup](#-environment-setup) - [๐Ÿ—„๏ธ Database Setup](#๏ธ-database-setup) - [๐ŸŒ Running the Web App](#-running-the-web-app) - [๐Ÿค– Roomote Services](#-roomote-services) - [๐Ÿ› ๏ธ Development Commands](#๏ธ-development-commands) - [๐Ÿ”ง Troubleshooting](#-troubleshooting) - [๐Ÿ“š Additional Resources](#-additional-resources) ## ๐Ÿ“‹ Prerequisites Before getting started, ensure you have the following installed: | Tool | Version | Installation | | --------------------- | ------- | -------------------------------------------------------------------------------- | | ๐ŸŽ **macOS** | Latest | This guide is optimized for macOS | | ๐Ÿณ **Docker Desktop** | Latest | [Download here](https://www.docker.com/products/docker-desktop/) | | ๐Ÿ“ฆ **Node.js** | 18+ | Install via [nvm](https://github.com/nvm-sh/nvm) or [asdf](https://asdf-vm.com/) | | โšก **pnpm** | Latest | `npm install -g pnpm` | ## ๐Ÿ” Environment Setup The monorepo uses encrypted environment variables for security. Follow these steps: ### 1. Get Decryption Keys ๐Ÿ”‘ Contact your team via Slack to obtain the private keys needed to decrypt environment files. ### 2. Create `.env.keys` File ๐Ÿ“„ Create a `.env.keys` file at the repository root with your keys: ```bash # .env.keys DOTENV_PRIVATE_KEY_TEST=your_test_key_here DOTENV_PRIVATE_KEY_DEVELOPMENT=your_dev_key_here DOTENV_PRIVATE_KEY_PREVIEW=your_preview_key_here DOTENV_PRIVATE_KEY_PRODUCTION=your_prod_key_here ``` ### 3. Verify Setup โœ… Test that decryption is working correctly: ```bash pnpm install pnpm --filter @roo-code-cloud/env test ``` If successful, you'll see: โœ… **Environment decryption working correctly!** ## ๐Ÿ—„๏ธ Database Setup Roo Code Cloud uses multiple databases for different purposes: - **๐Ÿ˜ PostgreSQL**: Primary application data - **๐Ÿ“Š ClickHouse**: Analytics and time-series data - **๐Ÿ”ด Redis**: Caching and session storage ### Start All Database Services ๐Ÿš€ ```bash pnpm db:up ``` This command will: - ๐Ÿณ Start Docker containers for all databases - ๐Ÿ”„ Automatically sync PostgreSQL schema to the latest version - ๐ŸŒ Make services available on standard ports ### Reset Database (if needed) ๐Ÿ”„ To completely reset your local database: ```bash pnpm db:reset ``` ### ClickHouse Manual Reset ๐Ÿ”ง If you encounter ClickHouse schema issues: ```bash # Stop all databases pnpm db:down # Remove ClickHouse data rm -rf .docker/data/clickhouse # Restart everything pnpm db:up ``` ### Configure Local Hosts ๐ŸŒ Add these entries to your `/etc/hosts` file for proper local development: ```bash # /etc/hosts 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost # ๐Ÿš€ Roo Code Cloud Services 127.0.0.1 postgres redis clickhouse ``` ## ๐ŸŒ Running the Web App Start the main web application: ```bash pnpm --filter @roo-code-cloud/web dev ``` ๐ŸŽฏ **Access your app**: [http://localhost:3000](http://localhost:3000) ### What you'll see: - ๐ŸŽจ Modern, responsive web interface - ๐Ÿ” Authentication and user management - ๐Ÿ“Š Dashboard with analytics - โš™๏ธ Settings and configuration panels ### Linking with local Roo Code API Make sure you are added to the Roo Cloud development organization. To point the Roo VSCode extension at your local cloud database, in the `Roo-Code` repo, add the following to `src/.env`: ``` CLERK_BASE_URL=https://epic-chamois-85.clerk.accounts.dev ROO_CODE_API_URL=http://localhost:3000 ``` ## ๐Ÿค– Roomote Services Roomote provides intelligent automation and workflow management. > ๐Ÿ“ **Note**: Detailed Roomote documentation is currently being developed. > > For now, refer to our [Work-in-Progress Setup Guide](https://www.notion.so/Roomote-Local-Setup-21cfd1401b0a80fc9e8ac37e7c4cfc05). ### Available Roomote Commands: ```bash # Start Roomote dashboard pnpm --filter @roo-code-cloud/roomote-dashboard dev # Run Roomote worker pnpm --filter @roo-code-cloud/roomote worker # Check Roomote health pnpm --filter @roo-code-cloud/roomote health ``` ## ๐Ÿ› ๏ธ Development Commands Here are the most commonly used development commands: ### Testing ๐Ÿงช ```bash # Run all tests pnpm test # Test specific file pnpm test path/to/file.test.ts # Run tests in watch mode pnpm test --watch ``` ### Code Quality ๐Ÿ” ```bash # Lint all code pnpm lint # Type checking pnpm check-types # Format code (auto-formatted on commit) pnpm format ``` ### Database Operations ๐Ÿ—„๏ธ ```bash # Push schema changes pnpm db:push # Generate new migration pnpm --filter @roo-code-cloud/db db:generate # Run pending migrations pnpm --filter @roo-code-cloud/db db:migrate # Reset database completely pnpm db:reset ``` ### Package Management ๐Ÿ“ฆ ```bash # Install dependencies pnpm install # Add dependency to specific workspace pnpm --filter @roo-code-cloud/web add package-name # Update all dependencies pnpm update ``` ## ๐Ÿ”ง Troubleshooting ### Common Issues and Solutions #### ๐Ÿšซ Database Connection Errors ```bash # Check if containers are running docker ps # Restart database services pnpm db:down && pnpm db:up # Verify hosts file configuration cat /etc/hosts | grep -E "(postgres|redis|clickhouse)" ``` #### ๐Ÿ” Environment Decryption Fails - โœ… Verify `.env.keys` file exists and contains valid keys - โœ… Check with team for updated keys - โœ… Ensure no extra spaces or characters in key values #### ๐Ÿ“ฆ Package Installation Issues ```bash # Clear pnpm cache pnpm store prune # Remove node_modules and reinstall rm -rf node_modules package-lock.json pnpm install ``` #### ๐Ÿณ Docker Issues ```bash # Reset Docker Desktop # Restart Docker Desktop application # Clean Docker system docker system prune -a ```