-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentation.html
More file actions
426 lines (346 loc) · 13.3 KB
/
documentation.html
File metadata and controls
426 lines (346 loc) · 13.3 KB
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="logo.png">
<title>Menous DB</title>
<style>
.navbar-brand h2{
font-weight: 100;
}
.navbar{
background-color: #191919;
}
#nav-sidebar a
{
border-bottom: #191919 1px solid;
margin-right:10px;
}
#nav-sidebar a:hover
{
border-bottom: white 1px solid;
}
#nav-sidebar .btn{
border-bottom: white 1px solid;
}
.custom-container{
padding:20px;
width:60%;
margin-left:20%;
margin-top:50px;
}
@media screen and (max-width: 600px) {
.custom-container{
width:90%;
margin-left: 5%;
}
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css">
</head>
<body style="background-color: #ecf0f1;font-weight: 100;">
<nav class="navbar navbar-xxl navbar-dark navbar-expand-xxl">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="logo.png" alt="" height="50" width="50">
</a>
<a class="navbar-brand" href="index.html">
<h2>Menous DB</h2>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNavAltMarkup">
<div class="navbar-nav" id="nav-sidebar">
<a class="nav-link active" href="downloads.html">Downloads</a>
<a class="nav-link active" href="pysdk.html">Python SDK</a>
<a class="nav-link active" href="documentation.html">Documentation</a>
<a class="btn btn-outline-light" href="https://github.com/MenousTech/Menous-DB" role="button"><i style="font-size:20px;margin-left:10px;margin-right:10px;"class="bi bi-github"></i>Source Code</a>
</div>
</div>
</div>
</div>
</nav>
<div class="custom-container">
<h2>Table of Contents</h2>
<ol>
<li>Introduction</li>
<li>System Requirements</li>
<li>Installation</li>
<li>Usage</li>
<li>API Endpoints</li>
<li>Examples</li>
<li>License</li>
<li>Author Information</li>
</ol>
<hr />
<h2>1. Introduction</h2>
<p><strong>Menous DB</strong> is a lightweight, open-source database management system designed for simplicity and ease of use. It provides a RESTful API for managing databases and tables, making it suitable for a variety of applications. This documentation provides an overview of Menous DB, including system requirements, installation instructions, and usage guidelines.</p>
<h3>Features:</h3>
<ul>
<li>Create, read, update, and delete databases and tables.</li>
<li>Execute SQL-like queries using simple API endpoints.</li>
<li>User authentication and authorization.</li>
<li>JSON and SQL database modes.</li>
<li>Cross-platform support (macOS, Windows, Linux).</li>
</ul>
<hr />
<h2>2. System Requirements</h2>
<p>To run Menous DB, you need the following software and dependencies installed on your system:</p>
<ul>
<li>Python 3.7+</li>
<li>Flask (Python web framework)</li>
<li><a href="#">auth</a> (Authentication module)</li>
<li>Operating System: macOS, Windows, or Linux</li>
</ul>
<hr />
<h2>3. Installation</h2>
<p>Follow these steps to install and run Menous DB on your system:</p>
<h3>From hombrew for mac</h3>
<ol>
<li>First tap from the repository of Menous Technologies
<code>
$ brew tap menoustech/tap
</code></li>
<li>Second update hombrew for changes
<code>
$ brew update
</code></li>
<li>Install menousdb using homebrew
<code>
$ brew install menousdb
</code></li>
</ol>
<h3>Manual Build</h3>
<ol>
<li><p>Clone the Menous DB repository from GitHub:
<code>
git clone https://github.com/snehashish0902/Menous-Db.git
cd Menous-Db
</code></p></li>
<li><p>Install the required Python packages using pip:
<code>
pip install Flask
</code></p></li>
<li><p>Create the configuration file based on your operating system:</p>
<ul>
<li>macOS: <code>/Library/Caches/.menousdb/config.json</code></li>
<li>Windows: <code>%APPDATA%\MenoudDb\config.json</code></li>
<li>Linux: <code>/usr/local/bin/menousdb/config.json</code></li>
</ul>
<p>Sample Configuration (config.json):
<code>
{
"mode": "json",
"port": 5555
}
</code></p></li>
<li><p>Start Menous DB:</p>
<ul>
<li>For the default port (5555), run <code>python menousdb.py --start</code>.</li>
<li>To specify a custom port, run <code>python menousdb.py --port <port_number></code>.</li>
</ul></li>
</ol>
<hr />
<h2>4. Usage</h2>
<p>Once Menous DB is running, you can use its RESTful API to manage databases and tables. You can interact with the API using HTTP requests and the provided endpoints. Here are some common actions you can perform:</p>
<ul>
<li>Create a new database.</li>
<li>Check if a database exists.</li>
<li>Create tables within a database.</li>
<li>Insert data into tables.</li>
<li>Query tables with various conditions.</li>
<li>Update table records.</li>
<li>Delete tables and databases.</li>
<li>Authenticate users for secure access.</li>
</ul>
<hr />
<h2>5. API Endpoints</h2>
<h3>Database Management:</h3>
<ul>
<li><p><strong>Create a Database:</strong></p>
<ul>
<li>Endpoint: <code>/create-db</code></li>
<li>Method: POST</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name)</li>
<li>Description: Creates a new database.</li>
</ul></li>
<li><p><strong>Check if a Database Exists:</strong></p>
<ul>
<li>Endpoint: <code>/check-db-exists</code></li>
<li>Method: GET</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name)</li>
<li>Description: Checks if a database exists.</li>
</ul></li>
<li><p><strong>Delete a Database:</strong></p>
<ul>
<li>Endpoint: <code>/del-database</code></li>
<li>Method: DELETE</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name)</li>
<li>Description: Deletes a database.</li>
</ul></li>
</ul>
<h3>Table Management:</h3>
<ul>
<li><p><strong>Create a Table:</strong></p>
<ul>
<li>Endpoint: <code>/create-table</code></li>
<li>Method: POST</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name), <code>attributes</code> (table attributes)</li>
<li>Description: Creates a new table within a database.</li>
</ul></li>
<li><p><strong>Check if a Table Exists:</strong></p>
<ul>
<li>Endpoint: <code>/check-table-exists</code></li>
<li>Method: GET</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name)</li>
<li>Description: Checks if a table exists within a database.</li>
</ul></li>
<li><p><strong>Insert Data into a Table:</strong></p>
<ul>
<li>Endpoint: <code>/insert-into-table</code></li>
<li>Method: POST</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name), <code>values</code> (data to insert)</li>
<li>Description: Inserts data into a table.</li>
</ul></li>
<li><p><strong>Get Data from a Table:</strong></p>
<ul>
<li>Endpoint: <code>/get-table</code></li>
<li>Method: GET</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name)</li>
<li>Description: Retrieves data from a table.</li>
</ul></li>
<li><p><strong>Query a Table with Conditions:</strong></p>
<ul>
<li>Endpoint: <code>/select-where</code></li>
<li>Method: GET</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name), <code>conditions</code> (query conditions)</li>
<li>Description: Queries a table with specified conditions.</li>
</ul></li>
<li><p><strong>Select Specific Columns from a Table:</strong></p>
<ul>
<li>Endpoint: <code>/select-columns</code></li>
<li>Method: GET</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name), <code>columns</code> (columns to select)</li>
<li>Description: Retrieves specific columns from a table.</li>
</ul></li>
<li><p><strong>Select Specific Columns with Conditions:</strong></p>
<ul>
<li>Endpoint: <code>/select-columns-where</code></li>
<li>Method: GET</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name), <code>columns</code> (columns to select), <code>conditions</code> (query conditions)</li>
<li>Description: Retrieves specific columns with specified conditions.</li>
</ul></li>
<li><p><strong>Update Records in a Table:</strong></p>
<ul>
<li>Endpoint: <code>/update-table</code></li>
<li>Method: POST</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name), <code>conditions</code> (query conditions), <code>values</code> (new values)</li>
<li>Description: Updates records in a table based on specified conditions.</li>
</ul></li>
<li><p><strong>Delete Records from a Table:</strong></p>
<ul>
<li>Endpoint: <code>/delete-where</code></li>
<li>Method: DELETE</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name), <code>conditions</code> (query conditions)</li>
<li>Description: Deletes records from a table based on specified conditions.</li>
</ul></li>
<li><p><strong>Delete a Table:</strong></p>
<ul>
<li>Endpoint: <code>/delete-table</code></li>
<li>Method: DELETE</li>
<li>Parameters: <code>key</code> (API key), <code>database</code> (database name), <code>table</code> (table name)</li>
<li>Description: Deletes a table from a database.</li>
</ul></li>
</ul>
<h3>Authentication:</h3>
<ul>
<li><p><strong>Check User Authentication:</strong></p>
<ul>
<li>Endpoint: <code>/check-login</code></li>
<li>Method: GET</li>
<li>Parameters: <code>username</code> (username), <code>password</code> (password)</li>
<li>Description: Validates user credentials.</li>
</ul></li>
<li><p><strong>Verify User Credentials:</strong></p>
<ul>
<li>Endpoint: <code>/verify/<username>/<password></code></li>
<li>Method: GET</li>
<li>Parameters: <code>username</code> (username), <code>password</code> (password)</li>
<li>Description: Verifies user credentials and returns 'True' if valid.</li>
</ul></li>
<li><p><strong>Get User API Key:</strong></p>
<ul>
<li>Endpoint: <code>/getuserkey</code></li>
<li>Method: GET</li>
<li>Description: Retrieves the API key for the current user.</li>
</ul></li>
</ul>
<hr />
<h2>6. Examples</h2>
<p>Here are some</p>
<p>example use cases of Menous DB API:</p>
<p><strong>Create a Database:</strong>
<code>
POST /create-db
Parameters: key=<API_KEY>, database=<DATABASE_NAME>
</code></p>
<p><strong>Create a Table:</strong>
<code>
POST /create-table
Parameters: key=<API_KEY>, database=<DATABASE_NAME>, table=<TABLE_NAME>, attributes=<TABLE_ATTRIBUTES>
</code></p>
<p><strong>Insert Data into a Table:</strong>
<code>
POST /insert-into-table
Parameters: key=<API_KEY>, database=<DATABASE_NAME>, table=<TABLE_NAME>, values=<DATA_TO_INSERT>
</code></p>
<p><strong>Query Data from a Table:</strong>
<code>
GET /select-where
Parameters: key=<API_KEY>, database=<DATABASE_NAME>, table=<TABLE_NAME>, conditions=<QUERY_CONDITIONS>
</code></p>
<p><strong>Update Records in a Table:</strong>
<code>
POST /update-table
Parameters: key=<API_KEY>, database=<DATABASE_NAME>, table=<TABLE_NAME>, conditions=<QUERY_CONDITIONS>, values=<NEW_VALUES>
</code></p>
<p><strong>Delete Records from a Table:</strong>
<code>
DELETE /delete-where
Parameters: key=<API_KEY>, database=<DATABASE_NAME>, table=<TABLE_NAME>, conditions=<QUERY_CONDITIONS>
</code></p>
<p><strong>Check User Authentication:</strong>
<code>
GET /check-login
Parameters: username=<USERNAME>, password=<PASSWORD>
</code></p>
<p><strong>Verify User Credentials:</strong>
<code>
GET /verify/<username>/<password>
</code></p>
<p><strong>Get User API Key:</strong>
<code>
GET /getuserkey
</code></p>
<p>For more examples and detailed API usage, refer to the Menous DB documentation.</p>
<hr />
<h2>7. License</h2>
<p>Menous DB is released under the MIT Open Source Software License. You can find the full license details in the LICENSE file included with the source code.</p>
<hr />
<h2>8. Author Information</h2>
<ul>
<li>Author: Snehashish Laskar</li>
<li>Start Date: 1st November 2022</li>
<li>Current Version: 0.2.1</li>
<li>Contact: snehashish@example.com</li>
</ul>
<p>For any questions, feedback, or issues, please contact the author at the provided email address.</p>
<hr />
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>