QUICK START PRODUCTION - nself-org/nchat GitHub Wiki
Last Updated: February 3, 2026 Status: Ready for Staging Deployment
# Get SendGrid API Key
# 1. Sign up at https://sendgrid.com/ (free tier: 100 emails/day)
# 2. Create API key with "Mail Send" permissions
# 3. Verify sender email
# Configure Environment
export EMAIL_PROVIDER=sendgrid
export EMAIL_FROM_NAME="nChat"
export EMAIL_FROM_ADDRESS="[email protected]"
export SENDGRID_API_KEY="SG.xxxxxxxxxxxxxxxxxxxxx"
# Test
tsx scripts/test-email.tsReference: EMAIL-SETUP.md
Choose providers to enable:
# 1. Create OAuth app: https://console.cloud.google.com/
# 2. Get Client ID and Secret
# 3. Set redirect URI: https://yourdomain.com/api/auth/oauth/callback
export NEXT_PUBLIC_GOOGLE_CLIENT_ID="xxxxx.apps.googleusercontent.com"
export GOOGLE_CLIENT_SECRET="GOCSPX-xxxxx"# 1. Create OAuth app: https://github.com/settings/developers
# 2. Get Client ID and Secret
export NEXT_PUBLIC_GITHUB_CLIENT_ID="Iv1.xxxxx"
export GITHUB_CLIENT_SECRET="xxxxx"Reference: OAUTH-SETUP-GUIDE.md
# Start backend services
cd backend
nself start
# Verify services
nself status
# Expected services:
# β
PostgreSQL (port 5432)
# β
Hasura GraphQL (port 8080)
# β
Nhost Auth (port 4000)
# β
MinIO Storage (port 9000)
# β
MeiliSearch (port 7700)Create .env.production:
# REQUIRED
NEXT_PUBLIC_ENV=production
NEXT_PUBLIC_USE_DEV_AUTH=false
NEXT_PUBLIC_APP_URL=https://yourdomain.com
# Backend (from nself)
NEXT_PUBLIC_GRAPHQL_URL=https://api.yourdomain.com/v1/graphql
NEXT_PUBLIC_AUTH_URL=https://auth.yourdomain.com/v1/auth
NEXT_PUBLIC_STORAGE_URL=https://storage.yourdomain.com/v1/storage
# Email (CRITICAL)
EMAIL_PROVIDER=sendgrid
EMAIL_FROM_NAME=nChat
[email protected]
SENDGRID_API_KEY=${SENDGRID_API_KEY}
# OAuth (Choose which to enable)
NEXT_PUBLIC_GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
NEXT_PUBLIC_GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
# Security (CRITICAL)
JWT_SECRET=${JWT_SECRET} # Min 32 chars
HASURA_ADMIN_SECRET=${HASURA_ADMIN_SECRET} # Min 32 chars
# Optional (for voice/video)
NEXT_PUBLIC_LIVEKIT_URL=wss://livekit.yourdomain.com
LIVEKIT_API_KEY=${LIVEKIT_API_KEY}
LIVEKIT_API_SECRET=${LIVEKIT_API_SECRET}# Install dependencies
pnpm install
# Run type checking
pnpm type-check
# Run tests
pnpm test
# Build for production
pnpm build
# Start production server
pnpm start# Send test password reset
curl -X POST https://yourdomain.com/api/auth/password-reset \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]"}'
# Check SendGrid dashboard for delivery
# https://app.sendgrid.com/email_activity- Navigate to
https://yourdomain.com/login - Click "Continue with Google" (or other provider)
- Authorize app
- Verify redirect back to app
- Check user created in database
- Start a call from any channel
- Verify CallWindow opens
- Test mute/unmute
- Test video on/off
- Test screen share
- Change all default passwords
- Generate strong JWT secret (32+ chars)
- Generate strong Hasura admin secret (32+ chars)
- Enable HTTPS everywhere
- Configure CORS properly
- Set up rate limiting
- Enable CSRF protection
- Configure CSP headers
- Set secure cookie flags
- Enable database RLS policies
- Review and limit API permissions
- Set up monitoring/alerting
- Configure backup strategy
- Document incident response plan
# Already configured in codebase
export NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/xxx"
export SENTRY_ORG="your-org"
export SENTRY_PROJECT="nchat"
export SENTRY_AUTH_TOKEN="xxx"- Set up health check endpoint monitoring
- Configure uptime monitoring (UptimeRobot, Pingdom)
- Set up log aggregation (Datadog, LogDNA)
- Configure performance monitoring (New Relic, AppDynamics)
- Set up database monitoring
- Configure email delivery monitoring
- Email service (SendGrid)
- OAuth providers (Google, GitHub)
- User authentication
- Password reset
- Email verification
- User profiles
- Channels (public/private)
- Direct messages
- File uploads
- Message search
- Voice/video calls (requires LiveKit)
- Live streaming (requires Mux or custom)
- Screen sharing
- Push notifications
- Mobile apps
- Database (PostgreSQL)
- GraphQL API (Hasura)
- Authentication (Nhost Auth)
- File storage (MinIO/S3)
- Search (MeiliSearch)
- SendGrid (email)
- LiveKit (voice/video) - Optional
- Mux (streaming) - Optional
- Twilio (SMS) - Optional
- Firebase (push) - Optional
# Check SendGrid API key
curl https://api.sendgrid.com/v3/api_keys \
-H "Authorization: Bearer $SENDGRID_API_KEY"
# Verify sender email in SendGrid dashboard
# Check email logs: pnpm backend:logs | grep email# Verify redirect URI matches exactly
echo $NEXT_PUBLIC_APP_URL/api/auth/oauth/callback
# Check client ID is set
echo $NEXT_PUBLIC_GOOGLE_CLIENT_ID
# Verify OAuth app is not disabled in provider console# Check database status
cd backend && nself status
# Restart services
nself stop && nself start
# Check logs
nself logs postgres
nself logs hasura- Full Setup:
EMAIL-SETUP.md - OAuth:
OAUTH-SETUP-GUIDE.md - Completion Report:
V0.9.1-COMPLETION-REPORT.md - Project README:
README.md
- SendGrid Docs: https://docs.sendgrid.com/
- LiveKit Docs: https://docs.livekit.io/
- Hasura Docs: https://hasura.io/docs/
- Next.js Docs: https://nextjs.org/docs
- GitHub Issues: https://github.com/nself/nchat/issues
- Discord: https://discord.gg/nself
- Email: [email protected]
- Email service
- OAuth authentication
- Password flows
- Core messaging
- File uploads
- Search
- OAuth providers (get API keys)
- Domain authentication
- SSL certificates
- CDN setup
- Voice/video calls
- Live streaming
- Push notifications
- Mobile apps
- Single server deployment OK
- Basic PostgreSQL setup OK
- SendGrid free tier OK
- Add read replicas
- Enable CDN
- Upgrade SendGrid plan
- Add caching layer (Redis)
- Horizontal scaling
- Database sharding
- Load balancing
- Enterprise SendGrid
- LiveKit self-hosted cluster
Quick Start Guide Version: 1.0 Last Tested: February 3, 2026 Deployment Time: ~2 hours (with all services)