getting started - nself-org/nchat GitHub Wiki
v1.0.9 LIMITATION — Voice/Video calls require bring your own LiveKit + coturn
nChat's
livekitplugin is an API wrapper around an externally-hosted LiveKit Server cluster. To enable real-time voice/video calls in v1.0.9, you must runlivekit/livekit-serverandcoturnseparately —nselfdoes not yet ship compose templates for these (planned for v1.1.0). Without these, audio/video calls will fail to connect behind NAT. See the Self-Hosted Deployment Guide for copy-pasteabledocker runsnippets covering livekit-server + coturn.Core messaging (text, files, channels, DMs) works without LiveKit.
Get nchat up and running in under 5 minutes with this quick start guide.
Before you begin, ensure you have:
| Requirement | Version | Notes |
|---|---|---|
| Node.js | 18+ | LTS recommended |
| Docker | 20+ | Docker Desktop or Docker Engine |
| Docker Compose | 2.0+ | Usually included with Docker |
| nself CLI | 0.4.2+ | Backend infrastructure |
git clone https://github.com/nself/nself-chat.git
cd nself-chatnpm installThe backend uses the nself CLI to provide PostgreSQL, Hasura, and authentication services.
# Install nself CLI (if not already installed)
curl -fsSL https://nself.io/install.sh | bash
# Initialize the backend
cd .backend
nself init --demo
nself build
nself start
# Return to project root
cd ..Create your local environment file:
cp .env.example .env.localThe default configuration enables development mode with test users:
# Backend URLs (via nself CLI)
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
NEXT_PUBLIC_USE_DEV_AUTH=true
NEXT_PUBLIC_ENV=development
# App Configuration
NEXT_PUBLIC_APP_NAME=nchat
NEXT_PUBLIC_PRIMARY_COLOR=#6366f1npm run devVisit http://localhost:3000 to see nchat running.
When NEXT_PUBLIC_USE_DEV_AUTH=true, you get:
Eight pre-configured users are available for testing:
| Password | Role | |
|---|---|---|
| [email protected] | password123 | Owner |
| [email protected] | password123 | Admin |
| [email protected] | password123 | Moderator |
| [email protected] | password123 | Member |
| [email protected] | password123 | Guest |
| [email protected] | password123 | Member |
| [email protected] | password123 | Member |
| [email protected] | password123 | Member |
Development mode automatically logs in as [email protected] for faster iteration.
Test different roles by switching users:
import { useAuth } from '@/contexts/auth-context'
function MyComponent() {
const { switchUser } = useAuth()
// Switch to admin role
await switchUser('[email protected]')
// Switch to guest role
await switchUser('[email protected]')
}On first launch, nchat presents a 9-step setup wizard:
- Welcome - Introduction to nchat
- Owner Info - Your name, email, company
- Auth Methods - Choose authentication providers
- Access Permissions - Set access control mode
- Features - Enable/disable features
- Landing Page - Configure landing page
- Branding - App name, logo, colors
- Theme - Choose from 8+ theme presets
- Review - Confirm and save settings
nself-chat/
├── src/
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ ├── contexts/ # React contexts
│ ├── config/ # Configuration
│ ├── graphql/ # GraphQL queries
│ ├── hooks/ # Custom hooks
│ ├── lib/ # Utilities
│ └── services/ # Service classes
├── .backend/ # nself CLI backend (gitignored)
├── public/ # Static assets
├── docs/ # Documentation
└── package.json
- Installation Guide - Detailed installation options
- Configuration - All configuration options
- Features Overview - Explore all features
- Authentication - Set up auth providers
- White Labeling - Customize branding
# Start development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run tests
npm test
# Type checking
npm run type-check
# Linting
npm run lint
# Format code
npm run format# Navigate to backend
cd .backend
# Start services
nself start
# Stop services
nself stop
# View logs
nself logs
# Check status
nself status
# View service URLs
nself urlscd .backend && nself start# Find process using port 3000
lsof -i :3000
# Or start on different port
PORT=3001 npm run devEnsure Docker Desktop is running, then:
docker psCheck PostgreSQL is running:
cd .backend && nself statusSee the full Installation Guide for detailed troubleshooting.