Skip to content

nathydre21/wata-board

Repository files navigation

Wata Board - Blockchain-Powered Utility Payment Platform

Wata Board Stellar Blockchain TypeScript React Node.js

🌍 Overview

Wata Board is a cutting-edge blockchain-based utility payment platform that enables users to pay electricity, water, and gas bills using cryptocurrency, specifically leveraging the Stellar blockchain for secure, transparent, and efficient transactions. The platform provides comprehensive meter management, payment processing, scheduled payments, and real-time analytics for both utility consumers and providers.

Core Vision

Democratize access to utility payment services by eliminating geographical barriers and providing a secure, trustless payment infrastructure powered by blockchain technology.


✨ Key Features

For Consumers

  • πŸ”— Cryptocurrency Payments: Pay utility bills directly using Stellar XLM or other digital assets
  • πŸ“Š Real-time Meter Management: Monitor consumption across multiple meters and properties
  • πŸ“… Scheduled Payments: Set up recurring automatic payments for consistent billing cycles
  • πŸ’³ Multiple Payment Options: Direct wallet payments with Freighter integration
  • πŸ“± Offline Support: Progressive Web App with service worker for offline functionality
  • 🌐 Multi-Language Support: Internationalization support for global accessibility
  • πŸ“ˆ Usage Analytics: Detailed consumption reports and trends with PDF export
  • πŸ” Security: KYC verification, AML checks, and secure wallet integration
  • πŸ”” Notifications: Email and push notifications for payment confirmations and alerts

For Providers

  • πŸ’° Multi-Provider Support: Manage multiple utility providers from a single platform
  • πŸ“‹ KYC/AML Integration: Compliance-ready identity verification
  • πŸ’Ή Rate Limiting: Tiered user restrictions for fraud prevention
  • πŸ“Š Analytics Dashboard: Monitor payments, user activity, and platform health
  • πŸ”„ Webhook Integration: Real-time event notifications for payment confirmations
  • πŸ›‘οΈ Security Audit Logging: Comprehensive audit trails for all transactions
  • ⚑ WebSocket Real-time Updates: Live transaction status tracking

πŸ—οΈ Architecture

System Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Frontend (React 19)                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Meter Management β”‚ Payment UI β”‚ Analytics Dashboard β”‚   β”‚
β”‚  β”‚ Offline Support  β”‚ Wallet Sync β”‚ Real-time Updates  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  Nginx Proxy       β”‚
        β”‚  (SSL/HTTPS)       β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β–Ό                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Backend API    β”‚    β”‚  WebSocket   β”‚
β”‚  (Express.js)   β”‚    β”‚  Server      β”‚
β”‚                 β”‚    β”‚              β”‚
β”‚ β€’ Payment Svc   β”‚    β”‚ β€’ Real-time  β”‚
β”‚ β€’ KYC/AML       β”‚    β”‚   Updates    β”‚
β”‚ β€’ Rate Limits   β”‚    β”‚ β€’ Status     β”‚
β”‚ β€’ Migrations    β”‚    β”‚   Tracking   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β–Ό                       β–Ό              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PostgreSQL   β”‚  β”‚ Redis Cache  β”‚  β”‚ Stellar  β”‚
β”‚ (Maindb)     β”‚  β”‚ (Rate Limit) β”‚  β”‚ Testnet  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚ Mainnet  β”‚
                                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                         β”‚
                                         β–Ό
                                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                  β”‚ Soroban Smart   β”‚
                                  β”‚ Contract (Rust) β”‚
                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Component Architecture

Component Technology Purpose
Frontend React 19 + TypeScript + Vite User interface, wallet integration, meter management
Backend API Express.js + TypeScript Payment processing, user management, KYC/AML, analytics
Real-time Layer WebSocket + Socket.io Live transaction updates and status tracking
Database PostgreSQL 16 User data, meters, payments, transaction history
Cache Layer Redis Rate limiting, session caching, performance optimization
Blockchain Stellar SDK + Soroban Contracts Payment verification, on-chain settlement
Infrastructure Docker + Docker Compose Container orchestration and deployment
Reverse Proxy Nginx SSL termination, load balancing, security headers

πŸ› οΈ Technology Stack

Frontend Stack

React 19 + TypeScript + Vite
β”œβ”€β”€ UI Framework: Tailwind CSS
β”œβ”€β”€ State Management: Context API
β”œβ”€β”€ Forms: React Hook Form
β”œβ”€β”€ Data Fetching: Axios + React Query
β”œβ”€β”€ Blockchain: Stellar SDK + Freighter Wallet
β”œβ”€β”€ Testing: 
β”‚   β”œβ”€β”€ Unit: Vitest
β”‚   β”œβ”€β”€ E2E: Playwright
β”œβ”€β”€ Build: Vite
β”œβ”€β”€ Internationalization: i18next
└── Offline: Service Workers (PWA)

Backend Stack

Node.js 20 + Express.js + TypeScript
β”œβ”€β”€ Payment Processing: Payment Service + Accounting Service
β”œβ”€β”€ Authentication: JWT + Wallet Verification
β”œβ”€β”€ Database: PostgreSQL 16 + Knex.js Migrations
β”œβ”€β”€ Caching: Redis (Rate Limiting)
β”œβ”€β”€ Logging: Winston
β”œβ”€β”€ Documentation: Swagger/OpenAPI
β”œβ”€β”€ Testing: Jest + Supertest
β”œβ”€β”€ Security: 
β”‚   β”œβ”€β”€ Helmet.js
β”‚   β”œβ”€β”€ CORS Management
β”‚   β”œβ”€β”€ Rate Limiting (Tiered)
β”‚   β”œβ”€β”€ KYC/AML Verification
β”‚   └── Audit Logging
└── Real-time: WebSocket Support

Blockchain Stack

Stellar Ecosystem
β”œβ”€β”€ Network: Testnet + Mainnet
β”œβ”€β”€ SDK: @stellar/stellar-sdk
β”œβ”€β”€ Smart Contracts: Soroban (Rust/WASM)
β”œβ”€β”€ Wallet Integration: Freighter
└── Type Generation: Stellar TypeScript SDK

Infrastructure Stack

Docker + Docker Compose
β”œβ”€β”€ Containers:
β”‚   β”œβ”€β”€ Frontend (Node + Nginx)
β”‚   β”œβ”€β”€ Backend (Node.js + Express)
β”‚   β”œβ”€β”€ PostgreSQL (Database)
β”‚   β”œβ”€β”€ Redis (Cache)
β”‚   └── Nginx (Reverse Proxy)
β”œβ”€β”€ Orchestration: Docker Compose
β”œβ”€β”€ Monitoring: Health Checks
β”œβ”€β”€ Backup: Automated PostgreSQL Backup
└── SSL/HTTPS: Certbot Integration

πŸ“‹ Prerequisites

Before setting up Wata Board, ensure you have the following installed:

  • Node.js: v20 or higher
  • npm: v10 or higher
  • Docker: v24 or higher
  • Docker Compose: v2.20 or higher
  • PostgreSQL: v15 or higher (for local development)
  • Redis: v7 or higher (for local development, optional)
  • Rust: Latest stable (for contract development)
  • Git: Latest version

Optional for Blockchain Development

  • Stellar CLI: For contract deployment
  • Freighter Wallet Extension: For testing blockchain features

πŸš€ Getting Started

Quick Start (Docker Compose)

The fastest way to get started is using Docker Compose:

# Clone the repository
git clone https://github.com/nathydre21/wata-board.git
cd wata-board

# Copy environment file
cp .env.example .env

# Start all services
docker-compose up -d

# Run database migrations
docker-compose exec backend npm run migrate:latest

# Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:3001
# Swagger Docs: http://localhost:3001/api-docs

Local Development Setup

1. Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
npm ci

# Create and configure environment file
cp .env.example .env

