NOTE: this is still a draft, so it's subject to changes. This alert will be removed as soon as final version will be available

πŸ›οΈ@hsuite/dao

🚧 Work in Progress - This application is currently under active development. Features and APIs may change.

πŸ›οΈ Decentralized Autonomous Organization (DAO) Platform - A comprehensive governance solution for the Hedera ecosystem.

A powerful and flexible DAO management platform that enables decentralized governance, proposal management, and community-driven decision-making within the HSuite ecosystem. Built with NestJS, MongoDB, and seamless integration with the Hedera network.

πŸ“‘ Table of Contents

πŸ” Overview

The @hsuite/dao application provides a complete DAO governance infrastructure that supports:

  • DAO Creation & Management: Create and configure DAOs with custom governance rules

  • Proposal Lifecycle: Submit, vote on, and execute governance proposals

  • Flexible Voting: Support for token-weighted voting and custom voting options

  • Member Management: Handle DAO membership and permissions

  • Real-time Updates: WebSocket integration for live governance updates

✨ Features

πŸ›οΈ DAO Management

  • Create DAOs with custom governance parameters

  • Configure voting rules including thresholds and voting periods

  • Manage member permissions and access control

  • Track DAO status and operational metrics

πŸ“ Proposal System

  • Submit proposals with structured data and custom voting options

  • Lifecycle management from creation to execution

  • Multiple proposal types supporting various governance actions

  • Time-bounded voting with configurable periods

πŸ—³οΈ Voting Mechanism

  • Flexible voting options (YES/NO/ABSTAIN or custom choices up to 5 options)

  • Token-weighted voting based on governance token holdings

  • Vote validation ensuring member eligibility and preventing duplicates

  • Voting history and transparency features

πŸ”„ Real-time Features

  • WebSocket integration for live updates

  • Event-driven architecture with background job processing

  • Automated status updates based on voting outcomes

πŸ—οΈ Technical Architecture

Core Components

Data Models

DAO Entity

Proposal Entity

Vote Entity

Infrastructure Stack

  • Framework: NestJS with TypeScript

  • Database: MongoDB with Mongoose ODM

  • Queue System: Bull Queue for background processing

  • WebSockets: Real-time communication

  • Blockchain: Hedera Hashgraph integration

  • Validation: class-validator and class-transformer

  • Documentation: Swagger/OpenAPI

πŸ”Œ API Endpoints

DAO Management

Create DAO

Get DAO by ID

Get DAOs by Owner

Add Member to DAO

Proposal Management

Create Proposal

Get Proposal

Get DAO Proposals

Get Active Proposals

Voting

Cast Vote

Get Vote by ID

Get Proposal Votes

Get Voter's Vote

Get Voting Results

πŸš€ Installation & Setup

Prerequisites

  • Node.js 18+ and npm/yarn

  • MongoDB 5.0+

  • Redis (for Bull Queue)

  • Hedera account for blockchain interaction

Environment Configuration

Create .smart_app.env file:

Installation Steps

  1. Install dependencies:

  1. Start MongoDB and Redis:

  1. Run database migrations (if any):

  1. Start the application:

  1. Verify installation:

πŸ“š Usage Examples

Complete DAO Workflow

WebSocket Integration

πŸ—ƒοΈ Database Schema

Collections Structure

dao_entities

dao_proposals

dao_votes

πŸ”§ Development

Project Structure

Running Tests

Code Quality

Building for Production

πŸ“– API Documentation

The application provides comprehensive API documentation via Swagger UI:

  • Development: http://localhost:3001/api/docs

  • Swagger JSON: http://localhost:3001/api/docs-json

Key API Features:

  • Comprehensive schemas for all request/response objects

  • Interactive testing directly from the documentation

  • Authentication examples for secured endpoints

  • Error response documentation with status codes

πŸ”’ Security Considerations

  • Input validation using class-validator decorators

  • Authentication via Hedera account signatures

  • Rate limiting on API endpoints

  • Data sanitization for MongoDB injection prevention

  • CORS configuration for cross-origin requests

🀝 Contributing

We welcome contributions to improve the DAO platform! Please read our Contributing Guide for details on:

  • Code style and conventions

  • Testing requirements

  • Pull request process

  • Issue reporting guidelines

πŸ“„ License

This package is part of the HSuite ecosystem and is covered by its license terms.


πŸ†˜ Support & Documentation

  • GitHub Issues: Report bugs and request features

  • Documentation: Comprehensive guides in /docs

  • Community: Join our Discord for real-time support

  • API Reference: Interactive Swagger documentation


Built with ❀️ by the HSuite Team Empowering decentralized governance on Hedera Copyright © 2025 HSuite. All rights reserved.

Last updated