Skip to content

JAYATIAHUJA/Finara

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Finara - Blockchain-Based Tokenization and Lending Platform

Finara is a comprehensive blockchain infrastructure that enables banks to tokenize verified real-world assets and issue on-chain loans to KYC-verified customers. Built on Ethereum Sepolia testnet with ERC-3643 compliant tokens, the platform combines blockchain automation with secure bank-verified data management.

๐ŸŒŸ Features

For Banks

  • One-Click Deployment: Deploy Token and Lending contracts through a user-friendly admin dashboard
  • Customer Management: Upload and verify KYC customers with blockchain wallet addresses
  • Asset Tokenization: Convert real-world assets into ERC-3643 compliant tokens
  • Loan Management: Create collateralized loans with customizable interest rates and terms
  • Compliance Dashboard: Monitor KYC status, audit trails, and regulatory compliance
  • Analytics: Real-time portfolio tracking, loan performance metrics, and customer insights

For Customers

  • Self-Service Portal: Secure login with account number and password
  • Asset Management: View all tokenized assets and their current values
  • Asset Marketplace: List assets for sale and see interested buyers
  • Loan Dashboard: Track active loans, EMI payments, and interest rates
  • KYC Profile: View verification status and wallet details
  • Blockchain History: Complete transaction history with blockchain proof

For Investors

  • Investment Dashboard: Portfolio overview with real-time analytics
  • Asset Marketplace: Browse and purchase tokenized assets
  • Order Management: Track buy/sell orders and transaction history
  • Blockchain Verification: Every transaction recorded on-chain with TX hash
  • Performance Tracking: Monitor ROI and asset performance

Blockchain Features

  • ERC-3643 Compliant Tokens: Only verified KYC customers can hold or trade tokens
  • On-Chain Lending: Automated loan disbursement, interest calculation, and collateral management
  • Relayer Service: Gasless transactions - no MetaMask required for users
  • Transaction Recording: All asset trades recorded on blockchain with full transparency
  • Smart Contract Security: Audited contracts with multi-sig wallet support

๐Ÿ—๏ธ Architecture

Smart Contracts (Solidity ^0.8.20)

  1. BankFactory.sol: Deploys Token and Lending contracts for each bank
  2. CompliantToken.sol: ERC-3643 inspired token with KYC verification and compliance features
  3. LendingContract.sol: Manages collateralized loans with automated liquidation

Backend (Node.js + Express)

  • RESTful API: Complete backend for all operations
  • Relayer Service: Handles blockchain transactions using Ethers.js
  • Supabase Integration: PostgreSQL database for banks, customers, assets, and loans
  • Middleware: Authentication, validation, and error handling

Frontend (React + Vite)

  • Landing Page: Modern marketing page with Lottie animations
  • Bank Admin Dashboard: Complete management console with SideNav
  • Customer Portal: Self-service portal with blockchain transaction tracking
  • Investor Dashboard: Asset marketplace with portfolio analytics
  • Responsive Design: Glassmorphism UI with smooth animations

Data Storage

  • Blockchain: Smart contract state, token balances, loan records
  • Supabase: Bank info, customer KYC, asset metadata, transaction logs
  • localStorage: Client-side demo data, auth tokens, blockchain transactions

๐Ÿ“‹ Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Supabase account and project
  • Ethereum Sepolia testnet account with ETH for gas
  • Hardhat for contract deployment

๐Ÿš€ Installation

1. Clone the Repository

git clone https://github.com/JAYATIAHUJA/Finara.git
cd Finara

2. Install Dependencies

# Install backend dependencies
npm install

# Install frontend dependencies
cd Finara
npm install
cd ..

3. Set Up Environment Variables

Create a .env file in the root directory:

# Ethereum Network Configuration
SEPOLIA_RPC_URL=https://rpc.sepolia.org
PRIVATE_KEY=your_deployer_private_key_here
RELAYER_PRIVATE_KEY=your_relayer_private_key_here

# Factory Contract Address (update after deployment)
FACTORY_ADDRESS=your_factory_address_after_deployment

# Supabase Configuration
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key

# Server Configuration
PORT=3000

4. Set Up Supabase Database

  • Create a new Supabase project at supabase.com
  • Go to the SQL Editor
  • Run the schema from database/schema.sql
  • Configure Row Level Security policies as needed
  • Copy your project URL and anon key to .env

5. Deploy Smart Contracts

# Compile contracts
npm run compile

# Deploy to Sepolia testnet
npm run deploy

# Update FACTORY_ADDRESS in .env with the deployed address

๐ŸŽฎ Usage

Start the Backend Server

npm run dev
# or for production
npm start

The server will start on http://localhost:3000

Server Status:

  • โœ… Running in demo mode if credentials not configured
  • โš ๏ธ Database disabled if Supabase not configured
  • โš ๏ธ Blockchain features disabled if relayer not configured

Start the Frontend

cd Finara
npm run dev

The frontend will start on http://localhost:5173

Access the Application

  • Landing Page: http://localhost:5173/
  • Bank Admin Login: http://localhost:5173/login
  • Customer Portal: http://localhost:5173/customer-portal
  • Investor Dashboard: http://localhost:5173/investor

Demo Credentials