# Required environment variables:
# DB_HOST=localhost
# DB_PORT=5432
# DB_NAME=wata_board
# DB_USER=postgres
# DB_PASSWORD=your_password
# NODE_ENV=development
# STELLAR_NETWORK=testnet
# STELLAR_SECRET_KEY=your_secret_key
# RATE_LIMIT_ENABLED=true
# KYC_ENABLED=true
# REDIS_HOST=localhost
# REDIS_PORT=6379

# Start PostgreSQL (using Docker)
docker run -d \
  --name wata-postgres \
  -e POSTGRES_DB=wata_board \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 \
  postgres:16

# Run migrations
npm run migrate:latest

# Start Redis (optional, for caching)
docker run -d --name wata-redis -p 6379:6379 redis:7

# Build TypeScript
npm run build

# Start development server
npm run dev

# Run tests
npm run test

# Run tests with coverage
npm run test:coverage

2. Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm ci

# Create and configure environment file
cp .env.example .env

# Required environment variables:
# VITE_API_URL=http://localhost:3001
# VITE_STELLAR_NETWORK=testnet
# VITE_STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
# VITE_APP_NAME=Wata Board

# Start development server with hot reload
npm run dev

# Run unit tests
npm run test

# Run E2E tests
npm run test:e2e

# Run tests with coverage
npm run test:coverage

# Build for production
npm run build

# Preview production build
npm run preview

3. Smart Contract Setup

# Navigate to contract directory
cd contract

# Build contract (requires Rust)
stellar contract build

# Run contract tests
cargo test --verbose

# Check formatting
cargo fmt -- --check

# Run linter
cargo clippy -- -D warnings

# Deploy to testnet
stellar contract deploy \
  --wasm ./target/wasm32-unknown-unknown/release/wata_contract.wasm \
  --source your_testnet_account_secret

πŸ“ Project Structure

wata-board/
β”‚
β”œβ”€β”€ frontend/                    # React SPA
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # React components
β”‚   β”‚   β”œβ”€β”€ pages/              # Page components
β”‚   β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ context/            # Context providers
β”‚   β”‚   β”œβ”€β”€ services/           # API clients and blockchain services
β”‚   β”‚   β”œβ”€β”€ utils/              # Utility functions
β”‚   β”‚   β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ i18n/               # Internationalization
β”‚   β”‚   └── assets/             # Images, icons, fonts
β”‚   β”œβ”€β”€ tests/                  # E2E tests (Playwright)
β”‚   β”œβ”€β”€ public/                 # Static files and manifest
β”‚   β”œβ”€β”€ vite.config.ts          # Vite configuration
β”‚   β”œβ”€β”€ tailwind.config.js       # Tailwind CSS configuration
β”‚   β”œβ”€β”€ playwright.config.ts     # E2E test configuration
β”‚   β”œβ”€β”€ vitest.config.ts         # Unit test configuration
β”‚   └── package.json
β”‚
β”œβ”€β”€ backend/                     # Express.js API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/             # API route handlers
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic services
β”‚   β”‚   β”œβ”€β”€ middleware/         # Express middleware
β”‚   β”‚   β”œβ”€β”€ config/             # Configuration files
β”‚   β”‚   β”œβ”€β”€ types/              # TypeScript types
β”‚   β”‚   β”œβ”€β”€ utils/              # Utility functions
β”‚   β”‚   β”œβ”€β”€ migrations/         # Database migrations
β”‚   β”‚   β”œβ”€β”€ server.ts           # Express app initialization
β”‚   β”‚   └── index.ts            # Entry point
β”‚   β”œβ”€β”€ __tests__/              # Test files
β”‚   β”œβ”€β”€ jest.config.js          # Jest configuration
β”‚   β”œβ”€β”€ tsconfig.json           # TypeScript configuration
β”‚   └── package.json
β”‚
β”œβ”€β”€ contract/                    # Stellar Soroban Smart Contract
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ lib.rs              # Main contract implementation
β”‚   β”‚   β”œβ”€β”€ test.rs             # Contract unit tests
β”‚   β”‚   └── multi_provider.rs    # Multi-provider logic
β”‚   β”œβ”€β”€ Cargo.toml              # Rust dependencies
β”‚   └── target/                 # Build artifacts
β”‚
β”œβ”€β”€ database/                    # Database schema and migrations
β”‚   └── migrations/
β”‚       β”œβ”€β”€ 001_initial_schema.sql
β”‚       β”œβ”€β”€ 002_add_indexes_and_constraints.sql
β”‚       β”œβ”€β”€ 003_add_scheduled_payments.sql
β”‚       β”œβ”€β”€ 003_blockchain_integration.sql
β”‚       └── 003_multi_provider_support.sql
β”‚
β”œβ”€β”€ shared/                      # Shared types and utilities
β”‚   β”œβ”€β”€ network-config.ts        # Network configuration
β”‚   β”œβ”€β”€ types.ts                 # Shared TypeScript types
β”‚   └── src/                     # Shared utilities
β”‚
β”œβ”€β”€ scripts/                     # Deployment and utility scripts
β”‚   β”œβ”€β”€ backup-postgres.sh       # Database backup script
β”‚   β”œβ”€β”€ restore-postgres.sh      # Database restore script
β”‚   β”œβ”€β”€ deploy-ssl.sh            # SSL certificate setup
β”‚   β”œβ”€β”€ ssl-setup.sh             # SSL configuration
β”‚   └── deploy-cdn.sh            # CDN deployment
β”‚
β”œβ”€β”€ security-tests/              # Security testing suite
β”‚   β”œβ”€β”€ tests/
β”‚   β”‚   β”œβ”€β”€ owasp/               # OWASP security tests
β”‚   β”‚   └── penetration/         # Penetration testing scripts
β”‚   └── scripts/                 # Security scanning scripts
β”‚
β”œβ”€β”€ .github/
β”‚   └── workflows/               # GitHub Actions CI/CD
β”‚       β”œβ”€β”€ backend-tests.yml    # Backend test workflow (DISABLED)
β”‚       β”œβ”€β”€ comprehensive-tests.yml
β”‚       β”œβ”€β”€ coverage-report.yml  # Coverage generation (DISABLED)
β”‚       └── test.yml             # Contract tests (DISABLED)
β”‚
β”œβ”€β”€ docker-compose.prod.yml      # Production compose file
β”œβ”€β”€ docker-compose.yml           # Development compose file (if exists)
β”œβ”€β”€ nginx.conf                   # Nginx reverse proxy configuration
β”œβ”€β”€ .gitignore                   # Git ignore rules
β”œβ”€β”€ .env.example                 # Example environment variables
└── README.md                    # This file

πŸ”§ Configuration

Environment Variables

Backend Environment Variables

# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=wata_board
DB_USER=postgres
DB_PASSWORD=your_secure_password
DB_SSL=false

# Server Configuration
NODE_ENV=development|production
PORT=3001
LOG_LEVEL=debug|info|warn|error

# Blockchain Configuration
STELLAR_NETWORK=testnet|mainnet
STELLAR_SECRET_KEY=your_secret_key
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
STELLAR_CONTRACT_ID=your_contract_id

# Security Configuration
KYC_ENABLED=true
AML_CHECKS_ENABLED=true
RATE_LIMIT_ENABLED=true
CORS_ORIGIN=http://localhost:3000

# Redis Configuration (Optional)
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=optional_password

# Email Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_app_password
SMTP_FROM=noreply@wataboard.com

# External APIs
PAYMENT_WEBHOOK_URL=https://your-domain.com/webhooks/payments
KYC_PROVIDER_API_KEY=your_kyc_api_key

Frontend Environment Variables

# API Configuration
VITE_API_URL=http://localhost:3001
VITE_API_TIMEOUT=30000

# Blockchain Configuration
VITE_STELLAR_NETWORK=testnet|mainnet
VITE_STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
VITE_STELLAR_CONTRACT_ID=your_contract_id

# Application Configuration
VITE_APP_NAME=Wata Board
VITE_APP_VERSION=1.0.0
VITE_LOG_LEVEL=debug|info|warn|error

# Feature Flags
VITE_ENABLE_OFFLINE_MODE=true
VITE_ENABLE_SCHEDULED_PAYMENTS=true
VITE_ENABLE_ANALYTICS=true

