@bernierllc/neverhub
v1.1.0
Published
NeverHub - Service Discovery and Package Management Platform
Readme
NeverHub
Service Discovery and Package Management Platform
NeverHub is a powerful platform for service discovery, package management, and integration orchestration. It enables packages to discover other packages, receive real-time notifications when dependencies become available, and supports advanced integrations like auto-discovery.
🚀 Quick Start
Installation
npm install @bernierllc/neverhubSetup
Copy environment template:
cp env.neverhub.example .env.neverhubConfigure your environment:
nano .env.neverhubGenerate database schema:
npx neverhub generate:schemaRun database migrations:
npx neverhub migrateStart NeverHub:
npx neverhub dev
📚 Available Commands
# Database Operations
npx neverhub generate:schema # Generate Prisma schema
npx neverhub migrate # Run database migrations
npx neverhub db:studio # Open Prisma Studio
# Development
npx neverhub dev # Start development server
npx neverhub build # Build for production
npx neverhub start # Start production server
# API Key Management
npx neverhub keys:generate # Generate API keys
# Health & Testing
npx neverhub health # Check system health
npx neverhub test # Run tests
npx neverhub test --coverage # Run tests with coverage🔧 Environment Configuration
Required Variables
DATABASE_URL="postgresql://username:password@localhost:5432/neverhub"
JWT_SECRET="your-neverhub-jwt-secret-here"
INTERNAL_API_KEY="your-neverhub-internal-api-key-here"Optional Variables
NEVERHUB_DB_PREFIX="" # Table prefix (optional)
REDIS_URL="redis://localhost:6379" # Redis connection (optional)
NEVERHUB_PORT="3536" # Server port
NEVERHUB_WEBHOOK_BASE_URL="http://localhost:3536"💡 Integration Options
Standalone Service
Run NeverHub as a separate service:
npx neverhub devNext.js Integration
// pages/api/neverhub/[...path].ts
import { createNeverHubHandler } from '@bernierllc/neverhub/nextjs';
export default createNeverHubHandler({
databaseUrl: process.env.NEVERHUB_DATABASE_URL,
redisUrl: process.env.NEVERHUB_REDIS_URL,
tablePrefix: process.env.NEVERHUB_DB_PREFIX,
});Express.js Integration
// app.js
const express = require('express');
const { createNeverHubMiddleware } = require('@bernierllc/neverhub/express');
const app = express();
app.use('/neverhub', createNeverHubMiddleware({
databaseUrl: process.env.NEVERHUB_DATABASE_URL,
redisUrl: process.env.NEVERHUB_REDIS_URL,
tablePrefix: process.env.NEVERHUB_DB_PREFIX,
}));Library Integration
import { createNeverHub } from '@bernierllc/neverhub';
const neverhub = createNeverHub({
databaseUrl: process.env.DATABASE_URL,
redisUrl: process.env.REDIS_URL,
tablePrefix: process.env.NEVERHUB_DB_PREFIX,
});
await neverhub.initialize();
// Register a package
const packageId = await neverhub.registerPackage({
type: 'messaging',
name: 'user-messaging',
version: '1.0.0',
capabilities: [
{
type: 'messaging',
name: 'user-to-user-messaging',
version: '1.0.0'
}
],
dependencies: [
{
type: 'notifications',
required: false
}
]
});
// Discover services
const services = await neverhub.discoverServices({
capabilityType: 'messaging'
});🏗️ Architecture
NeverHub provides:
- Service Discovery: Automatic discovery of available services and capabilities
- Package Management: Registration and management of packages with dependencies
- Real-time Notifications: Webhook-based notifications when dependencies become available
- API Management: Secure API key management and authentication
- Metrics & Monitoring: Built-in metrics collection and health monitoring
- Database Flexibility: Support for table prefixing and multi-tenant deployments
🔒 Security
- JWT-based API authentication
- Secure webhook delivery with HMAC signatures
- Rate limiting on all endpoints
- Capability-based access control
- Audit logging of all operations
📊 Features
Service Discovery
- Discover packages by type, capability, or metadata
- Real-time notifications when services become available
- Dependency resolution and conflict detection
- Capability-based service matching
Package Management
- Enhanced package registration with capabilities
- Dependency tracking and resolution
- Version management and compatibility checking
- Service metadata and configuration
Integration Hub
- Event bus integration
- Webhook delivery system
- API key management
- Health monitoring and metrics
Database Management
- Table prefixing for multi-tenant deployments
- Automated schema generation
- Migration tools and rollback support
- Prisma ORM integration
🛠️ Development
Prerequisites
- Node.js 18+
- PostgreSQL 12+
- Redis (optional)
Local Development
# Clone the repository
git clone https://github.com/bernierllc/neverhub.git
cd neverhub
# Install dependencies
npm install
# Set up environment
cp env.neverhub.example .env.neverhub
# Configure .env.neverhub
# Generate schema and run migrations
npm run generate:schema
npm run db:migrate
# Start development server
npm run devTesting
# Run all tests
npm run test:all
# Run specific test suites
npm run test:contracts
npm run test:functionality
npm run test:integration
npm run test:e2e📖 Documentation
🤝 Support
- Documentation: https://docs.neverhub.com
- Support: https://support.neverhub.com
- GitHub: https://github.com/bernierllc/neverhub
📄 License
Copyright © 2024 Bernier LLC. All rights reserved.
NeverHub - Empowering service discovery and package management for modern applications.
