π±HSuite Smart App - Enterprise Hedera Application Framework
A comprehensive, enterprise-grade NestJS boilerplate for building scalable applications on the Hedera Hashgraph network. Part of the HSuite ecosystem of decentralized applications and smart contract engines.
π Overview
The HSuite Smart App is a production-ready, feature-rich boilerplate designed for developers building sophisticated applications on the Hedera network. It provides a solid foundation with pre-configured modules, services, and examples for common blockchain operations, authentication, monitoring, and much more.
Key Highlights
ποΈ Enterprise Architecture: Built on NestJS with modular, scalable design patterns
π Hedera Native: Deep integration with Hedera Hashgraph SDK and services
π‘οΈ Security First: Multi-layer security with rate limiting, authentication, and protection
π Production Ready: Comprehensive monitoring, logging, and observability
π Event-Driven: Robust event handling and real-time capabilities
π Multi-Network: Support for testnet, mainnet, and private networks
π¦ Modular Design: Conditional loading of features based on configuration
β¨ Features
Core Framework
ποΈ NestJS Framework: Scalable server-side applications with TypeScript
π Hedera Integration: Complete Hedera Hashgraph SDK integration
ποΈ MongoDB & Mongoose: Robust database layer with schema validation
π Redis Caching: High-performance caching and session management
π‘ WebSocket Support: Real-time communication capabilities
π Event Emitter: Application-wide event handling system
Security & Authentication
π Multi-Auth Support: JWT, API keys, and custom authentication strategies
π‘οΈ Rate Limiting: DDOS protection with configurable throttling
π Security Headers: Helmet integration for HTTP security
πͺ Session Management: Secure cookie-based sessions with Redis
π¨ CSRF Protection: Cross-site request forgery protection
π 2FA Support: Two-factor authentication via Twilio
Monitoring & Observability
π OpenTelemetry: Complete observability with traces and metrics
π Prometheus Metrics: Application and custom metrics collection
π Jaeger Tracing: Distributed tracing for performance monitoring
π Structured Logging: Comprehensive logging with context
π₯ Health Checks: Application health monitoring endpoints
External Integrations
π¨ Email Services: Nodemailer integration for transactional emails
π± SMS Notifications: Twilio integration for SMS alerts
π€ Discord Webhooks: Discord integration for notifications
π¦ Twitter API: Social media integration capabilities
π¦ IPFS Storage: Decentralized file storage and retrieval
π Background Jobs: Bull queue system for async processing
Development & Testing
π API Documentation: Auto-generated Swagger/OpenAPI docs
π§ͺ Testing Framework: Jest with unit and e2e testing support
π Code Documentation: Compodoc integration for code docs
π§ Development Tools: Hot reload, debugging, and linting
π Docker Support: Containerization for easy deployment
π οΈ Prerequisites
Before getting started, ensure you have the following installed:
Node.js: Version 22.x or higher
Yarn: Version 1.22.x (package manager)
MongoDB: Database server (local or cloud)
Redis: Caching and session store
IPFS Node: Optional, for decentralized storage
Git: Version control system
Optional Services
Discord Bot: For notification integrations
Twilio Account: For SMS and 2FA services
Twitter API: For social media features
Jaeger: For distributed tracing (can use SaaS)
π Quick Start
1. Clone and Install
2. Environment Configuration
3. Start Development Services
4. Launch Application
5. Access Services
API Documentation: http://localhost:8888/api
Health Check: http://localhost:8888/health
Metrics: http://localhost:8888/metrics
ποΈ Project Architecture
Core Modules Architecture
βοΈ Configuration
The application uses a hierarchical configuration system with environment variables and configuration modules.
Environment Variables
Configuration Modules
The application uses modular configuration with TypeScript configuration files:
π§ Available Scripts
Development Scripts
Testing Scripts
Build Scripts
Docker Scripts
Utility Scripts
π» Development Guide
Creating a New Feature Module
Generate Module Structure:
Create the Module:
Create the Service:
Create the Controller:
Register in Main Module:
Working with SmartNode SDK
The Smart App leverages the @hsuite/smartnode-sdk for all Hedera network operations. Here are real-world examples from the codebase:
Service Setup Pattern
Token Operations with SmartNode SDK
Topic Operations with SmartNode SDK
Account Operations with SmartNode SDK
SmartNode SDK Key Features
The SmartNode SDK provides several advantages over direct Hedera SDK usage:
π Validator Integration: All transactions include validator consensus timestamps
π¦ Pre-built Transaction Bytes: SDK generates optimized transaction bytes
π§ Type Safety: Full TypeScript interfaces for all operations
β‘ Performance: Optimized for Smart Node network operations
π‘οΈ Security: Built-in transaction validation and signing patterns
Configuration Integration
π§ͺ Testing
Unit Testing
E2E Testing
π Deployment
Docker Deployment
Docker Compose Example:
Environment-Specific Configurations
Production Configuration:
Staging Configuration:
π Monitoring & Observability
Metrics Collection
The application automatically collects metrics using Prometheus:
Health Checks
Access health information at /health:
Logging
The application uses structured logging with contextual information:
π§ Troubleshooting
Common Issues
MongoDB Connection Issues
Redis Connection Issues
Hedera Network Issues
Transaction Issues
Network Configuration Issues
Debug Mode
Enable comprehensive debugging:
Log Analysis
π€ Contributing
We welcome contributions to the HSuite Smart App! Please follow our contribution guidelines:
Development Workflow
Fork the Repository
Create Feature Branch:
git checkout -b feature/amazing-featureMake Changes: Follow coding standards and add tests
Run Tests:
yarn test && yarn test:e2eUpdate Documentation: Include relevant documentation updates
Commit Changes:
git commit -m 'feat: add amazing feature'Push Branch:
git push origin feature/amazing-featureOpen Pull Request: Provide detailed description of changes
Coding Standards
Follow TypeScript best practices
Add comprehensive JSDoc comments for all public methods
Include unit tests for new functionality
Follow NestJS conventions and patterns
Use meaningful variable and function names
Keep functions small and focused
Commit Message Format
Types: feat, fix, docs, style, refactor, test, chore
Example:
π License
This project is licensed under the PROPRIETARY License. See the LICENSE file for details.
Copyright Β© 2025 HSuite Team. All rights reserved.
π Support
Community Support
π¬ Discord: Join our Discord server
π§ Email: [email protected]
π Documentation: HSuite Docs
π Issues: GitHub Issues
Enterprise Support
For enterprise customers, we offer:
Priority support with SLA guarantees
Custom development and integration services
Professional training and onboarding
Dedicated support channels
Contact: [email protected]
π Acknowledgments
Special thanks to the amazing open-source community and the technologies that make this possible:
NestJS - A progressive Node.js framework
Hedera Hashgraph - The enterprise-grade public network
MongoDB - The database for modern applications
Redis - The in-memory data structure store
IPFS - A peer-to-peer hypermedia protocol
πΊοΈ Roadmap
Upcoming Features
Q4 2024
GraphQL API support
Enhanced monitoring dashboard
Advanced caching strategies
Multi-tenant architecture
Q1 2025
Kubernetes deployment support
Advanced security features
Real-time analytics
Mobile SDK integration
Q2 2025
Machine learning integration
Advanced smart contract tools
Enhanced developer experience
Performance optimizations
Built with β€οΈ by the HSuite Team
Website β’ Documentation β’ Discord β’ Twitter
Last updated