File size: 21,955 Bytes
4ad0c61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761991f
4ad0c61
 
 
 
 
 
 
 
 
16a094d
4ad0c61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761991f
4ad0c61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761991f
4ad0c61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16a094d
 
 
4ad0c61
 
 
 
16a094d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4ad0c61
 
 
 
 
 
761991f
4ad0c61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761991f
 
4ad0c61
 
761991f
4ad0c61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761991f
4ad0c61
 
761991f
4ad0c61
761991f
4ad0c61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761991f
 
 
 
 
 
4ad0c61
 
 
 
761991f
4ad0c61
 
 
 
 
 
 
 
 
 
 
761991f
4ad0c61
 
 
 
761991f
 
 
 
 
 
4ad0c61
 
 
 
 
761991f
 
4ad0c61
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
<!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>