Bank Admin

  • Email: Any email
  • Password: Any password

Customer Portal

  • Account Number: Any number
  • Password: demo123

Investor Portal

  • Email: Any email
  • Password: demo123

๐Ÿ“š API Documentation

Health Check

GET /health

Deploy Bank

POST /api/deployBank
Content-Type: application/json

{
  "bankAddress": "0x...",
  "bankName": "Example Bank",
  "tokenName": "Bank Token",
  "tokenSymbol": "BANK",
  "maxSupply": 1000000,
  "collateralizationRatio": 15000
}

Upload Customers

POST /api/uploadCustomers
Content-Type: application/json

{
  "bankAddress": "0x...",
  "customers": [
    {
      "name": "John Doe",
      "accountId": "ACC001",
      "walletAddress": "0x..."
    }
  ]
}

Mint Tokens

POST /api/mintToken
Content-Type: application/json

{
  "bankAddress": "0x...",
  "walletAddress": "0x...",
  "amount": 1000
}

Create Loan

POST /api/lend
Content-Type: application/json

{
  "bankAddress": "0x...",
  "borrowerAddress": "0x...",
  "collateralAmount": 1500,
  "loanAmount": 1000,
  "interestRate": 500,
  "duration": 2592000
}

For complete API documentation, visit http://localhost:3000/ after starting the server.

๐Ÿ“ Project Structure

Finara/
โ”œโ”€โ”€ contracts/              # Smart contracts
โ”‚   โ”œโ”€โ”€ BankFactory.sol
โ”‚   โ”œโ”€โ”€ CompliantToken.sol
โ”‚   โ””โ”€โ”€ LendingContract.sol
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ server.js          # Express server
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ””โ”€โ”€ supabase.js    # Database config
โ”‚   โ”œโ”€โ”€ routes/            # API routes
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ””โ”€โ”€ relayer.js     # Blockchain service
โ”‚   โ””โ”€โ”€ middleware/        # Auth & validation
โ”œโ”€โ”€ database/
โ”‚   โ””โ”€โ”€ schema.sql         # Supabase schema
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ deploy.js          # Deployment script
โ”œโ”€โ”€ Finara/                # Frontend (React + Vite)
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/    # Reusable components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/         # Route pages
โ”‚   โ”‚   โ”œโ”€โ”€ services/      # API & blockchain services
โ”‚   โ”‚   โ””โ”€โ”€ styles/        # CSS themes
โ”‚   โ””โ”€โ”€ public/            # Static assets
โ”œโ”€โ”€ hardhat.config.js      # Hardhat configuration
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ .env.example
โ””โ”€โ”€ README.md

๐Ÿ” Security Features

  • KYC Verification: Only verified addresses can hold tokens
  • Transfer Restrictions: Compliance-enforced token transfers
  • Relayer Pattern: No user private keys exposed to frontend
  • Row Level Security: Supabase RLS policies
  • Input Validation: Server-side validation on all endpoints
  • Environment Variables: Sensitive data in .env (never committed)

๐Ÿงช Testing

# Run Hardhat tests
npm test

# Test on local network
npx hardhat node
npm run deploy:local

๐Ÿ› ๏ธ Tech Stack

Blockchain

  • Solidity ^0.8.20
  • Hardhat
  • Ethers.js v6
  • OpenZeppelin Contracts
  • Ethereum Sepolia Testnet

Backend

  • Node.js
  • Express.js
  • Supabase (PostgreSQL)
  • dotenv

Frontend

  • React 18
  • Vite
  • React Router
  • Framer Motion
  • Lottie Animations
  • Three.js (GridScan)

๐Ÿ“Š Features Implemented

โœ… Bank deployment with factory pattern
โœ… ERC-3643 compliant token with KYC
โœ… Collateralized lending system
โœ… Customer onboarding and verification
โœ… Asset tokenization and management
โœ… Asset marketplace (Customer โ†” Investor)
โœ… Blockchain transaction recording
โœ… Transaction history with TX hashes
โœ… Loan creation and tracking
โœ… Compliance dashboard
โœ… Real-time analytics
โœ… Responsive UI with glassmorphism
โœ… Lottie animations
โœ… Demo mode for easy testing

๐Ÿšง Roadmap

  • Real authentication with JWT
  • Payment gateway integration
  • Advanced analytics dashboard
  • Mobile responsive improvements
  • Real-time notifications
  • Multi-language support
  • Advanced loan features (partial repayment, refinancing)
  • NFT integration for unique assets
  • Decentralized identity (DID)
  • Cross-chain support

๐Ÿ“– Documentation

๐Ÿค Contributing

Contributions are welcome! Please follow these 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

๐Ÿ‘ฅ Team

Team Hacka Noodles - Built in 2025

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

  • OpenZeppelin for secure smart contract libraries
  • Supabase for backend infrastructure
  • Ethereum community for blockchain standards
  • Lottie Files for animations
  • Vite and React teams for amazing developer experience

๐Ÿ“ž Support

For issues and questions:

  • Open an issue in the repository
  • Check the documentation in the docs/ folder
  • Review the flow diagram for architecture understanding

๐Ÿ”— Links


Built with โค๏ธ by Team Hacka Noodles

Transforming traditional banking with blockchain technology

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages