Overview - nself-org/nchat GitHub Wiki
Version: v0.4.2 Last Updated: February 1, 2026 Category: Backend Infrastructure
- Introduction
- What is nself CLI?
- Why Use nself CLI?
- Core Features
- Architecture Overview
- Service Ecosystem
- Use Cases
- Comparison with Alternatives
- Getting Started
- Resources
nself CLI is a comprehensive backend infrastructure tool that provides everything you need to build production-ready applications with a single command. It eliminates the complexity of setting up and managing multiple backend services by providing a unified, Docker-based infrastructure stack.
| Property | Value |
|---|---|
| Current Version | v0.4.2 |
| License | Open Source |
| Platform | macOS, Linux, Windows (WSL2) |
| Requirements | Docker/Podman, 16GB+ RAM |
| Language | Go (CLI), Multiple (Services) |
| Project Structure |
.backend/ directory |
nself CLI is a backend-as-code infrastructure tool that bundles:
- PostgreSQL 16 - Production-grade database with 60+ extensions
- Hasura GraphQL Engine - Instant GraphQL API for your database
- Nhost Auth - Complete authentication system with social providers
- MinIO - S3-compatible object storage
- Redis - High-performance caching and session management
- Nginx - Reverse proxy with automatic SSL/TLS
- MeiliSearch - Lightning-fast full-text search
- Monitoring Stack - Prometheus, Grafana, Loki, and more
All services are:
- ✅ Pre-configured - Works out of the box with sensible defaults
- ✅ Production-ready - Battle-tested configurations
- ✅ Docker-based - Consistent across environments
- ✅ Locally networked - Services communicate seamlessly
- ✅ Automated - One command to start everything
Traditional Approach:
# Install PostgreSQL
brew install postgresql@16
createdb myapp
# Install Redis
brew install redis
redis-server &
# Set up Hasura
docker run -d hasura/graphql-engine
# ...configure environment variables
# ...set up metadata
# ...configure permissions
# Set up Auth
# ...find an auth solution
# ...configure OAuth providers
# ...set up email templates
# ...configure JWT secrets
# Set up Storage
# ...configure S3 or MinIO
# ...set up buckets
# ...configure CORS
# Days/weeks of configuration later...With nself CLI:
nself init myapp
cd myapp/.backend
nself start
# Everything running in 2 minutes!Get a complete backend stack running in minutes instead of days:
- No more hunting for Docker Compose configurations
- No more wrestling with environment variables
- No more service integration headaches
- No more authentication boilerplate
Every service is configured with production best practices:
- Security hardening built-in
- Performance optimizations included
- Monitoring and observability ready
- Backup and recovery strategies
Everyone on your team gets the same environment:
- No "works on my machine" issues
- Identical dev/staging/production setups
- Version-controlled configuration
- Easy onboarding for new developers
Stop managing infrastructure, start building features:
- GraphQL API auto-generated from your database
- Authentication handled (email, social, magic links)
- File storage ready to use
- Real-time subscriptions included
Open-source and self-hostable:
- No per-user licensing fees
- No vendor lock-in
- Run on any cloud provider
- Scale on your terms
Start simple, add complexity as needed:
- Core services (4): PostgreSQL, Hasura, Auth, Nginx
- Optional services (7): Redis, MinIO, Functions, Search, Email
- Monitoring bundle (10): Full observability stack
- Custom services: Add your own as needed
nself start # Start all services
nself stop # Stop all services
nself status # Check service health
nself logs # View service logs60+ PostgreSQL extensions available including:
- pgcrypto - Cryptographic functions
- pg_stat_statements - Query performance tracking
- uuid-ossp - UUID generation
- pg_trgm - Full-text search similarity
- postgis - Geographic objects (optional)
- timescaledb - Time-series data (optional)
- pg_cron - Job scheduling (optional)
Instant GraphQL API with:
- Auto-generated queries and mutations
- Real-time subscriptions
- Role-based permissions
- Remote schemas
- Event triggers
- Actions (custom business logic)
Complete auth system supporting:
- Email/Password authentication
- Magic link (passwordless) login
- Social OAuth (Google, GitHub, Apple, etc.)
- Multi-factor authentication (TOTP)
- Session management
- JWT token generation
- Email verification
- Password reset flows
S3-compatible storage with:
- Bucket management
- File upload/download
- Pre-signed URLs
- Access control policies
- Versioning
- Lifecycle policies
- Browser console
High-performance caching for:
- Session storage
- Query result caching
- Rate limiting
- Real-time features
- Pub/Sub messaging
- Job queues
Lightning-fast search with:
- Typo tolerance
- Faceted search
- Filtering and sorting
- Instant search-as-you-type
- Multi-language support
- Custom ranking rules
Complete observability with 10 services:
- Prometheus - Metrics collection
- Grafana - Dashboards and visualization
- Loki - Log aggregation
- Promtail - Log shipping
- Alertmanager - Alert management
- Node Exporter - System metrics
- cAdvisor - Container metrics
- Jaeger - Distributed tracing
- Tempo - Trace aggregation
- OpenTelemetry Collector - Telemetry pipeline
Web-based administration panel on port 3021:
- Service health monitoring
- Database management
- User administration
- Log viewer
- Metrics dashboard
- Configuration editor
┌─────────────────────────────────────────────────────────┐
│ Nginx (Port 80/443) │
│ SSL/TLS Termination │
│ Reverse Proxy + Router │
└────────────┬────────────────────────────────────────────┘
│
┌───────┴────────┐
│ │
▼ ▼
┌─────────┐ ┌─────────┐
│ Hasura │ │ Auth │
│ :8080 │◄────►│ :4000 │
└────┬────┘ └────┬────┘
│ │
│ ┌───────────┴────────┐
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌─────────┐
│ PostgreSQL │ │ MinIO │
│ :5432 │ │ :9000 │
└──────────────┘ └─────────┘
▲ ▲
│ │
│ ┌───────────┬────────┘
│ │ │
▼ ▼ ▼
┌─────────┐ ┌─────────┐
│ Redis │ │ Storage │
│ :6379 │ │ :5001 │
└─────────┘ └─────────┘
All services run on a dedicated Docker network:
Network: {project_name}_network
Driver: bridge
Isolation: Container-to-container communication
External Access: Via Nginx reverse proxy onlyvolumes/
├── postgres_data/ # Database files
├── minio_data/ # Object storage files
├── redis_data/ # Cache data
├── mailpit_data/ # Dev email storage
└── admin_data/ # nself-admin data
| Service | Internal Port | External Port | URL |
|---|---|---|---|
| Nginx | 80, 443 | 80, 443 | http://localhost |
| Hasura | 8080 | 8080 | http://api.localhost/v1/graphql |
| Auth | 4000 | - | http://auth.localhost/v1/auth |
| PostgreSQL | 5432 | 5432 | localhost:5432 |
| MinIO | 9000, 9001 | - | http://storage.localhost |
| Redis | 6379 | 6379 | localhost:6379 |
| Storage | 5001 | - | http://storage.localhost/v1/storage |
| Mailpit | 8025 | 8025 | http://localhost:8025 |
| nself-admin | 3021 | 3021 | http://localhost:3021 |
-
Image:
postgres:16-alpine - Purpose: Primary data store
-
Configuration:
- Shared buffers: 256MB
- Max connections: 200
- Extensions: 60+ available
-
Health Check:
pg_isready
-
Image:
hasura/graphql-engine:v2.44.0 - Purpose: GraphQL API layer
-
Features:
- Auto-generated CRUD operations
- Real-time subscriptions
- Permission system
- Event triggers
- Console: Enabled in dev mode
-
Image:
nhost/hasura-auth:0.36.0 - Purpose: Authentication service
-
Features:
- Multiple auth providers
- JWT token generation
- Email verification
- Password reset
-
Health Check:
/healthzendpoint
-
Image:
nginx:alpine - Purpose: Reverse proxy and SSL termination
-
Features:
- Automatic routing
- SSL certificate management
- WebSocket support
- Static file serving
- Purpose: S3-compatible object storage
- Console: Port 9001
- Default Credentials: minioadmin/minioadmin
- Purpose: Caching and session storage
- Persistence: AOF + RDB snapshots
- Eviction: LRU policy
- Purpose: File upload/download API
-
Features:
- S3 integration
- Access control
- Image transformations
- Purpose: Email testing (development)
- UI: Port 8025
- SMTP: Port 1025
- Replaces: MailHog (deprecated)
- Purpose: Full-text search
- API: Port 7700
- Features: Instant search, typo tolerance
- Purpose: Custom business logic
- Runtime: Node.js, Python, Go
- Deployment: Hot reload in dev
- Purpose: ML experiment tracking
- UI: Port 5000
- Storage: S3/MinIO backend
Enables 10 services for full observability:
| Service | Port | Purpose |
|---|---|---|
| Prometheus | 9090 | Metrics storage |
| Grafana | 3000 | Dashboards |
| Loki | 3100 | Log aggregation |
| Promtail | 9080 | Log collection |
| Alertmanager | 9093 | Alert routing |
| Node Exporter | 9100 | Host metrics |
| cAdvisor | 8080 | Container metrics |
| Jaeger | 16686 | Trace UI |
| Tempo | 3200 | Trace storage |
| OTEL Collector | 4317 | Telemetry pipeline |
- Port: 3021 (NOT 3100 - Loki uses 3100)
- Purpose: Web-based admin panel
-
Features:
- Service status dashboard
- Log viewer
- Database browser
- User management
- Configuration editor
- Metrics overview
Perfect for building multi-tenant SaaS applications:
Stack:
- Frontend: Next.js, React, Vue
- Backend: nself CLI (GraphQL API)
- Database: PostgreSQL (multi-tenant schema)
- Auth: Social login + email
- Storage: User uploads to MinIO
- Cache: Redis for sessions
- Search: MeiliSearch for app searchExample: nself-chat (this project!)
Everything needed for online stores:
Features:
- Product catalog (PostgreSQL)
- Image storage (MinIO)
- Search (MeiliSearch)
- User accounts (Nhost Auth)
- Shopping cart (Redis)
- Order processing (Functions)
- Email notifications (SMTP integration)Build a headless CMS:
Stack:
- Content: PostgreSQL (structured data)
- Media: MinIO (images, videos, PDFs)
- API: Hasura (auto-generated GraphQL)
- Search: MeiliSearch (content search)
- Drafts: Redis (temporary storage)
- Publishing: Functions (webhooks)Data collection and visualization:
Stack:
- Events: PostgreSQL (time-series data)
- Processing: Functions (data transformation)
- Caching: Redis (query results)
- Dashboards: Grafana (visualization)
- Metrics: Prometheus (time-series metrics)Build the next big social platform:
Features:
- User profiles (PostgreSQL)
- Posts and comments (PostgreSQL)
- Media uploads (MinIO)
- Real-time updates (Hasura subscriptions)
- Feed caching (Redis)
- Content search (MeiliSearch)
- Notifications (Functions)Create a unified API for microservices:
Architecture:
- API Layer: Hasura (GraphQL gateway)
- Services: Remote schemas
- Auth: Nhost (SSO)
- Cache: Redis (response caching)
- Rate Limiting: Redis
- Monitoring: Prometheus + Grafana| Feature | nself CLI | Firebase |
|---|---|---|
| Hosting | Self-hosted | Cloud only |
| Cost | Free (your infra) | Pay per use |
| Database | PostgreSQL (SQL) | Firestore (NoSQL) |
| Queries | GraphQL + SQL | Limited queries |
| Lock-in | None | Vendor lock-in |
| Offline | Full control | Limited |
| Extensions | 60+ PostgreSQL | Limited |
| Auth | Self-hosted | Cloud-based |
Winner: nself CLI for self-hosting, Firebase for quick prototypes
| Feature | nself CLI | Supabase |
|---|---|---|
| Hosting | Self-hosted | Cloud or self-host |
| Cost | Free | Free tier + paid |
| GraphQL | Hasura (advanced) | PostgREST (basic) |
| Auth | Nhost Auth | Supabase Auth |
| Storage | MinIO | Supabase Storage |
| Admin UI | nself-admin | Supabase Studio |
| Flexibility | Very high | Medium |
| Setup | One command | Docker Compose |
Winner: Tie - nself CLI for control, Supabase for managed service
| Feature | nself CLI | Hasura Cloud |
|---|---|---|
| Hosting | Self-hosted | Cloud only |
| Cost | Free | $99+/month |
| Features | Full stack | GraphQL only |
| Auth | Included (Nhost) | Bring your own |
| Storage | Included (MinIO) | Bring your own |
| Database | Included | Bring your own |
| Setup | One command | Manual config |
Winner: nself CLI (Hasura Cloud is expensive for small teams)
| Feature | nself CLI | AWS Amplify |
|---|---|---|
| Vendor | Open source | AWS |
| Cost | Free | Pay per use |
| Lock-in | None | AWS ecosystem |
| Database | PostgreSQL | DynamoDB/Aurora |
| Learning | Standard tech | AWS-specific |
| Local Dev | Full-featured | Limited |
| Deployment | Flexible | AWS only |
Winner: nself CLI for portability, Amplify for AWS shops
| Feature | nself CLI | Docker Compose |
|---|---|---|
| Setup | Automated | Manual |
| Config | Smart defaults | Full manual config |
| Services | 20+ ready | Build yourself |
| Updates | One command | Manual updates |
| Monitoring | Built-in | DIY |
| Docs | Comprehensive | Per-service |
| Time to prod | Hours | Days/weeks |
Winner: nself CLI (it generates optimized Docker Compose!)
# Docker
docker --version # 20.10+ required
# Docker Compose
docker compose version # v2.0+ required
# Disk space
df -h # 10GB+ free space recommended
# Memory
# 16GB RAM recommended (8GB minimum)# macOS/Linux
curl -fsSL https://nself.org/install.sh | sh
# Verify installation
nself --version # Should show v0.4.2# Create new project
nself init myapp
# Navigate to backend
cd myapp/.backend
# Review configuration
cat .env
# Start all services
nself start
# Check status
nself status
# View URLs
nself urls# Hasura Console
open http://localhost:8080/console
# API Endpoint
curl http://api.localhost/v1/graphql
# Admin UI (if enabled)
open http://localhost:3021
# Email Testing (if enabled)
open http://localhost:8025// Next.js example
// .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-
Installation Guide:
docs/nself-cli/Installation.md -
Quick Start:
docs/nself-cli/Quick-Start.md -
Commands Reference:
docs/nself-cli/Commands.md -
Services Guide:
docs/nself-cli/Services.md -
Configuration:
docs/nself-cli/Configuration.md -
Troubleshooting:
docs/nself-cli/Troubleshooting.md
- Website: https://nself.org
- GitHub: https://github.com/nself/nself
- Documentation: https://docs.nself.org
- Discord: https://discord.gg/nself
- Twitter: https://twitter.com/nself_dev
- nself-chat: Full-featured team communication platform
- nself-cms: Headless content management system
- nself-shop: E-commerce starter
- nself-social: Social network boilerplate
- Discord: Join 5,000+ developers
- GitHub Discussions: Ask questions, share projects
- Twitter: Follow for updates and tips
- YouTube: Video tutorials and demos
- Read the Quick Start → Get up and running in 5 minutes
- Explore Services → Learn what each service provides
- Review Commands → Master the CLI
- Configure Your Stack → Enable optional services
- Build Your App → Focus on your application logic!
nself CLI is built on these principles:
- Convention over Configuration - Smart defaults that just work
- Developer Experience First - Make common tasks effortless
- Production-Ready - No "toy" configs, real battle-tested setups
- Open and Flexible - No vendor lock-in, modify anything
- Community-Driven - Built by developers, for developers
Ready to build? Head to the Quick Start Guide!