Skip to content

πŸ”₯A production-grade infrastructure platform that brings enterprise-level capabilities to your self-hosted environment. Built with modern microservices architecture, it provides everything you need to run scalable web applications with observability, security, and AI integration built-in. πŸ”₯

License

Notifications You must be signed in to change notification settings

sebhosting/NeXuS

Repository files navigation

NeXuS πŸš€

The ultimate cloud-native infrastructure management platform Self-hosted, production-ready, battle-tested microservices architecture

MIT License Docker TypeScript Claude MCP


What is NeXuS?

NeXuS is a production-grade infrastructure platform that brings enterprise-level capabilities to your self-hosted environment. Built with modern microservices architecture, it provides everything you need to run scalable web applications with observability, security, and AI integration built-in.

Key Features

  • πŸ” Zero-Trust Security β€” JWT auth, WAF, rate limiting, Cloudflare integration
  • ⚑ Lightning Fast β€” Redis + Memcached multi-tier caching
  • πŸ“Š Full Observability β€” Prometheus metrics + Grafana dashboards
  • πŸ€– AI-Native β€” Built-in AI gateway with Claude MCP server
  • 🎯 Production Ready β€” Docker Compose orchestration, health checks, automated SSL
  • 🌐 CDN-Backed β€” Cloudflare integration for global edge delivery
  • πŸ“ CMS Included β€” Headless CMS with MongoDB backend
  • πŸ”„ Auto-Scaling β€” Ready for Kubernetes deployment

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Cloudflare CDN                        β”‚
β”‚                  (SSL, WAF, DDoS)                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
              β”‚   Traefik   β”‚ ← Reverse Proxy
              β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚            β”‚            β”‚
  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
  β”‚Frontendβ”‚  β”‚   API   β”‚  β”‚  Auth   β”‚
  β”‚ Next.jsβ”‚  β”‚ Express β”‚  β”‚ Service β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                   β”‚            β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚           β”‚            β”‚           β”‚
  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”
  β”‚PostgreSQLβ”‚ β”‚ Redis β”‚   β”‚ MongoDB β”‚ β”‚Memcachedβ”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Services

Service Purpose Port URL
Frontend Next.js web app 3000 https://nexus.sebhosting.com
API Gateway Main REST API, Docker stats 4000 https://api.sebhosting.com
Auth Service JWT authentication 6000 https://auth.sebhosting.com
CMS Service Headless content management 7000 https://cms.sebhosting.com
CDN Service Static asset delivery 7001 https://cdn.sebhosting.com
Cache Service Distributed caching layer 7002 https://cache.sebhosting.com
WAF Service Web application firewall 7003 https://waf.sebhosting.com
AI Gateway Claude API integration 5000 https://ai-gateway.sebhosting.com
MCP Server Claude Code integration 5001 https://mcp.sebhosting.com
Grafana Metrics visualization 3000 https://grafana.sebhosting.com
Prometheus Metrics collection 9090 Internal

Databases

  • PostgreSQL 16 β€” Primary relational database
  • MongoDB 7 β€” Document store for CMS
  • Redis 7 β€” Session store & caching
  • Memcached β€” High-performance object cache

Quick Start

Prerequisites

  • Docker 29+ & Docker Compose
  • Node.js 25+ (for local development)
  • Domain with Cloudflare DNS (optional)

Installation

# Clone the repository
git clone https://github.com/sebhosting/nexus.git
cd nexus

# Copy environment template
cp .env.example .env

# Edit .env with your credentials
nano .env

# Start all services
cd infrastructure/docker
docker compose up -d

# Check health status
curl http://localhost:4000/health

Environment Variables

# Database Passwords
POSTGRES_PASSWORD=your-secure-password
MONGODB_PASSWORD=your-secure-password
REDIS_PASSWORD=your-secure-password

# JWT Secret
JWT_SECRET=your-jwt-secret-min-32-chars

# Cloudflare (optional)
CLOUDFLARE_API_TOKEN=your-api-token
CLOUDFLARE_ZONE_ID=your-zone-id

# Grafana
GRAFANA_PASSWORD=admin-password

# Claude MCP (optional)
CF_SERVICE_TOKEN_ID=your-service-token-id
CF_SERVICE_TOKEN_SECRET=your-service-token-secret

Development

Local Development

# Install dependencies
npm install

# Start in development mode
npm run dev

# Build all services
npm run build

Docker Development

# Build and start services
make start

