mwalajs 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,514 +0,0 @@
1
-
2
- <!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>MwalaJS Documentation</title>
8
- <style>
9
- body {
10
- font-family: Arial, sans-serif;
11
- line-height: 1.6;
12
- margin: 20px;
13
- padding: 20px;
14
- }
15
- h1, h2, h3 {
16
- color: #333;
17
- }
18
- pre {
19
- background: #f4f4f4;
20
- padding: 10px;
21
- border-left: 4px solid #333;
22
- }
23
- .section {
24
- margin-bottom: 40px;
25
- }
26
- </style>
27
- </head>
28
- <body>
29
-
30
- <!-- Navbar -->
31
- <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
32
- <div class="container-fluid">
33
- <a class="navbar-brand" href="/">MwalaJS</a>
34
- <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
35
- <span class="navbar-toggler-icon"></span>
36
- </button>
37
- <div class="collapse navbar-collapse" id="navbarNav">
38
- <ul class="navbar-nav">
39
- <li class="nav-item">
40
- <a class="nav-link active" href="#overview">Overview</a>
41
- </li>
42
- <li class="nav-item">
43
- <a class="nav-link" href="#installation">Installation</a>
44
- </li>
45
- <li class="nav-item">
46
- <a class="nav-link" href="#commands">Commands</a>
47
- </li>
48
- <li class="nav-item">
49
- <a class="nav-link" href="#structure">Project Structure</a>
50
- </li>
51
- <li class="nav-item">
52
- <a class="nav-link" href="#example">Example Application</a>
53
- </li>
54
- <li class="nav-item">
55
- <a class="nav-link" href="#conclusion">Conclusion</a>
56
- </li>
57
- </ul>
58
- </div>
59
- </div>
60
- </nav>
61
-
62
- <h1>MwalaJS - Complete Documentation</h1>
63
- <p>Welcome to MwalaJS! This guide will help you install, configure, and use MwalaJS efficiently.</p>
64
-
65
- <div class="section">
66
- <h2>1. Installation</h2>
67
- <p>You can install MwalaJS in multiple ways:</p>
68
- <h3>Using GitHub Repository</h3>
69
- <p>Clone the repository from GitHub:</p>
70
- <pre>git clone https://github.com/mwala400/mwalajs.git</pre>
71
-
72
- <br> <a class="btn" href="https://github.com/mwala400/mwalajs" target="_blank" download> from github https://github.com/mwala400/mwalajs v1.0.0</a>
73
-
74
- <h3>Using a ZIP, EXE, or RAR File</h3>
75
- <p>Download and extract the files from the available compressed format:</p>
76
- <ul>
77
- <li>ZIP: Extract using <code>WinRAR</code> or <code>7-Zip</code>.</li>
78
- <li>RAR: Extract using <code>WinRAR</code>.</li>
79
- <li>EXE: Run the installer and follow the instructions.</li>
80
- </ul>
81
- <br> <h2 class="section-title">1. VERSION RELEASE</h2>
82
- <p>Click below to download the installer For Mwalajs framework:</p>
83
- <br><a class="btn" href="https://mwalajs.biasharabora.com/files/mwalaJS_installer.exe" target="_blank" download>Download MwalaJS COMMAND SHELL (CLS) download .exe file here </a>
84
- <br> <p>Click below to download zip file mwalajs framework:</p>
85
- <br> <a class="btn" href="https://mwalajs.biasharabora.com/files/mwalajsm.zip" target="_blank" download>Download MwalaJS mwalajs.zip v1.0.0</a>
86
- <br> <p>Click below to download rar file mwalajs framework :</p>
87
- <br> <a class="btn" href="https://mwalajs.biasharabora.com/files/mwalajsm.rar" target="_blank" download>Download MwalaJS mwalajs.rar v1.0.0</a>
88
-
89
- <br>
90
- </div>
91
-
92
- <div class="section">
93
- <h2>2. Setting Up MwalaJS</h2>
94
- <h3>Initialize MwalaJS</h3>
95
- <pre>mwala init</pre>
96
- <h3>Creating a New Project</h3>
97
- <pre>mwala create-project</pre>
98
- </div>
99
-
100
- <div class="section">
101
- <h2>3. Running the Application</h2>
102
- <pre>mwala serve</pre>
103
- </div>
104
-
105
- <div class="section">
106
- <h2>4. Database Operations</h2>
107
- <h3>Creating a Database</h3>
108
- <pre>mwala create-db</pre>
109
- <h3>Creating a Table</h3>
110
- <pre>mwala create-table &lt;table_name&gt;</pre>
111
- <h3>Dropping a Table</h3>
112
- <pre>mwala drop-table &lt;table_name&gt;</pre>
113
- </div>
114
-
115
- <div class="section">
116
- <h2>5. Code Generation</h2>
117
- <pre>
118
- mwala generate model &lt;name&gt;
119
- mwala generate controller &lt;name&gt;
120
- mwala generate route &lt;name&gt;
121
- mwala generate view &lt;name&gt;
122
- mwala generate midware &lt;name&gt;
123
- </pre>
124
- </div>
125
-
126
- <div class="section">
127
- <h2>6. Additional Information</h2>
128
- <p>For more details, visit: <a href="https://github.com/mwala400/mwalajs" target="_blank">GitHub Repository</a></p>
129
- </div>
130
- </body>
131
- </html>
132
-
133
- <!DOCTYPE html>
134
- <html lang="en">
135
- <head>
136
- <meta charset="UTF-8">
137
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
138
- <meta name="description" content="MwalaJS Framework Documentation - A lightweight Node.js framework for scalable web applications with MVC structure, built-in features, and easy database management.">
139
- <meta name="keywords" content="MwalaJS, Node.js, MVC framework, web development, database management, routing, middleware, template engine, Node.js framework documentation">
140
- <meta name="author" content="Hekima Ambalile Mwala">
141
- <meta property="og:title" content="MwalaJS Framework Documentation">
142
- <meta property="og:description" content="Learn how to use the MwalaJS framework to build scalable web applications with MVC architecture. Explore installation, commands, project structure, and more.">
143
- <meta property="og:url" content="https://mwalajs.biasharabora.com">
144
- <meta property="og:image" content="https://mwalajs.biasharabora.com/images/mwala-logo.png">
145
- <title>MwalaJS Framework Documentation</title>
146
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
147
- <style>
148
- body {
149
- font-family: Arial, sans-serif;
150
- }
151
- .section-title {
152
- margin-top: 40px;
153
- font-size: 1.5rem;
154
- }
155
- .code-block {
156
- background-color: #f8f9fa;
157
- padding: 10px;
158
- border-radius: 5px;
159
- border: 1px solid #ddd;
160
- font-family: 'Courier New', Courier, monospace;
161
- }
162
- </style>
163
- </head>
164
- <body>
165
-
166
-
167
- <div class="container">
168
- <header class="text-center my-5">
169
- <h1>MwalaJS Framework Documentation</h1>
170
- <p class="lead">A lightweight, easy-to-use Node.js framework to create scalable web applications with MVC architecture and powerful built-in features.</p>
171
- <p>GitHub Repository: <a href="https://github.com/mwala400/mwalajs" target="_blank">https://github.com/mwala400/mwalajs</a></p>
172
-
173
-
174
- </header>
175
-
176
- <!-- Overview Section -->
177
- <section id="overview">
178
- <h2 class="section-title">1. Overview</h2>
179
- <p>MwalaJS is a lightweight, easy-to-use Node.js framework designed to help you create scalable and organized MVC-based web applications. It comes with built-in features for handling routing, models, views, middleware, and database operations.</p>
180
- <a href="files/documentation.pdf" download="documentation.pdf" class="text">
181
- Download Documentation
182
- </a>
183
-
184
- <section id="release">
185
- <br> <h2 class="section-title">1. VERSION RELEASE</h2>
186
- <p>Click below to download the installer For Mwalajs framework:</p>
187
- <br><a class="btn" href="https://mwalajs.biasharabora.com/files/mwalaJS_installer.exe" download>Download MwalaJS COMMAND SHELL (CLS) download .exe file here </a>
188
- <br> <p>Click below to download zip file mwalajs framework:</p>
189
- <br> <a class="btn" href="https://mwalajs.biasharabora.com/files/mwalajsm.zip" download>Download MwalaJS mwalajs.zip v1.0.0</a>
190
- <br> <p>Click below to download rar file mwalajs framework :</p>
191
- <br> <a class="btn" href="https://mwalajs.biasharabora.com/files/mwalajsm.rar" download>Download MwalaJS mwalajs.rar v1.0.0</a>
192
- <pre>git clone https://github.com/mwala400/mwalajs.git</pre>
193
-
194
- <br> <a class="btn" href="https://github.com/mwala400/mwalajs" target="_blank" download>Clone from github https://github.com/mwala400/mwalajs v1.0.0</a>
195
-
196
- <br>
197
- <br>
198
- </section>
199
-
200
-
201
- <section>
202
- <h3>Key Features:</h3>
203
- <ul>
204
- <li><strong>MVC Architecture</strong>: Automatically generates models, controllers, routes, and views.</li>
205
- <li><strong>Database Management</strong>: Includes commands to create and drop tables, run migrations, and manage the database.</li>
206
- <li><strong>Middleware Support</strong>: Add custom middleware to handle requests.</li>
207
- <li><strong>EJS Template Engine</strong>: Integrated for view rendering.</li>
208
- <li><strong>Static File Support</strong>: Easily serve static assets like CSS, JavaScript, and images.</li>
209
- </ul>
210
- </section>
211
-
212
-
213
- <!DOCTYPE html>
214
- <html lang="en">
215
- <head>
216
- <meta charset="UTF-8">
217
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
218
- <title>MwalaJS Documentation</title>
219
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
220
- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
221
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/github-dark.min.css">
222
- <script>hljs.highlightAll();</script>
223
- <style>
224
- body {
225
- font-family: Arial, sans-serif;
226
- background-color: #f8f9fa;
227
- }
228
- .section-title {
229
- color: #007bff;
230
- margin-top: 20px;
231
- }
232
- pre {
233
- background: #272c34;
234
- color: #fff;
235
- padding: 15px;
236
- border-radius: 5px;
237
- }
238
- .navbar {
239
- background-color: #007bff;
240
- }
241
- .navbar-brand, .nav-link {
242
- color: white !important;
243
- }
244
- .footer {
245
- background: #007bff;
246
- color: white;
247
- text-align: center;
248
- padding: 10px 0;
249
- margin-top: 30px;
250
- }
251
- </style>
252
- </head>
253
- <body>
254
-
255
- <!-- Navigation -->
256
- <nav class="navbar navbar-expand-lg">
257
- <div class="container">
258
- <a class="navbar-brand" href="#">MwalaJS Docs</a>
259
- <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
260
- <span class="navbar-toggler-icon"></span>
261
- </button>
262
- <div class="collapse navbar-collapse" id="navbarNav">
263
- <ul class="navbar-nav ms-auto">
264
- <li class="nav-item"><a class="nav-link" href="#example">Examples</a></li>
265
- <li class="nav-item"><a class="nav-link" href="#conclusion">Conclusion</a></li>
266
- </ul>
267
- </div>
268
- </div>
269
- </nav>
270
-
271
- <!-- Example Application Section -->
272
- <div class="container mt-5">
273
- <section id="example">
274
- <h2 class="section-title">. Example Application</h2>
275
- <h3 class="section-title">app.mjs</h3>
276
- <p>Here is an example of the default <code>app.mjs</code> file for starting the server:</p>
277
- <pre><code class="language-javascript">
278
- import mwalajs from 'mwalajs';
279
- import { homeRoutes } from './routes/homeRoutes.mjs';
280
- import { fileURLToPath } from 'url';
281
- import path from 'path';
282
-
283
- const __filename = fileURLToPath(import.meta.url);
284
- const __dirname = path.dirname(__filename);
285
-
286
- mwalajs.set('view engine', 'ejs');
287
- mwalajs.set('views', path.join(__dirname, 'views'));
288
-
289
- mwalajs.useStatic(path.join(__dirname, 'public'));
290
-
291
- mwalajs.use('/', homeRoutes);
292
-
293
- const port = process.env.PORT || 3000;
294
- mwalajs.listen(port, () => {
295
- console.log(`Server running on http://localhost:${port}`);
296
- });
297
- </code></pre>
298
-
299
- <h3 class="section-title">homeRoutes.mjs</h3>
300
- <p>Here is an example of the default <code>homeRoutes.mjs</code> file:</p>
301
- <pre><code class="language-javascript">
302
- import mwalajs from 'mwalajs';
303
- import { homeController, Steps, welcome, about } from '../controllers/homeController.mjs';
304
-
305
- const router = mwalajs.Router();
306
-
307
- router.get('/', homeController.getHomePage);
308
- router.get('/steps', Steps.getSteps);
309
- router.get('/welcome', welcome.getwelcome);
310
- router.get('/about', about.getabout);
311
-
312
- export { router as homeRoutes };
313
- </code></pre>
314
-
315
- <h3 class="section-title">homeController.mjs</h3>
316
- <p>Here is an example of the <code>homeController.mjs</code> file:</p>
317
- <pre><code class="language-javascript">
318
- export const homeController = {
319
- getHomePage: (req, res) => {
320
- res.render('index', { title: 'Welcome to MwalaJS MVC' });
321
- }
322
- };
323
-
324
- export const Steps = {
325
- getSteps: (req, res) => {
326
- res.render('steps', { title: 'Steps in MwalaJS MVC' });
327
- }
328
- };
329
-
330
- export const welcome = {
331
- getwelcome: (req, res) => {
332
- res.render('welcome', { title: 'Welcome to MwalaJS MVC' });
333
- }
334
- };
335
-
336
- export const about = {
337
- getabout: (req, res) => {
338
- res.render('about', { title: 'About MwalaJS MVC' });
339
- }
340
- };
341
- </code></pre>
342
- </section>
343
-
344
- <!-- Conclusion Section -->
345
- <section id="conclusion">
346
- <h2 class="section-title">6. Conclusion</h2>
347
- <p>MwalaJS is designed to streamline the development of MVC-based applications with its easy-to-use commands for setting up projects, generating components, and managing the database.</p>
348
- <p>For full documentation and to contribute, visit the <a href="https://github.com/mwala400/mwalajs" target="_blank">GitHub repository</a>.</p>
349
- <h3>Summary of MwalaJS Commands</h3>
350
- <pre><code>
351
- General Commands:
352
- - mwala -v | mwala --version → Show MwalaJS version.
353
- - mwala help | mwala h → Show help message.
354
-
355
- Project Management:
356
- - mwala create-project → Create a new project.
357
- - mwala init → Initialize MwalaJS.
358
-
359
- Running the Application:
360
- - mwala serve | mwala app.mjs → Start MwalaJS app.
361
-
362
- Database Operations:
363
- - mwala create-db → Create database from .env file.
364
- - mwala migrate all → Run all pending migrations.
365
- - mwala rollback all → Undo migration.
366
-
367
- Code Generation:
368
- - mwala generate model <name> → Create a model.
369
- - mwala generate controller <name> → Create a controller.
370
- - mwala generate route <name> → Create a route.
371
- - mwala generate view <name> → Create a view.
372
-
373
- To execute a command, use:
374
- mwala <command>
375
- </code></pre>
376
- </section>
377
- </div>
378
- <h1>mwalajsm/ # Root directory</h1>
379
- <pre>
380
- mwalajsm/ # Root directory
381
- │── app.mjs # Main application file
382
- │── runMigrations.mjs # Handles database migrations
383
- │── createProject.mjs # Script for creating new projects
384
- │── setupMwalajs.mjs # Setup script for MwalaJS
385
- │── start.bat # Batch script to start the server
386
- │── setup.bat # Batch script for installation
387
- │── setup.bash # Bash script for installation (Linux/macOS)
388
- │── setup.sh # Another installation script
389
- │── package.json # Dependencies and project metadata
390
- │── package-lock.json # Dependency lock file
391
- │── README.md # Documentation for MwalaJS
392
- │── migrations/ # Database migration files
393
- │── models/ # Database models
394
- │── controllers/ # Handles application logic
395
- │── routes/ # Defines API routes
396
- │── middlewares/ # Custom middleware for authentication, logging, etc.
397
- │── config/ # Configuration files (e.g., database, app settings)
398
- │── public/ # Static assets like CSS, JavaScript, and images
399
- │── views/ # Template views (if using server-side rendering)
400
- │── mwalajs/ # Core framework files
401
- │── dist/ # Compiled or built files
402
- │── node_modules/ # Dependencies installed via npm
403
- │── YOUR CREATED PROJECT/ # When run mwala create-project will request project name related files (clarify purpose)
404
- │── installer/ # Installation-related files
405
- │── installerimg.png # Image used during installation
406
- │── mwalajs5.png # Framework branding/image
407
- │── mwalajs4_RXv_icon.ico # Framework icons
408
- │── mwalajs4_lyh_icon.ico # Another framework icon
409
- │── mwalajsm.iss # Installer script for Windows
410
- │── background.bmp # Background image (possibly for setup UI)
411
- │── background.png # Another background image
412
- │── bin/ # Executable files or scripts
413
- This structure makes MwalaJS a well-organized and scalable framework. To make it even more convincing, you could add:
414
-
415
- A "tests/" folder – To show built-in support for unit and integration tests.
416
- A "docs/" folder – Dedicated to documentation with detailed guides.
417
- A "scripts/" folder – For automation scripts instead of having them in the root directory.
418
- A "logs/" folder – To store logs instead of scattering them.
419
-
420
-
421
- ```
422
- </pre>
423
-
424
-
425
- ## Getting Started
426
- <pre>
427
- ### Installation
428
- 1. **Install MwalaJS globally:**
429
- ```sh
430
- npm install -g mwalajs
431
- ```
432
- 2. **Create a new project:**
433
- ```sh
434
- mwalajs create myApp
435
- cd myApp
436
- npm install
437
- ```
438
- 3. **Run the development server:**
439
- ```sh
440
- npm start
441
- ```
442
-
443
- ## Sample Code
444
- A simple MwalaJS route example:
445
- Your MwalaJS file structure is well-organized, but to make it more convincing for developers to switch, consider:
446
-
447
- 1. Clean File Structure Explanation
448
- Here’s a structured breakdown:
449
- </pre>
450
-
451
- <h1>FOLDERS</h1>
452
- <pre>
453
-
454
- mwalajsm/ # Root directory
455
- │── app.mjs # Main application entry point
456
- │── ATTENDANCE/ # Attendance-related files (clarify purpose)
457
- │── bin/ # Executable scripts
458
- │── config/ # Configuration files
459
- │── controllers/ # Business logic controllers
460
- │── middlewares/ # Request middlewares
461
- │── migrations/ # Database migrations
462
- │── models/ # Database models
463
- │── mwalajs/ # Core framework code
464
- │── public/ # Static assets (CSS, JS, Images)
465
- │── routes/ # API & web routes
466
- │── views/ # Frontend templates (if using templating)
467
- │── dist/ # Compiled or bundled output
468
- │── package.json # Dependencies & scripts
469
- │── README.md # Project documentation
470
- │── start.bat # Windows startup script
471
- │── setup.sh # Unix-based setup script
472
- │── createProject.mjs # Automates project creation
473
- │── runMigrations.mjs # Database migration script
474
- │── installer/ # Installer-related files
475
- │── node_modules/ # Dependencies
476
- 2. Why Developers Should Switch to MwalaJS
477
- MwalaJS should highlight:
478
- Better modular structure (prevents spaghetti code)
479
- Built-in migrations & models (reduces DB setup time)
480
- Simplified setup scripts (automates installation)
481
- Performance optimizations (mention key tech choices)
482
- Security-first approach (middleware for authentication, validation)
483
- </pre>
484
-
485
- 3. Preventing Module Repetition
486
- <br>
487
- Are there duplicate functionalities in middlewares/, controllers/, or mwalajs/? <br>
488
- If mwalajs/ is the core framework, maybe avoid repeating similar logic inside controllers/ <br>
489
-
490
- <br>
491
- ## Future of Web Development <br>
492
- MwalaJS is designed to replace traditional frameworks by offering a modern, easy-to-use, <br>
493
- and high-performance alternative. Whether you are building a simple website or a complex web application, <br>
494
- MwalaJS provides the tools you need for success.
495
-
496
- <br>
497
- ## Contribute <br>
498
- We welcome contributors! Feel free to fork the repository, submit issues, and make pull requests.
499
- <br><br>
500
- ## License <br>
501
- MwalaJS is open-source and licensed under the MIT License.
502
- <br>
503
-
504
-
505
-
506
-
507
- <!-- Footer -->
508
- <div class="footer">
509
- &copy; 2025 MwalaJS Documentation | All Rights Reserved
510
- </div>
511
-
512
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
513
- </body>
514
- </html>