This document provides comprehensive deployment instructions for all platforms, environment configuration, and CI/CD recommendations.
The application supports three deployment environments:
| Environment | Purpose | Server URL | Client Build |
|---|---|---|---|
| Development | Local testing | ws://localhost:9000 |
Development mode |
| Production | Live deployment | wss://chat.yourserver.com |
Production build |
1. Install Dependencies:
cd Client
npm install
cd electron
npm install
cd ..2. Build Web Assets:
npm run build3. Build Electron App:
cd electron
npm run electron:packOutput: Client/electron/dist/chatapp.AppImage
Output: Client/electron/dist/chatapp.exe
- Android Studio installed
- Java JDK 11+
- Android SDK 24+
1. Install Dependencies:
cd Client
npm install2. Build Web Assets:
npm run build3. Open in Android Studio:
npx cap open android4. Build Release APK:
cd android
./gradlew assembleReleaseOutput: Client/android/app/build/outputs/apk/release/app-release.apk
1. Install Go:
wget https://go.dev/dl/go1.21.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin2. Clone Repository:
git clone https://github.com/TheYogMehta/chatapp.git
cd chatapp/Server3. Build Server:
go build -o socket.go4. Create Systemd Service:
# /etc/systemd/system/chatapp.service
[Unit]
Description=ChatApp Relay Server
After=network.target
[Service]
Type=simple
User=chatapp
WorkingDirectory=/home/chatapp/Server
ExecStart=/home/chatapp/Server/chatapp-server
Restart=always
Environment="PORT=9000"
Environment="HMAC_SECRET=your-secret-key"
[Install]
WantedBy=multi-user.target5. Enable and Start:
sudo systemctl enable chatapp
sudo systemctl start chatapp
sudo systemctl status chatappLet's Encrypt (for wss://):
sudo apt-get install certbot python3-certbot-nginx
sudo certbot --nginx -d chat.yourserver.com
sudo certbot renew --dry-run- Single server: All sessions in memory
- No persistence: Server restart = all disconnections
- No load balancing: Cannot distribute across servers
- Automatic: None (local only)
- Manual: Users can export database via settings
- No persistent data: Server holds no long-term data
- Logs: Rotate and backup connection logs for security audit