Skip to content
Β 
Β 

Latest commit

Β 

History

52 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PropChain Backend

🏠 Decentralized Real Estate Infrastructure | Backend API for blockchain-powered property transactions

PropChain Backend is a production-grade server-side infrastructure that enables the tokenization and trading of real estate assets through blockchain technology. Our API provides the core services needed to build decentralized real estate platforms, including smart contract integration, secure transaction processing, and comprehensive property management capabilities.

Built with enterprise-grade technologies, this backend serves as the foundation for Web3 real estate applications, enabling developers to create platforms where physical properties can be represented as digital assets and traded seamlessly using cryptocurrency.

πŸš€ Features

Core Capabilities

  • 🏠 Asset Tokenization: Transform physical real estate properties into tradable NFTs with legal compliance
  • πŸ’° Crypto Transaction Processing: Secure, multi-chain cryptocurrency payment processing
  • πŸ”— Smart Contract Integration: Pre-built contracts for property ownership, transfers, and escrow
  • πŸ“Š Property Management APIs: Complete CRUD operations for real estate listings and metadata
  • πŸ” Web3 Authentication: Wallet-based user authentication with role-based access control
  • πŸ’Ύ Enterprise Data Storage: Scalable PostgreSQL database with migration support

Advanced Features

  • 🌐 Multi-Chain Support: Ethereum, Polygon, and BSC network compatibility
  • πŸ“ˆ Real-Time Analytics: Property valuation trends and market insights
  • πŸ” Search & Discovery: Advanced filtering and geospatial property search
  • πŸ“± Mobile-Ready API: RESTful endpoints optimized for mobile applications
  • πŸ›‘οΈ Security First: Built-in rate limiting, input validation, and audit logging

πŸ‘₯ Target Audience

This backend is designed for:

  • Real Estate Tech Companies building blockchain-based property platforms
  • Property Investment Firms seeking fractional ownership solutions
  • Blockchain Developers creating DeFi real estate applications
  • Real Estate Agencies modernizing their transaction infrastructure
  • FinTech Startups integrating real estate into their crypto ecosystems

πŸ› οΈ Quick Start

Prerequisites

Ensure you have the following installed:

  • Node.js v18+ (LTS recommended)
  • npm or yarn package manager
  • PostgreSQL v14+
  • Rust toolchain (for smart contract compilation)
  • Git version control

Installation

# 1. Clone the repository
git clone https://github.com/MettaChain/PropChain-BackEnd.git
cd PropChain-BackEnd

# 2. Install dependencies
npm install

# 3. Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# 4. Initialize database
createdb propchain
npm run migrate

# 5. Start development server
npm run dev

The API will be available at http://localhost:3000 with interactive Swagger docs at http://localhost:3000/api.

πŸš€ Deployment & Operations

Development Environment

npm run dev          # Start development server with hot reload
npm run start:dev    # Start with debug logging
npm run test:watch   # Run tests in watch mode

Production Deployment

npm run build        # Compile TypeScript to JavaScript
npm start            # Start production server
npm run health       # Health check endpoint

Testing Suite

npm test             # Run unit tests
npm run test:integration    # Run integration tests
npm run test:e2e           # Run end-to-end tests
npm run test:coverage      # Generate coverage report
npm run test:contracts     # Test smart contracts

Smart Contract Management

npm run compile:contracts  # Compile Rust/Solidity contracts
npm run deploy:testnet     # Deploy to testnet
npm run deploy:mainnet     # Deploy to mainnet
npm run verify:contracts  # Verify on Etherscan

🌐 Network Configuration

Supported Blockchains

  • Ethereum (Mainnet, Sepolia Testnet)
  • Polygon (Mainnet, Mumbai Testnet)
  • Binance Smart Chain (Mainnet, Testnet)
  • Local Development (Hardhat Network)

Environment Configuration

# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/propchain

# Blockchain
BLOCKCHAIN_NETWORK=sepolia
RPC_URL=https://sepolia.infura.io/v3/YOUR_PROJECT_ID
PRIVATE_KEY=your_private_key_here

# Security
JWT_SECRET=your_jwt_secret_key
API_KEY=your_api_key

# Services
REDIS_URL=redis://localhost:6379
WEB3_STORAGE_TOKEN=your_web3_storage_token

πŸ“š Documentation & Resources

API Documentation

Repository Structure

PropChain-BackEnd/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ controllers/     # API route handlers and request processing
β”‚   β”œβ”€β”€ πŸ“ services/        # Business logic and external service integrations
β”‚   β”œβ”€β”€ πŸ“ models/          # Database models and schemas (Prisma)
β”‚   β”œβ”€β”€ πŸ“ middleware/      # Authentication, validation, and error handling
β”‚   β”œβ”€β”€ πŸ“ utils/           # Helper functions and utilities
β”‚   β”œβ”€β”€ πŸ“ config/          # Configuration management
β”‚   └── πŸ“ types/           # TypeScript type definitions
β”œβ”€β”€ πŸ“ contracts/           # Smart contracts (Rust/Solidity)
β”œβ”€β”€ πŸ“ migrations/          # Database migration files
β”œβ”€β”€ πŸ“ tests/              # Unit, integration, and E2E tests
β”œβ”€β”€ πŸ“ docs/               # Comprehensive documentation
β”œβ”€β”€ πŸ“ scripts/            # Build, deployment, and utility scripts
β”œβ”€β”€ πŸ“ .github/            # CI/CD workflows and issue templates
└── πŸ“ docker/             # Docker configuration files

Contributing

Additional Resources

πŸ› οΈ Technology Stack

Backend Infrastructure

  • πŸš€ Framework: NestJS (Node.js/TypeScript) - Enterprise-grade application framework
  • πŸ—„οΈ Database: PostgreSQL v14+ with Prisma ORM - Type-safe database access
  • πŸ” Caching: Redis - High-performance caching and session storage
  • πŸ“Š Message Queue: Bull Queue - Background job processing

Blockchain & Web3

  • ⛓️ Networks: Ethereum, Polygon, BSC - Multi-chain compatibility
  • πŸ”— Web3 Library: ethers.js - Modern Ethereum JavaScript library
  • πŸ“ Smart Contracts: Solidity (EVM) + Rust (Solana) - Cross-platform contracts
  • πŸ” Wallet Integration: MetaMask, WalletConnect - Multi-wallet support

Development & Operations

  • πŸ§ͺ Testing: Jest + Supertest - Comprehensive testing suite
  • πŸ“ API Docs: Swagger/OpenAPI 3.0 - Interactive API documentation
  • 🐳 Containerization: Docker + Docker Compose - Consistent deployments
  • πŸ”„ CI/CD: GitHub Actions - Automated testing and deployment
  • πŸ“Š Monitoring: Prometheus + Grafana - Performance metrics and alerts

Security & Compliance

  • πŸ” Authentication: JWT + Web3 signatures - Secure user verification
  • πŸ›‘οΈ Security: Helmet, CORS, Rate Limiting - Production-grade security
  • πŸ“‹ Validation: class-validator - Request data validation
  • πŸ” Auditing: Comprehensive audit logging for compliance

πŸ“„ License

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

🀝 Support & Community

Get Help

Contributing

We welcome contributions! Please read our Contributing Guide to get started.

Quick contribution steps:

  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

⭐ Star this repository if it helped you!

Made with ❀️ by the PropChain Team

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages