SHOWCASE - nself-org/nchat GitHub Wiki
ษณChat Feature Showcase
Version: 0.9.2 Purpose: Demonstrate the complete capabilities of ษณSelf CLI through a production-grade reference implementation Live Demos: See this in action at:
- ๐ Local: chat.local.nself.org (or localhost:3000)
- ๐งช Staging: chat.staging.nself.org
- ๐ Production: chat.nself.org
๐ฏ What This Showcases
1. Complete Backend Infrastructure (ษณSelf CLI)
One Command, Everything Running:
cd backend
nself start
What Starts Automatically:
- โ PostgreSQL with 222 tables
- โ Hasura GraphQL API
- โ Nhost Authentication
- โ MinIO S3 Storage
- โ Redis Cache
- โ MeiliSearch
- โ MailPit (dev email)
- โ Nginx with SSL
- โ Admin Dashboard
- โ WebSocket Server
- โ Storage Service
Zero Configuration:
- ๐ Automatic SSL certificates (no browser warnings!)
- ๐ Works with
*.local.nself.orgdomains (resolves to 127.0.0.1) - ๐ All services pre-configured and talking to each other
- ๐ JWT auth configured
- ๐ GraphQL schema generated
- ๐๏ธ Database migrations ready
2. Real-Time Features (GraphQL Subscriptions)
Live Demo Scenarios:
Scenario A: Typing Indicators
- Login as
[email protected]in Browser 1 - Login as
[email protected]in Browser 2 - Start typing in Browser 1 โ See "User is typing..." in Browser 2
- Stop typing โ Indicator disappears
Scenario B: Instant Message Delivery
- Open same channel in 2 browsers (different users)
- Send message in Browser 1 โ Appears instantly in Browser 2
- No refresh needed, no polling, true push
Scenario C: Presence Tracking
- User comes online โ Green dot appears
- User goes offline โ Gray dot
- User idle for 5 minutes โ Yellow dot
Technical Implementation:
- Uses Hasura GraphQL subscriptions over WebSocket
- Real-time database changes streamed to clients
- Efficient: Only sends changed data
- Scalable: Hasura handles connection management
3. Authentication Showcase
11 OAuth Providers Configured:
- ๐ต Google
- ๐ GitHub
- ๐ช Microsoft
- ๐ Apple
- ๐ Facebook
- ๐ฆ Twitter/X
- ๐ผ LinkedIn
- ๐ฎ Discord
- ๐ ID.me (military verification)
- ๐ฑ Twitch
- ๐จ Figma
Email/Password:
- โ Secure bcrypt hashing
- โ Email verification
- โ Password reset flows
- โ Rate limiting
Magic Links:
- โ Passwordless login
- โ Time-limited tokens
- โ One-click authentication
Two-Factor Authentication:
- โ TOTP (Google Authenticator, Authy)
- โ Backup codes
- โ Recovery options
Demo Accounts (Local/Staging Only):
Role hierarchy with descending access levels (1 = highest, 6 = no special role):
| # | Password | Role | Showcase | |
|---|---|---|---|---|
| 1 | [email protected] | password |
Owner | Top level - Cannot be removed, all access |
| 2 | [email protected] | password |
Admin | High-level administration |
| 3 | [email protected] | password |
Moderator | Content moderation |
| 4 | [email protected] | password |
Support | User support with limited admin |
| 5 | [email protected] | password |
Helper | Community helper with limited mod |
| 6 | [email protected] | password |
(no role) | Regular user - No special permissions |
4. Per-App RBAC (Monorepo Ready)
What This Means:
- โ Same user can have different roles in different apps
- โ Login once, access multiple apps (SSO)
- โ Granular permissions per application
Example Monorepo Setup:
monorepo/
โโโ backend/ # One shared ษณSelf backend
โโโ nchat/ # This app
โโโ ntv/ # Media streaming app
โโโ nfamily/ # Family organizer app
User Experience:
- User logs in to ษณChat โ Admin role
- User visits ษณTV โ Member role (different!)
- User visits ษณFamily โ Owner role (different again!)
- No separate logins - SSO across all apps
Showcase Scenario:
# Login as [email protected]
curl -X POST https://auth.local.nself.org/v1/signin/email-password \
-d '{"email":"[email protected]","password":"password"}'
# Check role in nchat
query {
app_user_roles(where: {user_id: {_eq: "..."}}) {
app_id
role
}
}
# Returns: [
# { app_id: "nchat", role: "admin" },
# { app_id: "ntv", role: "member" }
# ]
5. Feature Parity with Major Platforms
Messaging: โ Whatsapp/Telegram Level
- โ Direct messages (1-on-1)
- โ Group channels
- โ Threads (nested conversations)
- โ Message reactions
- โ Pin important messages
- โ Message search
- โ Edit/delete messages
- โ Message history
- โ Unread indicators
- โ @mentions
Collaboration: โ Slack/Discord Level
- โ Public channels
- โ Private channels
- โ Channel descriptions
- โ Channel topics
- โ Channel permissions
- โ User roles (owner, admin, mod, member, guest)
- โ File uploads (S3 storage)
- โ Image previews
- โ Link previews
- โ Code snippets
Moderation: โ Discord/Telegram Level
- โ Delete messages
- โ Ban users
- โ Timeout users
- โ Warn users
- โ Audit logs
- โ Report system
- โ Auto-moderation (profanity filter)
Advanced: โ Enterprise Level
- โ End-to-end encryption (Double Ratchet)
- โ Voice & video calls (WebRTC)
- โ Screen sharing
- โ File sharing with S3
- โ Full-text search (MeiliSearch)
- โ Analytics dashboard
- โ Webhooks
- โ Bot framework
- โ Custom integrations
6. Developer Experience (Dev โ Staging โ Prod)
Local Development:
Domain: chat.local.nself.org
Backend: Runs on Docker (nself start)
Frontend: localhost:3000 (pnpm dev)
Database: PostgreSQL local
Storage: MinIO local
Email: MailPit (all emails captured locally)
Staging (VPS):
Domain: chat.staging.nself.org
Backend: Same nself setup, ENV=staging
Frontend: Next.js on VPS
Database: PostgreSQL on VPS
Storage: MinIO or S3
Email: Real SMTP (SendGrid, AWS SES, etc.)
Protection: HTTP basic auth (team password)
Production (Vercel):
Domain: chat.nself.org
Backend: nself on dedicated server
Frontend: Vercel edge network
Database: PostgreSQL production
Storage: AWS S3 or CloudFlare R2
Email: Production SMTP
SSL: Let's Encrypt via nself
CDN: Vercel + CloudFlare
What Makes This Easy:
- โ Same codebase for all environments
- โ
Environment-specific
.envfiles (.env.dev,.env.staging,.env.prod) - โ
One command deploys everything (
nself deploy staging) - โ Automatic SSL in all environments
- โ Zero-downtime deployments
- โ Rollback support
7. White-Label Customization
Setup Wizard (12 Steps):
- Welcome
- Owner information
- Branding (name, logo, colors)
- Theme selection (27 presets)
- Landing page style
- Auth methods (which OAuth providers)
- Access permissions (open/invite/domain-restricted)
- Features toggle (enable/disable features)
- Integrations (Slack, GitHub, etc.)
- Legal (terms, privacy policy)
- SEO settings
- Review and launch
What Can Be Customized:
- โ App name and tagline
- โ Logo and favicon
- โ Color scheme (27 presets + custom)
- โ Light/dark mode
- โ Custom CSS
- โ Domain (your-domain.com)
- โ Email templates
- โ Legal documents
- โ Social media links
- โ Landing page style
Result: Completely branded product in 10 minutes
8. Multi-Platform Deployment
Platforms Supported:
- โ Web (Next.js 15)
- โ iOS (Capacitor)
- โ Android (Capacitor)
- โ Windows Desktop (Electron)
- โ macOS Desktop (Electron)
- โ Linux Desktop (Electron)
One Codebase, Six Platforms:
frontend/
โโโ src/ # Shared code (99%)
โโโ platforms/
โ โโโ mobile/ # iOS/Android builds
โ โโโ desktop/ # Electron builds
Build Commands:
# Web
pnpm build
# Mobile
cd platforms/mobile
pnpm build:ios
pnpm build:android
# Desktop
cd platforms/desktop
pnpm build:mac
pnpm build:win
pnpm build:linux
๐งช Testing Scenarios for Demos
Quick Demo (5 minutes)
1. Clone and Start (2 min)
git clone https://github.com/nself-org/nchat.git
cd nself-nchat/backend
nself start
# In new terminal
cd frontend
pnpm install && pnpm dev
2. Login as Demo User (1 min)
- Visit http://localhost:3000
- Login as
[email protected]/password
3. Show Real-Time (2 min)
- Open second browser as
[email protected] - Start typing โ See typing indicator
- Send message โ Appears instantly
Talking Points:
- "One command started 11 backend services"
- "Automatic SSL with zero configuration"
- "Real-time features work out of the box"
- "Production-ready infrastructure"
Full Demo (30 minutes)
Part 1: Setup Speed (5 min)
- Clone repository
- Run
nself start - Show Docker containers spinning up
- Show all service URLs working
- No configuration needed!
Part 2: Authentication (5 min)
- Show 6 demo users with different roles
- Login as owner โ Full access
- Login as user โ Limited access
- Show OAuth provider configuration
- Demonstrate magic links
Part 3: Real-Time Features (5 min)
- Two browsers side-by-side
- Typing indicators
- Instant message delivery
- Presence updates
- Reactions
Part 4: Permissions (5 min)
- Login as regular user โ Try to delete message โ Denied
- Login as moderator โ Delete any message โ Success
- Login as admin โ Delete channel โ Success
- Show per-app RBAC concept
Part 5: Developer Experience (5 min)
- Show code structure
- Explain environment flow (dev/staging/prod)
- Show how easy deployment is
- Demonstrate white-label customization
Part 6: Production Features (5 min)
- Show test coverage (98%+)
- Show build passing (0 errors)
- Show monitoring (Grafana)
- Show scalability options
๐ Key Metrics to Highlight
Setup Time:
- โฑ๏ธ 5 minutes from clone to running app
- ๐ง 3 commands total
- ๐ฆ 11 services started automatically
Feature Completeness:
- โ 98% test coverage
- โ 0 TypeScript errors
- โ 222 database tables
- โ Feature parity with Slack/Discord/Telegram
Production Ready:
- ๐ End-to-end encryption
- ๐ Monitoring built-in
- ๐ Scalable architecture
- ๐พ Automated backups
Developer Experience:
- ๐จ White-label in 10 minutes
- ๐ Deploy to 6 platforms
- ๐ Zero-downtime deploys
- ๐ 100% documented
๐ค Demo Scripts
For Technical Audience
"Let me show you how fast you can get a production-grade chat app running with ษณSelf CLI."
Clone and start backend
"Notice: One command just started PostgreSQL, Hasura GraphQL, authentication, storage, search, and 6 other services. All pre-configured. Automatic SSL certificates. No YAML files to edit."
Start frontend
"Frontend connects to backend via GraphQL. Real-time subscriptions already working."
Show real-time features
"See the typing indicators? GraphQL subscriptions. Not polling. True push. Same technology Slack and Discord use."
Show authentication
"Six demo users with different permission levels. Owner, admin, moderator, regular member. Try to delete a message as a regular user? Denied. As a moderator? Works. That's row-level security enforced at the database level."
Show deployment options
"Same codebase deploys to web, iOS, Android, Windows, macOS, Linux. From local development to staging to production with environment-specific configs. One backend serves all platforms."
For Business Audience
"This is a complete Slack/Discord competitor that you can white-label and deploy yourself in under 10 minutes."
Show features
"Everything you expect: Direct messages, channels, file sharing, search, voice/video calls. Plus end-to-end encryption, which even Slack doesn't have."
Show customization
"Want it to look like your brand? Change the logo, colors, domain. Setup wizard walks you through it. Ten minutes total."
Show deployment options
"Deploy on your infrastructure - your VPS, your AWS account, or even your laptop. Or use Vercel for the frontend. Your data stays where you want it."
Show cost comparison
"Slack charges $7-12 per user per month. This? The software is free. You only pay for hosting - maybe $50-100/month total for unlimited users."
๐ What They Get
When someone clones nself-chat, they get:
Immediate:
- โ Working chat application
- โ 6 demo users to test with
- โ Real-time features
- โ All 11 backend services
- โ Automatic SSL
Customizable:
- โ White-label setup wizard
- โ 27 theme presets
- โ Enable/disable features
- โ Configure OAuth providers
- โ Modify everything
Production:
- โ End-to-end encryption
- โ Voice/video calls
- โ File storage (S3)
- โ Full-text search
- โ Monitoring
- โ Backups
Deployment:
- โ Web (Next.js)
- โ iOS (Capacitor)
- โ Android (Capacitor)
- โ Desktop (Electron)
- โ All from one codebase
Support:
- โ Complete documentation
- โ Code examples
- โ Test suite (98% coverage)
- โ GitHub community
๐ Links
- Documentation: Home.md
- Architecture: ARCHITECTURE.md
- Deployment: deployment/
- GitHub: https://github.com/nself-org/nchat
- ษณSelf CLI: https://github.com/nself-org/cli
Questions? Open an issue or join our Discord!