malipo / database-schema.html
Meech888's picture
Create a Wallet Page for a crypto platform that supports multi-chain blockchain wallet integration (BTC, ETH, BNB, SOL, MATIC, etc.).
16a094d verified
Raw History Blame Contribute Delete
22 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MALiPo Database Schema | MALiPo</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
.schema-bg {
background: linear-gradient(135deg, #6e00ff 0%, #00d1ff 100%);
}
.schema-card {
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.table-diagram {
border-radius: 8px;
overflow: hidden;
}
.table-header {
background-color: #4f46e5;
color: white;
padding: 12px;
font-weight: 600;
}
.table-row {
border-bottom: 1px solid #e5e7eb;
padding: 8px 12px;
}
.foreign-key {
color: #3b82f6;
font-style: italic;
}
.primary-key {
color: #10b981;
font-weight: 600;
}
</style>
</head>
<body class="font-sans antialiased text-gray-900">
<!-- Navigation -->
<nav class="bg-white shadow-sm fixed w-full z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<i data-feather="zap" class="h-8 w-8 text-indigo-600"></i>
<span class="ml-2 text-xl font-bold text-gray-900">MALiPo</span>
</div>
</div>
<div class="hidden md:ml-6 md:flex md:items-center md:space-x-8">
<a href="index.html" class="text-gray-500 hover:text-indigo-600 px-3 py-2 text-sm font-medium">Home</a>
<a href="features.html" class="text-gray-500 hover:text-indigo-600 px-3 py-2 text-sm font-medium">Features</a>
<a href="pricing.html" class="text-gray-500 hover:text-indigo-600 px-3 py-2 text-sm font-medium">Pricing</a>
<a href="developers.html" class="text-gray-500 hover:text-indigo-600 px-3 py-2 text-sm font-medium">Developers</a>
</div>
<div class="flex items-center">
<a href="signin.html" class="px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700">Sign In</a>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<div class="pt-20 pb-12 px-4 sm:px-6 lg:px-8">
<div class="max-w-7xl mx-auto">
<!-- Hero Section -->
<div class="text-center py-12">
<h1 class="text-4xl font-extrabold text-gray-900 sm:text-5xl sm:tracking-tight lg:text-6xl">
MALiPo Database Schema
</h1>
<p class="mt-5 max-w-xl mx-auto text-xl text-gray-500">
Comprehensive database structure for storing client information, transactions, and wallet balances
</p>
</div>
<!-- Database Overview -->
<div class="bg-white rounded-lg shadow-md p-6 mb-8 schema-card">
<h2 class="text-2xl font-bold text-gray-900 mb-6">Database Overview</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="bg-indigo-50 p-4 rounded-lg">
<div class="flex items-center mb-3">
<i data-feather="users" class="h-6 w-6 text-indigo-600"></i>
<h3 class="ml-2 font-semibold text-gray-900">Users & Profiles</h3>
</div>
<p class="text-sm text-gray-600">Stores user accounts, personal information, and verification status</p>
</div>
<div class="bg-green-50 p-4 rounded-lg">
<div class="flex items-center mb-3">
<i data-feather="credit-card" class="h-6 w-6 text-green-600"></i>
<h3 class="ml-2 font-semibold text-gray-900">Wallets & Balances</h3>
</div>
<p class="text-sm text-gray-600">Manages cryptocurrency wallets and real-time balance tracking</p>
</div>
<div class="bg-purple-50 p-4 rounded-lg">
<div class="flex items-center mb-3">
<i data-feather="repeat" class="h-6 w-6 text-purple-600"></i>
<h3 class="ml-2 font-semibold text-gray-900">Transactions</h3>
</div>
<p class="text-sm text-gray-600">Tracks all incoming and outgoing transactions with fees</p>
</div>
</div>
</div>
<!-- Database Schema Diagrams -->
<div class="space-y-8">
<!-- Users Table -->
<div class="bg-white rounded-lg shadow-md p-6 schema-card">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Users Table</h3>
<div class="table-diagram bg-gray-50">
<div class="table-header">users</div>
<div class="table-row"><span class="primary-key">user_id</span> UUID (Primary Key)</div>
<div class="table-row">email VARCHAR(255) UNIQUE NOT NULL</div>
<div class="table-row">password_hash VARCHAR(255) NOT NULL</div>
<div class="table-row">created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP</div>
<div class="table-row">updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP</div>
<div class="table-row">is_verified BOOLEAN DEFAULT FALSE</div>
<div class="table-row">verification_status ENUM('pending', 'approved', 'rejected')</div>
</div>
</div>
<!-- User Profiles Table -->
<div class="bg-white rounded-lg shadow-md p-6 schema-card">
<h3 class="text-xl font-semibold text-gray-900 mb-4">User Profiles Table</h3>
<div class="table-diagram bg-gray-50">
<div class="table-header">user_profiles</div>
<div class="table-row"><span class="primary-key">profile_id</span> UUID (Primary Key)</div>
<div class="table-row"><span class="foreign-key">user_id</span> UUID REFERENCES users(user_id)</div>
<div class="table-row">first_name VARCHAR(100) NOT NULL</div>
<div class="table-row">last_name VARCHAR(100) NOT NULL</div>
<div class="table-row">date_of_birth DATE NOT NULL</div>
<div class="table-row">address TEXT</div>
<div class="table-row">city VARCHAR(100)</div>
<div class="table-row">state VARCHAR(100)</div>
<div class="table-row">postal_code VARCHAR(20)</div>
<div class="table-row">country VARCHAR(100)</div>
<div class="table-row">id_front_image_url VARCHAR(500)</div>
<div class="table-row">id_back_image_url VARCHAR(500)</div>
<div class="table-row">facial_scan_data TEXT</div>
</div>
</div>
<!-- Wallets Table -->
<div class="bg-white rounded-lg shadow-md p-6 schema-card">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Wallets Table</h3>
<div class="table-diagram bg-gray-50">
<div class="table-header">wallets</div>
<div class="table-row"><span class="primary-key">wallet_id</span> UUID (Primary Key)</div>
<div class="table-row"><span class="foreign-key">user_id</span> UUID REFERENCES users(user_id)</div>
<div class="table-row">wallet_address VARCHAR(255) UNIQUE NOT NULL</div>
<div class="table-row">currency VARCHAR(10) NOT NULL</div>
<div class="table-row">balance DECIMAL(20, 8) DEFAULT 0.0</div>
<div class="table-row">is_active BOOLEAN DEFAULT TRUE</div>
<div class="table-row">created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP</div>
<div class="table-row">last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP</div>
</div>
</div>
<!-- Transactions Table -->
<div class="bg-white rounded-lg shadow-md p-6 schema-card">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Transactions Table</h3>
<div class="table-diagram bg-gray-50">
<div class="table-header">transactions</div>
<div class="table-row"><span class="primary-key">transaction_id</span> UUID (Primary Key)</div>
<div class="table-row"><span class="foreign-key">from_wallet_id</span> UUID REFERENCES wallets(wallet_id)</div>
<div class="table-row"><span class="foreign-key">to_wallet_id</span> UUID REFERENCES wallets(wallet_id)</div>
<div class="table-row">amount DECIMAL(20, 8) NOT NULL</div>
<div class="table-row">currency VARCHAR(10) NOT NULL</div>
<div class="table-row">transaction_fee DECIMAL(20, 8) NOT NULL</div>
<div class="table-row">network_fee DECIMAL(20, 8)</div>
<div class="table-row">total_amount DECIMAL(20, 8) NOT NULL</div>
<div class="table-row">status ENUM('pending', 'completed', 'failed', 'cancelled')</div>
<div class="table-row">transaction_hash VARCHAR(255)</div>
<div class="table-row">description TEXT</div>
<div class="table-row">created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP</div>
<div class="table-row">completed_at TIMESTAMP</div>
</div>
</div>
<!-- Supported Currencies Table -->
<div class="bg-white rounded-lg shadow-md p-6 schema-card">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Supported Currencies Table</h3>
<div class="table-diagram bg-gray-50">
<div class="table-header">supported_currencies</div>
<div class="table-row"><span class="primary-key">currency_id</span> UUID (Primary Key)</div>
<div class="table-row">currency_code VARCHAR(10) UNIQUE NOT NULL</div>
<div class="table-row">currency_name VARCHAR(100) NOT NULL</div>
<div class="table-row">is_stablecoin BOOLEAN DEFAULT FALSE</div>
<div class="table-row">transaction_fee_rate DECIMAL(5, 4) NOT NULL</div>
<div class="table-row">minimum_transaction DECIMAL(20, 8)</div>
<div class="table-row">maximum_transaction DECIMAL(20, 8)</div>
<div class="table-row">is_active BOOLEAN DEFAULT TRUE</div>
</div>
</div>
<!-- Fee Structure Table -->
<div class="bg-white rounded-lg shadow-md p-6 schema-card">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Fee Structure Table</h3>
<div class="table-diagram bg-gray-50">
<div class="table-header">fee_structure</div>
<div class="table-row"><span class="primary-key">fee_id</span> UUID (Primary Key)</div>
<div class="table-row"><span class="foreign-key">currency_id</span> UUID REFERENCES supported_currencies(currency_id)</div>
<div class="table-row">incoming_fee_rate DECIMAL(5, 4) NOT NULL</div>
<div class="table-row">outgoing_fee_rate DECIMAL(5, 4) NOT NULL</div>
<div class="table-row">minimum_fee DECIMAL(20, 8)</div>
<div class="table-row">maximum_fee DECIMAL(20, 8)</div>
<div class="table-row">effective_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP</div>
<div class="table-row">is_active BOOLEAN DEFAULT TRUE</div>
</div>
</div>
<!-- Audit Log Table -->
<div class="bg-white rounded-lg shadow-md p-6 schema-card">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Audit Log Table</h3>
<div class="table-diagram bg-gray-50">
<div class="table-header">audit_logs</div>
<div class="table-row"><span class="primary-key">log_id</span> UUID (Primary Key)</div>
<div class="table-row"><span class="foreign-key">user_id</span> UUID REFERENCES users(user_id)</div>
<div class="table-row">action_type VARCHAR(100) NOT NULL</div>
<div class="table-row">action_details TEXT</div>
<div class="table-row">ip_address VARCHAR(45)</div>
<div class="table-row">user_agent TEXT</div>
<div class="table-row">created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP</div>
</div>
</div>
</div>
<!-- API Endpoints -->
<div class="bg-white rounded-lg shadow-md p-6 mt-8 schema-card">
<h2 class="text-2xl font-bold text-gray-900 mb-6">Key API Endpoints</h2>
<div class="space-y-4">
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center justify-between mb-2">
<span class="font-mono text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded">POST /api/v1/users</span>
<span class="text-xs text-gray-500">Create new user account</span>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center justify-between mb-2">
<span class="font-mono text-sm bg-green-100 text-green-800 px-2 py-1 rounded">GET /api/v1/users/{userId}/wallets</span>
<span class="text-xs text-gray-500">Get user wallets and balances</span>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center justify-between mb-2">
<span class="font-mono text-sm bg-purple-100 text-purple-800 px-2 py-1 rounded">POST /api/v1/transactions</span>
<span class="text-xs text-gray-500">Create new transaction</span>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center justify-between mb-2">
<span class="font-mono text-sm bg-yellow-100 text-yellow-800 px-2 py-1 rounded">GET /api/v1/users/{userId}/transactions</span>
<span class="text-xs text-gray-500">Get user transaction history</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="bg-gray-50">
<div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8">
<div class="xl:grid xl:grid-cols-3 xl:gap-8">
<div class="space-y-8 xl:col-span-1">
<div class="flex items-center">
<i data-feather="zap" class="h-8 w-8 text-indigo-600"></i>
<span class="ml-2 text-xl font-bold text-gray-900">MALiPo</span>
</div>
<p class="text-gray-500 text-base">
The simplest way to accept cryptocurrency payments for your business with competitive transaction fees.
</p>
</div>
<div class="mt-12 grid grid-cols-2 gap-8 xl:mt-0 xl:col-span-2">
<div class="md:grid md:grid-cols-2 md:gap-8">
<div>
<h3 class="text-sm font-semibold text-gray-900 tracking-wider uppercase">
Resources
</h3>
<ul class="mt-4 space-y-4">
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Documentation
</a>
</li>
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
API Reference
</a>
</li>
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Guides
</a>
</li>
</ul>
</div>
<div class="mt-12 md:mt-0">
<h3 class="text-sm font-semibold text-gray-900 tracking-wider uppercase">
Company
</h3>
<ul class="mt-4 space-y-4">
<li>
<a href="about.html" class="text-base text-gray-500 hover:text-gray-900">
About
</a>
</li>
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Blog
</a>
</li>
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Careers
</a>
</li>
</ul>
</div>
</div>
<div class="md:grid md:grid-cols-2 md:gap-8">
<div>
<h3 class="text-sm font-semibold text-gray-900 tracking-wider uppercase">
Legal
</h3>
<ul class="mt-4 space-y-4">
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Privacy Policy
</a>
</li>
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Terms of Service
</a>
</li>
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Cookie Policy
</a>
</li>
</ul>
</div>
<div class="mt-12 md:mt-0">
<h3 class="text-sm font-semibold text-gray-900 tracking-wider uppercase">
Support
</h3>
<ul class="mt-4 space-y-4">
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Contact Support
</a>
</li>
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Help Center
</a>
</li>
<li>
<a href="#" class="text-base text-gray-500 hover:text-gray-900">
Status Page
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="mt-12 border-t border-gray-200 pt-8">
<p class="text-base text-gray-400 text-center">
&copy; 2023 MALiPo. All rights reserved.
</p>
</div>
</div>
</footer>
<script>
feather.replace();
</script>
</body>
</html>