Skip to content

Development Environment

Detailed instructions for setting up RushChat development environment.

Development Environment Overview

Prerequisites

Required Software

  • Node.js ≥ 18
  • Rust ≥ 1.70
  • MySQL ≥ 5.7 or MariaDB ≥ 10.3
  • Git
  • VS Code or Cursor - Code editor
  • MySQL Workbench - Database management
  • Postman - API testing

Environment Setup

1. Install Node.js

# Using nvm (recommended)
nvm install 20
nvm use 20

# Or download from official website
# https://nodejs.org/

2. Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustc --version

3. Install MySQL

macOS

brew install mysql
brew services start mysql

Ubuntu/Debian

sudo apt-get update
sudo apt-get install mysql-server
sudo systemctl start mysql

4. Clone Project

git clone <repository-url>
cd RushChat

5. Install Dependencies

# Root directory dependencies
npm install

# Client dependencies
cd client && npm install && cd ..

6. Database Setup

# Create database
mysql -u root -p < database/schema.sql

7. Configure Environment Variables

Create .env file:

DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=rushchat
PORT=5001
NODE_ENV=development
CLIENT_URL=http://localhost:3000
REACT_APP_SOCKET_URL=http://localhost:5001

Start Development Server

Backend

cd server-rust
cargo run

Frontend

cd client
npm start

Development Tools

VS Code Extensions

Recommended installations:

  • Rust Analyzer
  • ESLint
  • Prettier
  • MySQL

Debug Configuration

Create .vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "lldb",
      "request": "launch",
      "name": "Debug Rust Server",
      "cargo": {
        "args": ["build", "--bin=rushchat-server"],
        "filter": {
          "name": "rushchat-server",
          "kind": "bin"
        }
      },
      "args": [],
      "cwd": "${workspaceFolder}/server-rust"
    }
  ]
}