# View logs
make logs

# Stop services
make stop

# Rebuild a specific service
docker compose up -d --build api

Service Structure

nexus/
β”œβ”€β”€ frontend/          # Next.js frontend
β”œβ”€β”€ backend/           # API Gateway (Express)
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ auth-service/  # JWT authentication
β”‚   β”œβ”€β”€ cms-service/   # Headless CMS
β”‚   β”œβ”€β”€ cdn-service/   # Static assets
β”‚   β”œβ”€β”€ cache-service/ # Caching layer
β”‚   β”œβ”€β”€ waf-service/   # Web firewall
β”‚   β”œβ”€β”€ ai-gateway/    # Claude integration
β”‚   └── mcp-server/    # Claude MCP tools
└── infrastructure/
    β”œβ”€β”€ docker/        # Docker Compose configs
    β”œβ”€β”€ prometheus/    # Metrics config
    └── traefik/       # Reverse proxy config

Claude MCP Integration

NeXuS includes a Model Context Protocol (MCP) server that lets Claude Code interact with your infrastructure:

Available Tools

  • nexus_system_overview β€” Get container stats, memory, load average
  • nexus_health_check β€” Ping all services, check HTTP status codes
  • nexus_list_containers β€” List all containers with resource usage
  • nexus_container_stats β€” Detailed stats for a specific container
  • nexus_restart_container β€” Restart a service by name
  • nexus_stop_container β€” Stop a running container

Configure Claude Desktop

Add to ~/.claude/mcp_servers.json:

{
  "nexus-mcp": {
    "url": "https://mcp.sebhosting.com/mcp",
    "headers": {
      "cf-access-client-id": "your-service-token-id",
      "cf-access-client-secret": "your-service-token-secret"
    }
  }
}

Monitoring & Observability

Grafana Dashboards

Access Grafana at https://grafana.sebhosting.com (default: admin / your GRAFANA_PASSWORD)

Pre-configured dashboards:

  • Container resource usage
  • API request metrics
  • Database performance
  • Cache hit rates

Prometheus Metrics

Metrics available at http://nexus-prometheus:9090 (internal only)

# Example queries
rate(http_requests_total[5m])
container_memory_usage_bytes
redis_connected_clients

Health Checks

# Check all services
curl https://api.sebhosting.com/stats

# Individual service health
curl https://auth.sebhosting.com/health
curl https://cms.sebhosting.com/health

Security

Built-in Security Features

  • JWT Authentication β€” Stateless auth with Redis session store
  • Rate Limiting β€” 20 requests/15min on auth endpoints
  • WAF Protection β€” Web application firewall rules
  • CORS Configuration β€” Strict origin policies
  • Cloudflare Integration β€” DDoS protection, SSL/TLS
  • Secret Management β€” Environment-based secrets
  • Network Isolation β€” Internal Docker network for databases

Production Hardening

See infrastructure/docker/docker-compose-HARDENED.yml for additional security configurations:

  • Read-only root filesystems
  • Dropped kernel capabilities
  • Resource limits
  • No-new-privileges flag

Deployment

Production Deployment

  1. Set up Cloudflare DNS pointing to your server
  2. Configure Traefik for Let's Encrypt SSL
  3. Update .env with production credentials
  4. Deploy with Docker Compose:
cd infrastructure/docker
docker compose up -d

Kubernetes (Coming Soon)

K8s manifests and Helm charts are planned for future releases.


API Documentation

Main API Endpoints

GET /health

Returns service health status

GET /stats

Returns Docker container statistics, host metrics, and system info

{
  "timestamp": "2026-02-14T06:19:07.261Z",
  "docker": {
    "containers": "17",
    "running": "17",
    "images": "29",
    "serverVersion": "29.2.1"
  },
  "host": {
    "load1": 0.95,
    "memPercent": 2
  },
  "containers": [...]
}

GET /stats/logs/:name

Get container logs (tail 50 by default)


Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Credits

Built with πŸ”₯ by SEB Powered by: Docker, TypeScript, Next.js, Express, PostgreSQL, MongoDB, Redis, Traefik, Prometheus, Grafana, and Claude AI


Support


Star this repo if NeXuS helped you build something awesome! ⭐

About

πŸ”₯A production-grade infrastructure platform that brings enterprise-level capabilities to your self-hosted environment. Built with modern microservices architecture, it provides everything you need to run scalable web applications with observability, security, and AI integration built-in. πŸ”₯

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages