INSTALL - nself-org/nchat GitHub Wiki
Installation Guide - ɳChat v0.8.0
Complete installation instructions for all platforms: Web, iOS, Android, and Desktop.
Table of Contents
Web Application
Prerequisites
- Node.js 20.0.0 or higher
- pnpm 9.15.4 or higher
- Docker (optional, for backend services)
Installation Steps
-
Clone the repository:
git clone https://github.com/nself-org/nchat.git cd nself-chat -
Install dependencies:
pnpm install -
Configure environment variables:
cp .env.example .env.localEdit
.env.localwith your configuration:# Backend URLs (if using nself CLI backend) NEXT_PUBLIC_GRAPHQL_URL=http://api.localhost/v1/graphql NEXT_PUBLIC_AUTH_URL=http://auth.localhost/v1/auth NEXT_PUBLIC_STORAGE_URL=http://storage.localhost/v1/storage # Development mode with test users NEXT_PUBLIC_USE_DEV_AUTH=true NEXT_PUBLIC_ENV=development # Optional: Sentry error tracking NEXT_PUBLIC_SENTRY_DSN=your-sentry-dsn -
Start the development server:
pnpm dev -
Open your browser: Navigate to http://localhost:3000
-
Complete the setup wizard: Follow the 12-step guided setup to configure your instance.
Production Build
# Build for production
pnpm build
# Start production server
pnpm start
Docker Deployment
# Build Docker image
docker build -t nself-chat:latest .
# Run container
docker run -p 3000:3000 nself-chat:latest
See DEPLOYMENT.md for detailed deployment guides.
Mobile Apps
Prerequisites
General Requirements:
- Node.js 20.0.0+
- pnpm 9.15.4+
- Capacitor CLI 6.x
iOS Requirements:
- macOS (required for iOS development)
- Xcode 15.0 or later
- CocoaPods 1.10 or later
- iOS 14.0+ deployment target
- Apple Developer account (for device testing and App Store)
Android Requirements:
- Android Studio Hedgehog (2023.1.1) or later
- Android SDK API 34
- Java JDK 17
- Gradle 8.0+
Initial Setup
-
Build the web application:
pnpm build -
Navigate to Capacitor directory:
cd platforms/capacitor -
Install Capacitor dependencies:
pnpm install
iOS Installation
1. Add iOS Platform
cd platforms/capacitor
npx cap add ios
2. Configure iOS Project
-
Open the project in Xcode:
pnpm run open:ios -
Configure signing:
- Select the
Apptarget - Go to "Signing & Capabilities"
- Select your development team
- Enable "Automatically manage signing"
- Select the
-
Set Bundle ID:
- Change Bundle Identifier to your unique ID (e.g.,
com.yourcompany.nchat) - Must match your Apple Developer account
- Change Bundle Identifier to your unique ID (e.g.,
3. Enable Capabilities
In Xcode, add the following capabilities:
-
Push Notifications:
- Click "+ Capability"
- Add "Push Notifications"
-
Background Modes:
- Add "Background Modes"
- Enable:
- Remote notifications
- Background fetch
- Voice over IP (for calls)
- Audio (for voice messages)
-
Associated Domains (for deep linking):
- Add "Associated Domains"
- Add:
applinks:nchat.yourdomain.com
4. Configure Firebase (Optional but Recommended)
-
Create Firebase project:
- Go to Firebase Console
- Create a new project
-
Add iOS app:
- Bundle ID: Your iOS bundle identifier
- Download
GoogleService-Info.plist
-
Add to Xcode:
cp GoogleService-Info.plist platforms/capacitor/ios/App/App/ -
Install pods:
cd platforms/capacitor/ios/App pod install
5. Configure Push Notifications (APNs)
-
Create APNs Key:
- Go to Apple Developer Portal
- Certificates, Identifiers & Profiles → Keys
- Create new key with "Apple Push Notifications service (APNs)"
- Download
.p8file - Note the Key ID and Team ID
-
Upload to Firebase:
- In Firebase Console, go to Project Settings → Cloud Messaging
- Upload APNs key (.p8 file)
- Enter Key ID and Team ID
6. Generate App Icons
cd platforms/capacitor
npx @capacitor/assets generate --ios
Or manually add icons to ios/App/App/Assets.xcassets/AppIcon.appiconset/
7. Build and Run
Run on Simulator:
pnpm run run:ios
Run on Device:
pnpm run run:ios -- --device
Build for Release:
pnpm run build:ios
8. App Store Submission
See platforms/capacitor/fastlane/README.md for automated build and deployment with Fastlane.
Android Installation
1. Add Android Platform
cd platforms/capacitor
npx cap add android
2. Configure Android Project
-
Open the project in Android Studio:
pnpm run open:android -
Wait for Gradle sync to complete
-
Update package name (if needed):
- In
android/app/build.gradle:defaultConfig { applicationId "com.yourcompany.nchat" // ... }
- In
3. Configure Firebase (Required for Push Notifications)
-
Create Firebase project (if not already done)
-
Add Android app:
- Package name:
com.yourcompany.nchat(or your package name) - Download
google-services.json
- Package name:
-
Add to project:
cp google-services.json platforms/capacitor/android/app/ -
Sync Gradle:
cd platforms/capacitor/android ./gradlew clean build
4. Configure Deep Linking
-
Create
assetlinks.jsonon your server:https://nchat.yourdomain.com/.well-known/assetlinks.jsonContent:
[ { "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.yourcompany.nchat", "sha256_cert_fingerprints": ["YOUR_SHA256_FINGERPRINT"] } } ] -
Get SHA256 fingerprint:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
5. Configure Signing (for Release Builds)
-
Generate keystore:
keytool -genkey -v -keystore nchat-release.keystore -alias nchat -keyalg RSA -keysize 2048 -validity 10000 -
Create
keystore.properties:cd platforms/capacitor/android nano keystore.propertiesContent:
storeFile=/path/to/nchat-release.keystore storePassword=YOUR_STORE_PASSWORD keyAlias=nchat keyPassword=YOUR_KEY_PASSWORD
6. Generate App Icons
cd platforms/capacitor
npx @capacitor/assets generate --android
Or manually add icons to android/app/src/main/res/mipmap-*/
7. Build and Run
Run on Emulator/Device:
pnpm run run:android
Build Debug APK:
cd platforms/capacitor/android
./gradlew assembleDebug
Build Release APK:
./gradlew assembleRelease
Build Release Bundle (for Play Store):
pnpm run build:android:bundle
8. Play Store Submission
See platforms/capacitor/fastlane/README.md for automated build and deployment with Fastlane.
Desktop Apps
Electron
Electron apps work on Windows, macOS, and Linux.
Prerequisites
- Node.js 20.0.0+
- pnpm 9.15.4+
- Platform-specific build tools:
- Windows: Visual Studio Build Tools
- macOS: Xcode Command Line Tools
- Linux:
build-essentialpackage
Installation
-
Install dependencies:
pnpm install -
Build web assets:
pnpm build -
Start Electron in development:
pnpm electron:dev
Building for Distribution
Build for current platform:
pnpm electron:build
Build for all platforms:
pnpm build:electron
Build for specific platform:
# Windows
pnpm electron:build --win
# macOS
pnpm electron:build --mac
# Linux
pnpm electron:build --linux
Distribution
Built apps will be in dist/electron/:
- Windows:
.exeinstaller - macOS:
.dmginstaller - Linux:
.AppImage,.deb, or.rpm
Tauri
Tauri is a lightweight alternative to Electron using Rust and native webviews.
Prerequisites
- Node.js 20.0.0+
- pnpm 9.15.4+
- Rust 1.70+ (
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh) - Platform-specific build tools:
- Windows: Microsoft Visual Studio C++ Build Tools
- macOS: Xcode Command Line Tools
- Linux:
libwebkit2gtk-4.0-dev,build-essential,curl,wget,libssl-dev,libgtk-3-dev
Installation
-
Install dependencies:
pnpm install -
Build web assets:
pnpm build -
Start Tauri in development:
pnpm tauri:dev
Building for Distribution
Build for current platform:
pnpm tauri:build
Built apps will be in src-tauri/target/release/bundle/:
- Windows:
.msiinstaller - macOS:
.dmgor.app - Linux:
.deb,.AppImage
Backend Setup
ɳChat requires a backend powered by nself CLI.
Option 1: Use Development Mode (Quickest)
Set NEXT_PUBLIC_USE_DEV_AUTH=true in .env.local to use the built-in development authentication with 8 test users.
No backend required for basic testing!
Option 2: nself CLI Backend (Recommended)
-
Install nself CLI:
npm install -g @nself/cli -
Initialize backend:
cd .backend nself init --demo -
Start services:
nself start -
Verify services:
nself status nself urls -
Update
.env.local:NEXT_PUBLIC_GRAPHQL_URL=http://api.localhost/v1/graphql NEXT_PUBLIC_AUTH_URL=http://auth.localhost/v1/auth NEXT_PUBLIC_STORAGE_URL=http://storage.localhost/v1/storage NEXT_PUBLIC_USE_DEV_AUTH=false
See nself CLI documentation for advanced configuration.
Video and voice calls (nChat bundle required)
v1.0.9 requires bring-your-own LiveKit Server and coturn.
Video/voice calls use LiveKit SFU (Selective Forwarding Unit) and coturn TURN server. These are NOT bundled with the nSelf CLI at v1.0.9. You must deploy them separately and supply the URLs via env vars.
LiveKit Server setup:
- Official install guide: https://docs.livekit.io/home/self-hosting/deployment/
- Minimum recommended: 2-core VPS, ports 7880/7881 (TCP) + 50000–60000/UDP for WebRTC
coturn setup:
- Official repo and docs: https://github.com/coturn/coturn
- Install on the same server as LiveKit or a separate VPS
Once deployed, add to .backend/.env.local:
LIVEKIT_HOST=wss://livekit.yourdomain.com
LIVEKIT_API_KEY=your-api-key
LIVEKIT_API_SECRET=your-api-secret
NEXT_PUBLIC_LIVEKIT_URL=wss://livekit.yourdomain.com
A LiveKit Server nSelf plugin is planned for v1.1.0 so this can be provisioned via
nself plugin install livekit-server without a separate VPS. Track progress:
https://github.com/nself-org/cli/issues
Troubleshooting
Web App
Issue: Port 3000 already in use
# Use a different port
pnpm dev -- -p 3001
Issue: Module not found errors
# Clear cache and reinstall
rm -rf node_modules .next
pnpm install
iOS
Issue: CocoaPods errors
cd platforms/capacitor/ios/App
pod deintegrate
pod install --repo-update
Issue: Build fails in Xcode
- Clean build folder: Product → Clean Build Folder
- Update signing certificates
- Check Xcode version (15.0+)
Issue: App crashes on launch
- Check Firebase configuration
- Verify GoogleService-Info.plist is added
- Check console logs in Xcode
Android
Issue: Gradle sync failed
cd platforms/capacitor/android
./gradlew clean
./gradlew --stop
./gradlew build
Issue: Build fails
- Update Android SDK to API 34
- Check Java version (should be 17)
- Invalidate caches: File → Invalidate Caches / Restart
Issue: App crashes on launch
- Check Firebase configuration
- Verify google-services.json is added
- Check Logcat for errors
Desktop (Electron)
Issue: Electron fails to start
# Rebuild native modules
pnpm rebuild
Issue: Build fails
- Check platform-specific build tools are installed
- Try building for current platform only first
Desktop (Tauri)
Issue: Rust compilation errors
# Update Rust
rustup update
# Clean build
cd src-tauri
cargo clean
Issue: Missing system dependencies (Linux)
# Ubuntu/Debian
sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
# Fedora
sudo dnf install webkit2gtk3-devel openssl-devel curl wget gtk3-devel libappindicator-gtk3-devel librsvg2-devel
Backend (nself CLI)
Issue: Services won't start
# Check Docker is running
docker ps
# Check logs
nself logs
# Restart services
nself stop
nself start
Issue: Port conflicts
- Check if ports 3000, 4000, 5432, 8080 are available
- Modify ports in
.backend/.env
Platform-Specific Notes
iOS
- Minimum iOS version: 14.0
- Requires macOS: iOS development only possible on macOS
- Code signing: Required for device testing and App Store
- Push notifications: Requires APNs certificate and Firebase setup
- App Store review: Can take 1-3 days
Android
- Minimum Android version: API 24 (Android 7.0)
- Works on all platforms: Windows, macOS, Linux
- Play Store review: Usually 1-7 days
- Testing: Use Firebase Test Lab for device testing
Desktop
-
Electron:
- Larger app size (100-200MB)
- Includes Chromium
- Better compatibility
-
Tauri:
- Smaller app size (5-15MB)
- Uses system webview
- Faster startup
- Requires more setup
Next Steps
After installation:
- Web: Complete the setup wizard at http://localhost:3000
- Mobile: Test on simulators/emulators before devices
- Desktop: Test app on target platforms
- Backend: Configure production backend with nself CLI
- Deploy: Follow DEPLOYMENT.md for production deployment
Support
Need help?
- Documentation: https://github.com/nself-org/nchat/tree/main/docs
- Issues: https://github.com/nself-org/nchat/issues
- Discussions: https://github.com/nself-org/nchat/discussions
- nself CLI Docs: https://nself.org/docs
Version: 0.8.0 Last Updated: February 1, 2026