# Wallet Configuration
VITE_FREIGHTER_ENABLED=true

πŸ“Š Database Schema

Key Tables

-- Users and Authentication
users (id, wallet_address, email, kyc_status, tier_level)
user_sessions (id, user_id, token, expires_at)

-- Meters and Properties
meters (id, user_id, meter_code, property_address, meter_type)
meter_readings (id, meter_id, reading_date, reading_value, cost)

-- Payments
payments (id, user_id, meter_id, amount, status, tx_hash)
payment_cache (id, payment_id, cached_at, expires_at)
scheduled_payments (id, user_id, amount, frequency, next_payment_date)

-- Rate Limiting
rate_limits (id, user_id, tier_level, requests_per_minute, requests_per_hour)

-- Audit Logging
audit_logs (id, user_id, action, resource, timestamp, ip_address)

-- Analytics
payment_analytics (id, date, total_payments, total_amount, user_count)

πŸ” Security Features

Built-in Security Measures

  • Wallet Verification: Cryptographic signature verification using Stellar SDK
  • KYC/AML Integration: Know Your Customer and Anti-Money Laundering checks
  • Rate Limiting: Tiered rate limits based on user tier level
  • CORS Configuration: Strict cross-origin resource sharing policies
  • Helmet.js: HTTP security headers for production
  • Input Validation: Zod schema validation on all API endpoints
  • JWT Authentication: Secure token-based authentication
  • Audit Logging: Comprehensive logging of all critical operations
  • Password Security: Bcrypt hashing with salt rounds
  • SQL Injection Prevention: Parameterized queries and ORM usage
  • HTTPS/SSL: Enforced in production environment
  • Replay Attack Prevention: Nonce-based transaction signing

Security Checklist

  • Change default database credentials
  • Generate strong JWT secret
  • Enable KYC/AML verification in production
  • Configure CORS for your domain
  • Set up SSL certificates
  • Enable HTTPS redirect
  • Configure rate limiting tiers
  • Implement Web Application Firewall (WAF)
  • Set up monitoring and alerting
  • Regular security audits
  • Keep dependencies updated
  • Enable audit logging

πŸ§ͺ Testing

Running Tests

Backend Tests

cd backend

# Run all tests
npm run test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

# Run specific test file
npm run test -- payment-service.test.ts

# Run migration tests
npm run test -- --config jest.config.migrations.js

Frontend Tests

cd frontend

# Run unit tests with Vitest
npm run test

# Run unit tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

# Run E2E tests with Playwright
npm run test:e2e

# Run E2E tests with UI
npm run test:e2e:ui

# Run specific test
npx vitest run meter-management.test.ts

Smart Contract Tests

cd contract

# Run contract tests
cargo test --verbose

# Run specific test
cargo test test_payment_execution -- --nocapture

# Run with logging
RUST_LOG=debug cargo test

Test Coverage

The project maintains comprehensive test coverage:

  • Backend: Minimum 70% code coverage (enforced in CI)
  • Frontend: Minimum 60% code coverage
  • Contract: 100% function coverage for critical paths

CI/CD Testing Note

⚠️ All CI/CD tests are currently DISABLED via if: false conditions in GitHub Actions workflows. To re-enable them, remove the if: false lines from:

  • .github/workflows/backend-tests.yml
  • .github/workflows/comprehensive-tests.yml
  • .github/workflows/coverage-report.yml
  • .github/workflows/test.yml

πŸš€ Deployment

Docker Compose Production Deployment

# Build production images
docker-compose -f docker-compose.prod.yml build

# Start services with production config
docker-compose -f docker-compose.prod.yml up -d

# View logs
docker-compose -f docker-compose.prod.yml logs -f

# Run migrations
docker-compose -f docker-compose.prod.yml exec backend npm run migrate:latest

# Stop services
docker-compose -f docker-compose.prod.yml down

SSL/HTTPS Setup

# Run SSL setup script
./scripts/ssl-setup.sh --domain yourdomain.com --email admin@yourdomain.com

