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
Recommended Tools
- 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
Ubuntu/Debian
4. Clone Project
5. Install Dependencies
6. Database Setup
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
Frontend
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"
}
]
}