# This will:
# - Generate Let's Encrypt certificates
# - Configure Nginx for HTTPS
# - Set up automatic renewal

Database Backup and Restore

# Backup PostgreSQL database
./scripts/backup-postgres.sh

# Restore from backup
./scripts/restore-postgres.sh backup-file-path.sql.gz

# Automated backups are configured in Docker Compose

Horizontal Scaling

For production deployments handling high traffic:

# docker-compose.prod.yml adjustments
services:
  backend:
    deploy:
      replicas: 3
      resources:
        limits:
          cpus: '1'
          memory: 512M
        reservations:
          cpus: '0.5'
          memory: 256M

πŸ“ˆ Monitoring and Logging

Application Logs

Logs are managed by Winston logger:

  • Location: Docker logs via docker-compose logs
  • Format: JSON structured logging
  • Levels: debug, info, warn, error

Health Checks

All services include health check endpoints:

# Backend API health
curl http://localhost:3001/health

# Database health
curl http://localhost:3001/health/db

# Redis health
curl http://localhost:3001/health/redis

# Blockchain network
curl http://localhost:3001/health/blockchain

Monitoring Endpoints

  • Swagger API Docs: http://localhost:3001/api-docs
  • Health Dashboard: Built into backend
  • PostgreSQL Logs: Docker logs
  • Nginx Access Logs: Docker logs

🀝 Contributing

Getting Started with Development

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes and commit: git commit -am 'Add new feature'
  4. Push to the branch: git push origin feature/your-feature
  5. Submit a pull request

Code Style and Standards

  • TypeScript: Strict mode enabled
  • ESLint: Configuration in backend and frontend
  • Prettier: Code formatting
  • Husky: Git hooks for pre-commit linting
  • Conventional Commits: Follow commit message convention

Development Workflow

See WORKFLOW.md for detailed development guidelines, branching strategy, and deployment procedures.


πŸ› Troubleshooting

Common Issues

PostgreSQL Connection Error

# Check if PostgreSQL is running
docker ps | grep postgres

# Check logs
docker logs wata-postgres

# Verify credentials in .env
# Recreate container if needed
docker rm wata-postgres && docker run -d ...

Port Already in Use

# Find process using port
lsof -i :3001  # Backend
lsof -i :3000  # Frontend
lsof -i :5432  # PostgreSQL

# Kill process
kill -9 <PID>

Redis Connection Error

# Start Redis if not running
docker run -d --name wata-redis -p 6379:6379 redis:7

# Test connection
redis-cli ping

Stellar Network Issues

# Check network availability
curl https://horizon-testnet.stellar.org

# Verify contract ID in .env
# Check testnet faucet balance
stellar account info <YOUR_ACCOUNT_ID> --network testnet

Debug Mode

Enable detailed logging:

# Backend
NODE_ENV=development LOG_LEVEL=debug npm run dev

# Frontend
VITE_LOG_LEVEL=debug npm run dev

πŸ“š Additional Resources

Documentation

Useful Links

Community


πŸ“„ License

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


πŸ“ž Support

For issues, questions, or suggestions:

  1. GitHub Issues: Report a bug or request a feature
  2. Email: support@wataboard.com
  3. Discord: Join our community

πŸ™ Acknowledgments

  • Stellar Foundation: For the amazing blockchain infrastructure
  • Contributors: All developers who have contributed to this project
  • Community: For feedback and support

πŸ—ΊοΈ Roadmap

Upcoming Features

  • Multi-currency support (USDC, EUR, etc.)
  • Mobile native app (iOS/Android)
  • Advanced analytics dashboard
  • Integration with traditional payment gateways
  • Automated bill aggregation
  • AI-powered consumption prediction
  • Community features and forums
  • Governance token (DAO)

Version 2.0 Goals

  • Expanded blockchain network support (Polygon, Ethereum)
  • Enhanced security with multi-signature wallets
  • Advanced DeFi integrations
  • Decentralized governance

Made with ❀️ for sustainable utility access worldwide

Last Updated: June 2026

About

a decentralized utility payment platform on **Stellar / Soroban**.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors