mwalajs 1.0.4 → 1.0.6
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.
- package/README.md +63 -17
- package/bin/mwala.mjs +1 -1
- package/package.json +1 -1
- package/setupMwalajs.mjs +51 -34
- package/views/index.ejs +431 -164
package/README.md
CHANGED
|
@@ -77,6 +77,59 @@ mwala serve
|
|
|
77
77
|
### app.mjs
|
|
78
78
|
Here is an example of the default `app.mjs` file for starting the server:
|
|
79
79
|
|
|
80
|
+
|
|
81
|
+
git clone https://github.com/mwala400/mwalajs.git
|
|
82
|
+

|
|
83
|
+

|
|
84
|
+

|
|
85
|
+
# MwalaJS Framework
|
|
86
|
+
|
|
87
|
+
MwalaJS is a modern CLI tool and web framework built on top of Javascript,Node.js and Express.js for powerful and fast backend and frontend development. It simplifies creating MVC applications, managing databases, and generating code scaffolding.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Table of Contents
|
|
92
|
+
|
|
93
|
+
- [Features](#features)
|
|
94
|
+
- [Requirements](#requirements)
|
|
95
|
+
- [Installation](#installation)
|
|
96
|
+
- [Setup](#setup)
|
|
97
|
+
- [Usage](#usage)
|
|
98
|
+
- [CLI Commands](#cli-commands)
|
|
99
|
+
- [Project Structure](#project-structure)
|
|
100
|
+
- [Contributing](#contributing)
|
|
101
|
+
- [License](#license)
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Features
|
|
106
|
+
|
|
107
|
+
- Lightweight Express.js wrapper with MVC pattern
|
|
108
|
+
- CLI tool for project scaffolding and database management
|
|
109
|
+
- Support for multiple databases: MongoDB, MySQL, PostgreSQL, SQLite
|
|
110
|
+
- Built-in middleware integration (session, cors, helmet, compression)
|
|
111
|
+
- Easy static file serving and routing
|
|
112
|
+
- Code generation for models, controllers, routes, views, and middleware
|
|
113
|
+
- Migration support for database schema changes
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Requirements
|
|
118
|
+
|
|
119
|
+
- Node.js v18 or higher
|
|
120
|
+
- npm (comes with Node.js)
|
|
121
|
+
- Supported databases (MongoDB, MySQL, PostgreSQL, SQLite) installed and configured
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Installation
|
|
126
|
+
|
|
127
|
+
Install MwalaJS globally via npm:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm install -g mwalajs
|
|
131
|
+
|
|
132
|
+
|
|
80
133
|
```javascript
|
|
81
134
|
import mwalajs from 'mwalajs';
|
|
82
135
|
import { homeRoutes } from './routes/homeRoutes.mjs';
|
|
@@ -89,7 +142,7 @@ const __dirname = path.dirname(__filename);
|
|
|
89
142
|
mwalajs.set('view engine', 'ejs');
|
|
90
143
|
mwalajs.set('views', path.join(__dirname, 'views'));
|
|
91
144
|
|
|
92
|
-
mwalajs.
|
|
145
|
+
mwalajs.useStatic(path.join(__dirname, 'public'));
|
|
93
146
|
|
|
94
147
|
mwalajs.use('/', homeRoutes);
|
|
95
148
|
|
|
@@ -106,7 +159,7 @@ Here is an example of the default `homeRoutes.mjs` file:
|
|
|
106
159
|
import mwalajs from 'mwalajs';
|
|
107
160
|
import { homeController, Steps, welcome, about } from '../controllers/homeController.mjs';
|
|
108
161
|
|
|
109
|
-
const router = mwalajs.
|
|
162
|
+
const router = mwalajs.Router();
|
|
110
163
|
|
|
111
164
|
router.get('/', homeController.getHomePage);
|
|
112
165
|
router.get('/steps', Steps.getSteps);
|
|
@@ -154,8 +207,8 @@ export const about = {
|
|
|
154
207
|
- `mwala help` | `mwala h` → Show this help message.
|
|
155
208
|
|
|
156
209
|
#### Project Management:
|
|
157
|
-
- `mwala create-project
|
|
158
|
-
- `mwala init` → Initialize MwalaJS in the current project.
|
|
210
|
+
- `mwala create-project ` → Create a new MwalaJS project Then will request project name.
|
|
211
|
+
- `mwala init` → Initialize MwalaJS in the current project I N OLD VERSION .
|
|
159
212
|
|
|
160
213
|
#### Running the Application:
|
|
161
214
|
- `mwala serve` | `mwala app.mjs` → Start the MwalaJS application.
|
|
@@ -188,7 +241,7 @@ Clone the repository from GitHub:
|
|
|
188
241
|
|
|
189
242
|
git clone https://github.com/mwala400/mwalajs.git
|
|
190
243
|
|
|
191
|
-
Using a ZIP, EXE, or RAR File
|
|
244
|
+
Using a ZIP, EXE, or RAR File
|
|
192
245
|
Download and extract the files from the available compressed format:
|
|
193
246
|
|
|
194
247
|
ZIP: Extract using WinRAR or 7-Zip.
|
|
@@ -208,9 +261,9 @@ Click below to download rar file mwalajs framework :
|
|
|
208
261
|
|
|
209
262
|
|
|
210
263
|
|
|
211
|
-
2. Setting Up MwalaJS
|
|
264
|
+
2. Setting Up MwalaJS if installed through .exe,zip or rar
|
|
212
265
|
Initialize MwalaJS
|
|
213
|
-
mwala init
|
|
266
|
+
mwala init
|
|
214
267
|
Creating a New Project
|
|
215
268
|
mwala create-project
|
|
216
269
|
3. Running the Application
|
|
@@ -366,8 +419,8 @@ Summary of MwalaJS Commands
|
|
|
366
419
|
🔹 To execute a command, use:
|
|
367
420
|
mwala
|
|
368
421
|
|
|
369
|
-
|
|
370
|
-
|
|
422
|
+
mwalajs/ # Root directory
|
|
423
|
+
mwalajs/ # Root directory
|
|
371
424
|
│── app.mjs # Main application file
|
|
372
425
|
│── runMigrations.mjs # Handles database migrations
|
|
373
426
|
│── createProject.mjs # Script for creating new projects
|
|
@@ -447,7 +500,7 @@ Your MwalaJS file structure is well-organized, but to make it more convincing fo
|
|
|
447
500
|
Here’s a structured breakdown:
|
|
448
501
|
FOLDERS
|
|
449
502
|
|
|
450
|
-
--
|
|
503
|
+
-- mwalajs/ # Root directory
|
|
451
504
|
│── app.mjs # Main application entry point
|
|
452
505
|
│── ATTENDANCE/ # Attendance-related files (clarify purpose)
|
|
453
506
|
│── bin/ # Executable scripts
|
|
@@ -536,10 +589,3 @@ Click below to download zip file mwalajs framework:
|
|
|
536
589
|
|
|
537
590
|
|
|
538
591
|
Click below to download rar file mwalajs framework :
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
git clone https://github.com/mwala400/mwalajs.git
|
|
542
|
-

|
|
543
|
-

|
|
544
|
-

|
|
545
|
-
|
package/bin/mwala.mjs
CHANGED
package/package.json
CHANGED
package/setupMwalajs.mjs
CHANGED
|
@@ -1,58 +1,75 @@
|
|
|
1
|
-
import
|
|
2
|
-
import fs from 'fs-extra';
|
|
1
|
+
import fs from 'fs';
|
|
3
2
|
import path from 'path';
|
|
4
3
|
import os from 'os';
|
|
4
|
+
import readline from 'readline';
|
|
5
|
+
import { execSync } from 'child_process';
|
|
5
6
|
import { fileURLToPath } from 'url';
|
|
6
7
|
|
|
8
|
+
// Convert __dirname and __filename for ES module
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
|
|
12
|
+
// Create readline interface
|
|
13
|
+
const rl = readline.createInterface({
|
|
14
|
+
input: process.stdin,
|
|
15
|
+
output: process.stdout
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
async function prompt(question) {
|
|
19
|
+
return new Promise((resolve) => rl.question(question, resolve));
|
|
20
|
+
}
|
|
21
|
+
|
|
7
22
|
/**
|
|
8
|
-
* Function to install
|
|
23
|
+
* Function to install mwalajs.
|
|
24
|
+
* - If package.json exists, it proceeds to install.
|
|
25
|
+
* - If not, it prompts user to auto-create or manually create.
|
|
26
|
+
* - When auto-creating, it sets "type": "module" and "main": "app.mjs" by default.
|
|
9
27
|
*/
|
|
10
28
|
async function setupMwalajs() {
|
|
11
|
-
const projectDir = process.cwd();
|
|
12
|
-
const
|
|
13
|
-
const nodeModulesDir = path.join(projectDir, 'node_modules'); // node_modules
|
|
14
|
-
const targetMwalajs = path.join(nodeModulesDir, 'mwalajs'); // Destination folder inside node_modules
|
|
29
|
+
const projectDir = process.cwd();
|
|
30
|
+
const packageJsonPath = path.join(projectDir, 'package.json');
|
|
15
31
|
|
|
16
32
|
try {
|
|
17
|
-
console.log("
|
|
18
|
-
const userOS = os.platform();
|
|
19
|
-
console.log(`
|
|
20
|
-
|
|
21
|
-
// Check if mwalajs exists
|
|
22
|
-
if (!fs.existsSync(mwalajsDir)) {
|
|
23
|
-
console.error(" Error: 'mwalajs' folder not found! Please ensure it exists.");
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
33
|
+
console.log("Detecting Operating System...");
|
|
34
|
+
const userOS = os.platform();
|
|
35
|
+
console.log(`Running on: ${userOS === "win32" ? "Windows" : userOS === "darwin" ? "MacOS" : "Linux"}`);
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
38
|
+
console.log("No package.json found in the current directory.");
|
|
39
|
+
const choice = await prompt("Do you want to create one now? (y/n): ");
|
|
29
40
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
41
|
+
if (choice.toLowerCase() === 'y') {
|
|
42
|
+
console.log("Initializing package.json...");
|
|
43
|
+
execSync('npm init -y', { stdio: 'inherit' });
|
|
34
44
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
// Modify package.json with defaults
|
|
46
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
47
|
+
pkg.type = "module";
|
|
48
|
+
pkg.main = "app.mjs";
|
|
49
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2));
|
|
50
|
+
console.log('package.json created with type: "module" and main: "app.mjs"');
|
|
51
|
+
} else {
|
|
52
|
+
console.log("Please create a package.json file manually using `npm init`.");
|
|
53
|
+
rl.close();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
39
56
|
}
|
|
40
57
|
|
|
41
|
-
console.log("
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
console.log(` Successfully installed 'dependencies' and moved 'mwalajs' to:`);
|
|
45
|
-
console.log(` ${targetMwalajs}`);
|
|
58
|
+
console.log("Installing mwalajs in current directory...");
|
|
59
|
+
execSync('npm install mwalajs', { stdio: 'inherit' });
|
|
60
|
+
console.log("mwalajs installed successfully.");
|
|
46
61
|
|
|
47
62
|
} catch (error) {
|
|
48
|
-
console.error("
|
|
63
|
+
console.error("Error:", error.message);
|
|
64
|
+
} finally {
|
|
65
|
+
rl.close();
|
|
49
66
|
}
|
|
50
67
|
}
|
|
51
68
|
|
|
52
|
-
// Export the function
|
|
69
|
+
// Export the function
|
|
53
70
|
export { setupMwalajs };
|
|
54
71
|
|
|
55
|
-
//
|
|
72
|
+
// Only execute if run directly
|
|
56
73
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
57
74
|
setupMwalajs();
|
|
58
75
|
}
|
package/views/index.ejs
CHANGED
|
@@ -1,227 +1,494 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta charset="UTF-8"
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<meta name="keywords" content="MwalaJS, MVC
|
|
14
|
-
|
|
15
|
-
<!-- Author information -->
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>MwalaJS Framework Documentation</title>
|
|
7
|
+
|
|
8
|
+
<!-- Bootstrap -->
|
|
9
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
10
|
+
|
|
11
|
+
<!-- Meta Info for SEO & Social Sharing -->
|
|
12
|
+
<meta name="description" content="MwalaJS - Lightweight MVC JavaScript framework for full-stack web apps.">
|
|
13
|
+
<meta name="keywords" content="MwalaJS, MVC, Node.js framework, JavaScript framework, documentation">
|
|
16
14
|
<meta name="author" content="Hekima Ambalile Mwala">
|
|
17
|
-
|
|
18
|
-
<!-- Open Graph
|
|
19
|
-
<meta property="og:title" content="MwalaJS -
|
|
20
|
-
<meta property="og:description" content="
|
|
21
|
-
<meta property="og:image" content="path-to-image.jpg"> <!-- Add your image URL for social media previews -->
|
|
22
|
-
<meta property="og:url" content="https://yourwebsite.com/help"> <!-- Add your actual website URL here -->
|
|
23
|
-
|
|
24
|
-
<!-- Twitter meta tags for better visibility on Twitter -->
|
|
25
|
-
<meta name="twitter:title" content="MwalaJS - Help | Documentation for MVC Framework">
|
|
26
|
-
<meta name="twitter:description" content="Get detailed help and documentation for MwalaJS framework. Learn how to use MwalaJS commands, structure, installation, and more.">
|
|
27
|
-
<meta name="twitter:image" content="path-to-image.jpg">
|
|
28
|
-
<meta name="twitter:card" content="summary_large_image">
|
|
29
|
-
<meta property="og:url" content="https://mwalajs.biasharabora.com">
|
|
15
|
+
|
|
16
|
+
<!-- Open Graph (for social media cards) -->
|
|
17
|
+
<meta property="og:title" content="MwalaJS - MVC Framework">
|
|
18
|
+
<meta property="og:description" content="Documentation for MwalaJS framework including installation, commands, and structure.">
|
|
30
19
|
<meta property="og:image" content="https://your-website-url.com/images/mwala-logo.png">
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
<!-- Favicon for the website -->
|
|
34
|
-
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
|
35
|
-
|
|
36
|
-
<!-- Link to external stylesheet -->
|
|
37
|
-
<link rel="stylesheet" href="styles.css">
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<style>
|
|
20
|
+
<meta property="og:url" content="https://mwalajs.biasharabora.com">
|
|
41
21
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
background-color: #f4f4f4;
|
|
48
|
-
}
|
|
22
|
+
<!-- Twitter Cards -->
|
|
23
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
24
|
+
|
|
25
|
+
<!-- Favicon -->
|
|
26
|
+
<link rel="icon" href="favicon.ico" type="image/x-icon" />
|
|
49
27
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
28
|
+
<!-- Custom Styles -->
|
|
29
|
+
<style>
|
|
30
|
+
body {
|
|
31
|
+
background-color: #f8f9fa;
|
|
32
|
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
33
|
+
line-height: 1.6;
|
|
53
34
|
}
|
|
54
35
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
margin: 0 auto;
|
|
58
|
-
padding: 20px;
|
|
36
|
+
h1, h2 {
|
|
37
|
+
color: #0d6efd;
|
|
59
38
|
}
|
|
60
39
|
|
|
61
40
|
.help-content {
|
|
62
|
-
background-color: #
|
|
63
|
-
padding:
|
|
41
|
+
background-color: #ffffff;
|
|
42
|
+
padding: 2rem;
|
|
64
43
|
border-radius: 8px;
|
|
65
|
-
box-shadow: 0
|
|
44
|
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
|
|
45
|
+
margin-top: 2rem;
|
|
66
46
|
}
|
|
67
47
|
|
|
68
48
|
pre {
|
|
69
|
-
background-color: #
|
|
70
|
-
color: #
|
|
71
|
-
padding:
|
|
49
|
+
background-color: #1e1e1e;
|
|
50
|
+
color: #f1f1f1;
|
|
51
|
+
padding: 1rem;
|
|
72
52
|
border-radius: 8px;
|
|
73
|
-
|
|
74
|
-
word-wrap: break-word;
|
|
53
|
+
overflow-x: auto;
|
|
75
54
|
}
|
|
76
55
|
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
color: #5c5c5c;
|
|
56
|
+
.nav-link {
|
|
57
|
+
color: white !important;
|
|
80
58
|
}
|
|
81
59
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
60
|
+
.table thead {
|
|
61
|
+
background-color: #f1f1f1;
|
|
62
|
+
}
|
|
86
63
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
64
|
+
footer {
|
|
65
|
+
background-color: #212529;
|
|
66
|
+
color: #ffffff;
|
|
67
|
+
padding: 1rem 0;
|
|
68
|
+
margin-top: 3rem;
|
|
69
|
+
}
|
|
90
70
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
71
|
+
.whatsapp-box {
|
|
72
|
+
background-color: #d1e7dd;
|
|
73
|
+
padding: 1rem;
|
|
74
|
+
border-left: 5px solid #198754;
|
|
75
|
+
border-radius: 6px;
|
|
76
|
+
margin-top: 2rem;
|
|
77
|
+
}
|
|
94
78
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
.whatsapp-box a {
|
|
80
|
+
color: #198754;
|
|
81
|
+
font-weight: bold;
|
|
98
82
|
}
|
|
99
83
|
|
|
100
|
-
@media (max-width:
|
|
84
|
+
@media (max-width: 768px) {
|
|
101
85
|
h1 {
|
|
102
|
-
font-size: 1.
|
|
86
|
+
font-size: 1.5rem;
|
|
103
87
|
}
|
|
104
88
|
|
|
105
89
|
pre {
|
|
106
|
-
|
|
90
|
+
font-size: 0.9rem;
|
|
107
91
|
}
|
|
108
92
|
}
|
|
109
93
|
</style>
|
|
110
|
-
<link rel="stylesheet" href="styles.css">
|
|
111
|
-
<!-- Structured data for better search engine understanding (JSON-LD) -->
|
|
112
|
-
<script type="application/ld+json">
|
|
113
|
-
{
|
|
114
|
-
"@context": "https://schema.org",
|
|
115
|
-
"@type": "WebPage",
|
|
116
|
-
"name": "MwalaJS Help Documentation",
|
|
117
|
-
"description": "Get detailed help and documentation for MwalaJS framework. Learn how to use MwalaJS commands, structure, installation, and more.",
|
|
118
|
-
"url": "https://mwalajs.biasharabora.com/setups",
|
|
119
|
-
"publisher": {
|
|
120
|
-
"@type": "Organization",
|
|
121
|
-
"name": "MwalaJS"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
</script>
|
|
125
|
-
|
|
126
94
|
</head>
|
|
127
95
|
<body>
|
|
128
|
-
|
|
96
|
+
|
|
97
|
+
<!-- Navigation -->
|
|
129
98
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
130
|
-
<div class="container
|
|
131
|
-
<a class="navbar-brand" href="
|
|
132
|
-
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
|
99
|
+
<div class="container">
|
|
100
|
+
<a class="navbar-brand" href="#">MwalaJS</a>
|
|
101
|
+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
|
133
102
|
<span class="navbar-toggler-icon"></span>
|
|
134
103
|
</button>
|
|
135
104
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
136
|
-
<ul class="navbar-nav">
|
|
137
|
-
<li class="nav-item">
|
|
138
|
-
|
|
139
|
-
</li>
|
|
140
|
-
<li class="nav-item">
|
|
141
|
-
|
|
142
|
-
</li>
|
|
143
|
-
<li class="nav-item">
|
|
144
|
-
<a class="nav-link" href="steps#commands">Commands</a>
|
|
145
|
-
</li>
|
|
146
|
-
<li class="nav-item">
|
|
147
|
-
<a class="nav-link" href="steps#structure">Project Structure</a>
|
|
148
|
-
</li>
|
|
149
|
-
<li class="nav-item">
|
|
150
|
-
<a class="nav-link" href="steps#example">Example Application</a>
|
|
151
|
-
</li>
|
|
152
|
-
<li class="nav-item">
|
|
153
|
-
<a class="nav-link" href="steps#conclusion">Conclusion</a>
|
|
154
|
-
</li>
|
|
105
|
+
<ul class="navbar-nav ms-auto">
|
|
106
|
+
<li class="nav-item"><a class="nav-link" href="steps#overview">Overview</a></li>
|
|
107
|
+
<li class="nav-item"><a class="nav-link" href="steps#installation">Installation</a></li>
|
|
108
|
+
<li class="nav-item"><a class="nav-link" href="steps#commands">Commands</a></li>
|
|
109
|
+
<li class="nav-item"><a class="nav-link" href="steps#structure">Structure</a></li>
|
|
110
|
+
<li class="nav-item"><a class="nav-link" href="steps#example">Examples</a></li>
|
|
111
|
+
<li class="nav-item"><a class="nav-link" href="/about">About</a></li>
|
|
155
112
|
</ul>
|
|
156
113
|
</div>
|
|
157
114
|
</div>
|
|
158
115
|
</nav>
|
|
159
116
|
|
|
117
|
+
<!-- Main Content -->
|
|
160
118
|
<div class="container">
|
|
161
|
-
<h1>MwalaJS Framework
|
|
119
|
+
<h1 class="text-center my-4">MwalaJS Framework Documentation</h1>
|
|
120
|
+
|
|
162
121
|
<div class="help-content">
|
|
163
|
-
<
|
|
122
|
+
<h2>Available Commands</h2>
|
|
164
123
|
<pre>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
- mwala create-db
|
|
169
|
-
- mwala create-table
|
|
170
|
-
- mwala drop-table
|
|
171
|
-
- mwala migrate all
|
|
172
|
-
- mwala rollback all
|
|
173
|
-
|
|
174
|
-
Code Generation
|
|
175
|
-
- mwala generate model
|
|
176
|
-
- mwala generate controller
|
|
177
|
-
- mwala generate route
|
|
178
|
-
- mwala generate view
|
|
179
|
-
- mwala generate midware
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
. <span class="command">mwala drop-table <table_name></span> - Drop a table from the database. Example: mwala drop-table users
|
|
184
|
-
. <span class="command">mwala migrate all</span> - Run migrations on the database. Example: mwala migrate
|
|
185
|
-
. <span class="command">mwala rollback all</span> - Rollback the last migration. Example: mwala rollback
|
|
124
|
+
<span class="command">mwala create-project <projectName></span> ? Create a new MVC project.
|
|
125
|
+
<span class="command">mwala app.mjs</span> ? Start the main application file.
|
|
126
|
+
<span class="command">Database Commands:</span>
|
|
127
|
+
- mwala create-db ? Create database.
|
|
128
|
+
- mwala create-table <name> ? Create a table.
|
|
129
|
+
- mwala drop-table <name> ? Drop a table.
|
|
130
|
+
- mwala migrate all ? Run migrations.
|
|
131
|
+
- mwala rollback all ? Undo last migration.
|
|
132
|
+
|
|
133
|
+
<span class="command">Code Generation:</span>
|
|
134
|
+
- mwala generate model <name>
|
|
135
|
+
- mwala generate controller <name>
|
|
136
|
+
- mwala generate route <name>
|
|
137
|
+
- mwala generate view <name>
|
|
138
|
+
- mwala generate midware <name>
|
|
139
|
+
|
|
140
|
+
<span class="command">mwala serve</span> ? Start local server.
|
|
141
|
+
<span class="command">mwala help</span> ? List all available commands.
|
|
186
142
|
</pre>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
<br> <a class="btn" href="https://mwalajs.biasharabora.com/files/mwalajsm.zip" download>Download MwalaJS mwalajs.zip v1.0.0</a>
|
|
194
|
-
<br> <p>Click below to download rar file mwalajs framework :</p>
|
|
195
|
-
<br> <a class="btn" href="https://mwalajs.biasharabora.com/files/mwalajsm.rar" download>Download MwalaJS mwalajs.rar v1.0.0</a>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
<div class="container my-5">
|
|
147
|
+
<h1 class="mb-4 text-primary">MwalaJS Framework</h1>
|
|
148
|
+
<p><strong>MwalaJS</strong> is a lightweight and modular JavaScript framework designed for building scalable server-side applications using modern Node.js features.</p>
|
|
196
149
|
|
|
150
|
+
<hr />
|
|
151
|
+
|
|
152
|
+
<h2 class="mt-4">Installation </h2>
|
|
153
|
+
<p>Install MwalaJS globally to use CLI tools:</p>
|
|
154
|
+
<pre><code class=" p-3 rounded">npm install -g mwalajs</code></pre>
|
|
155
|
+
<p>If you're using it in a specific project, install locally:</p>
|
|
156
|
+
<pre><code class="p-3 rounded">npm install mwalajs</code></pre>
|
|
157
|
+
<p><strong>Note:</strong> In case of errors regarding missing <code>fs-extra</code>, you can install it manually:</p>
|
|
158
|
+
<pre><code class=" p-3 rounded">npm install -g fs-extra</code></pre>
|
|
159
|
+
<p><strong>Note 2:</strong> <code class=" p-3 rounded"> NOW MWALAJS IS ONE OF NPM PACKAGE NO NEED TO DOWNLOAD .ZIP, .RAR OR .EXE FILES <br>
|
|
160
|
+
also no need to run mwala init in version 1.0.4 or above
|
|
197
161
|
<br>
|
|
162
|
+
before any create a .json file by running npm init
|
|
163
|
+
make sure in your .json file you have "dependencies": {
|
|
164
|
+
"mwalajs": "^1.0.5"
|
|
165
|
+
}
|
|
166
|
+
and "type": "module", these are more important to be set before run mwala serve
|
|
167
|
+
</code>, you can install it BY npm install -g mwalajs:</p>
|
|
168
|
+
|
|
169
|
+
<hr />
|
|
170
|
+
|
|
171
|
+
<h2 class="mt-4"> Usage</h2>
|
|
172
|
+
<p>Once installed globally, you can use the CLI command:</p>
|
|
173
|
+
<pre><code class=" p-3 rounded">mwala</code></pre>
|
|
174
|
+
<p>Or check the version:</p>
|
|
175
|
+
<pre><code class=" p-3 rounded">mwala -v</code></pre>
|
|
198
176
|
|
|
199
|
-
|
|
177
|
+
<hr />
|
|
200
178
|
|
|
179
|
+
<h2 class="mt-4">??? CLI Commands</h2>
|
|
180
|
+
<table class="table table-bordered table-striped">
|
|
181
|
+
<thead class="table-primary">
|
|
182
|
+
<tr>
|
|
183
|
+
<th>Command</th>
|
|
184
|
+
<th>Description</th>
|
|
185
|
+
</tr>
|
|
186
|
+
</thead>
|
|
187
|
+
<tbody>
|
|
188
|
+
<tr>
|
|
189
|
+
<td><code>mwala create-project</code></td>
|
|
190
|
+
<td>Create a new project using MwalaJS</td>
|
|
191
|
+
</tr>
|
|
192
|
+
<tr>
|
|
193
|
+
<td><code>npm init </code></td>
|
|
194
|
+
<td>initialization of .json file in the project</td>
|
|
195
|
+
</tr>
|
|
196
|
+
<tr>
|
|
197
|
+
<td><code>mwala serve</code></td>
|
|
198
|
+
<td>Run the project in development mode</td>
|
|
199
|
+
</tr>
|
|
200
|
+
<tr>
|
|
201
|
+
<td><code>mwala help</code></td>
|
|
202
|
+
<td>Display help instructions</td>
|
|
203
|
+
</tr>
|
|
204
|
+
</tbody>
|
|
205
|
+
</table>
|
|
206
|
+
|
|
207
|
+
<hr />
|
|
208
|
+
|
|
209
|
+
<h2 class="mt-4">?? Security Notes</h2>
|
|
210
|
+
<ul>
|
|
211
|
+
<li>Be sure to keep your dependencies updated.</li>
|
|
212
|
+
<li>Sanitize user inputs.</li>
|
|
213
|
+
<li>Run <code>npm audit</code> regularly.</li>
|
|
214
|
+
</ul>
|
|
215
|
+
|
|
216
|
+
<hr />
|
|
217
|
+
|
|
218
|
+
<h2 class="mt-4"> License</h2>
|
|
219
|
+
<p>MIT License © 2025 Hekima Mwala and MwalaJS Team</p>
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
<!-- Download Section -->
|
|
223
|
+
<section class="mt-5">
|
|
224
|
+
<h2 class="text-primary">MwalaJS Release Downloads for all versions below version 1.0.2 download .exe,.zip or .rar in latest versions it is simply run npm install -g mwalajs and npm install mwalajs</h2>
|
|
225
|
+
|
|
226
|
+
<div class="table-responsive">
|
|
227
|
+
<h4 class="text-success">Version 1.0.1 </h4>
|
|
228
|
+
<table class="table table-bordered table-hover">
|
|
229
|
+
<thead>
|
|
230
|
+
<tr>
|
|
231
|
+
<th>File Type</th>
|
|
232
|
+
<th>Description</th>
|
|
233
|
+
<th>Download</th>
|
|
234
|
+
</tr>
|
|
235
|
+
</thead>
|
|
236
|
+
<tbody>
|
|
237
|
+
<tr>
|
|
238
|
+
<td>ZIP</td>
|
|
239
|
+
<td>Latest release ZIP</td>
|
|
240
|
+
<td><a class="btn btn-primary btn-sm" href="https://mwalajs.biasharabora.com/files/mwalajsv101.zip">Download</a></td>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr>
|
|
243
|
+
<td>RAR</td>
|
|
244
|
+
<td>Latest release RAR</td>
|
|
245
|
+
<td><a class="btn btn-primary btn-sm" href="https://mwalajs.biasharabora.com/files/mwalajsv101.rar">Download</a></td>
|
|
246
|
+
</tr>
|
|
247
|
+
</tbody>
|
|
248
|
+
</table>
|
|
249
|
+
|
|
250
|
+
<h4 class="text-secondary mt-4">Version 1.0.0</h4>
|
|
251
|
+
<table class="table table-bordered table-hover">
|
|
252
|
+
<thead>
|
|
253
|
+
<tr>
|
|
254
|
+
<th>File Type</th>
|
|
255
|
+
<th>Description</th>
|
|
256
|
+
<th>Download</th>
|
|
257
|
+
</tr>
|
|
258
|
+
</thead>
|
|
259
|
+
<tbody>
|
|
260
|
+
<tr>
|
|
261
|
+
<td>EXE</td>
|
|
262
|
+
<td>Installer (.exe)</td>
|
|
263
|
+
<td><a class="btn btn-success btn-sm" href="https://mwalajs.biasharabora.com/files/mwalaJS_installer.exe">Download</a></td>
|
|
264
|
+
</tr>
|
|
265
|
+
<tr>
|
|
266
|
+
<td>ZIP</td>
|
|
267
|
+
<td>v1.0.0 ZIP</td>
|
|
268
|
+
<td><a class="btn btn-secondary btn-sm" href="https://mwalajs.biasharabora.com/files/mwalajsm.zip">Download</a></td>
|
|
269
|
+
</tr>
|
|
270
|
+
<tr>
|
|
271
|
+
<td>RAR</td>
|
|
272
|
+
<td>v1.0.0 RAR</td>
|
|
273
|
+
<td><a class="btn btn-secondary btn-sm" href="https://mwalajs.biasharabora.com/files/mwalajsm.rar">Download</a></td>
|
|
274
|
+
</tr>
|
|
275
|
+
</tbody>
|
|
276
|
+
</table>
|
|
277
|
+
</div>
|
|
278
|
+
</section>
|
|
279
|
+
|
|
280
|
+
<!-- WhatsApp Support Box -->
|
|
281
|
+
<div class="whatsapp-box">
|
|
282
|
+
<h5>Join the MwalaJS WhatsApp Support Group</h5>
|
|
283
|
+
<a href="https://chat.whatsapp.com/F8x1p8R1EhZ5b7RX7PO6dR?mode=r_t" target="_blank">Click here to join</a>
|
|
201
284
|
</div>
|
|
202
285
|
</div>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
286
|
+
|
|
287
|
+
<!DOCTYPE html>
|
|
288
|
+
<html lang="en">
|
|
289
|
+
<head>
|
|
290
|
+
<meta charset="UTF-8">
|
|
291
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
292
|
+
<title>MwalaJS Installation Guide</title>
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
</head>
|
|
296
|
+
<body>
|
|
297
|
+
|
|
298
|
+
<h1>MwalaJS Installation Guide</h1>
|
|
299
|
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/Zzj0WnvDET4?si=NsgUZDlF0uRuqe1P" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
|
300
|
+
<p><strong>Version:</strong> Latest<br>
|
|
301
|
+
<strong>Official Website:</strong> <a href="https://mwalajs.biasharabora.com" target="_blank">https://mwalajs.biasharabora.com</a></p>
|
|
302
|
+
|
|
303
|
+
<h2> What You’ll Need</h2>
|
|
304
|
+
<ul>
|
|
305
|
+
<li>A computer (Windows preferred)</li>
|
|
306
|
+
<li>Internet connection</li>
|
|
307
|
+
<li>Basic computer knowledge (copy, paste, extracting files)</li>
|
|
308
|
+
<li><a href="https://nodejs.org" target="_blank">Node.js installed</a></li>
|
|
309
|
+
</ul>
|
|
310
|
+
|
|
311
|
+
<h2> Step-by-Step Installation Instructions</h2>
|
|
312
|
+
|
|
313
|
+
<h3>STEP 1: Download MwalaJS</h3>
|
|
314
|
+
<ol>
|
|
315
|
+
<li>Open your browser and go to: <a href="https://mwalajs.biasharabora.com" target="_blank">https://mwalajs.biasharabora.com</a></li>
|
|
316
|
+
<li>Choose one of the files:
|
|
317
|
+
<ul>
|
|
318
|
+
<li><code>MwalaJS.zip</code></li>
|
|
319
|
+
<li><code>MwalaJS.rar</code></li>
|
|
320
|
+
</ul>
|
|
209
321
|
</li>
|
|
210
|
-
<li
|
|
211
|
-
|
|
322
|
+
<li>Download and save it to your computer (usually goes to your <strong>Downloads</strong> folder).</li>
|
|
323
|
+
</ol>
|
|
324
|
+
|
|
325
|
+
<h3>STEP 2: Extract the Downloaded File</h3>
|
|
326
|
+
<ol>
|
|
327
|
+
<li>Go to your <strong>Downloads</strong> folder.</li>
|
|
328
|
+
<li>Right-click on the downloaded file:
|
|
329
|
+
<ul>
|
|
330
|
+
<li>If ZIP ? choose <strong>Extract All</strong></li>
|
|
331
|
+
<li>If RAR ? open with <strong>WinRAR</strong> or <strong>7-Zip</strong></li>
|
|
332
|
+
</ul>
|
|
212
333
|
</li>
|
|
213
|
-
<li
|
|
214
|
-
|
|
334
|
+
<li>You’ll get a folder named <code>mwalajs</code>. Copy or cut this folder.</li>
|
|
335
|
+
</ol>
|
|
336
|
+
|
|
337
|
+
<h3>STEP 3: Move to Program Files</h3>
|
|
338
|
+
<ol>
|
|
339
|
+
<li>Open <strong>C:\Program Files</strong> on your PC.</li>
|
|
340
|
+
<li>Paste the <code>mwalajs</code> folder inside.</li>
|
|
341
|
+
<li>If asked for administrator permission, click <strong>Continue</strong>.</li>
|
|
342
|
+
</ol>
|
|
343
|
+
|
|
344
|
+
<h3>STEP 4: Add to Environment Variable</h3>
|
|
345
|
+
<div class="note">This step allows you to run <code>mwala</code> command from any terminal window.</div>
|
|
346
|
+
<ol>
|
|
347
|
+
<li>Press <strong>Windows + S</strong>, type <em>environment variables</em>, and click on <strong>Edit the system environment variables</strong>.</li>
|
|
348
|
+
<li>In the new window, click <strong>Environment Variables</strong>.</li>
|
|
349
|
+
<li>Under <strong>System variables</strong>, select <code>Path</code> and click <strong>Edit</strong>.</li>
|
|
350
|
+
<li>Click <strong>New</strong>, then paste the path:
|
|
351
|
+
<pre>C:\Program Files\mwalajs</pre>
|
|
215
352
|
</li>
|
|
216
|
-
<li
|
|
217
|
-
|
|
353
|
+
<li>Click <strong>OK</strong> on all windows to save changes.</li>
|
|
354
|
+
</ol>
|
|
355
|
+
|
|
356
|
+
<h3>STEP 5: Test the Installation</h3>
|
|
357
|
+
<ol>
|
|
358
|
+
<li>Open <strong>Command Prompt</strong> (Windows + R ? type <code>cmd</code> ? Enter).</li>
|
|
359
|
+
<li>Type the following command and press Enter:
|
|
360
|
+
<pre>mwala</pre>
|
|
218
361
|
</li>
|
|
219
|
-
<li
|
|
220
|
-
|
|
362
|
+
<li>If installed correctly, you’ll see a welcome message or command list.</li>
|
|
363
|
+
</ol>
|
|
364
|
+
|
|
365
|
+
<h2> Extra Tips</h2>
|
|
366
|
+
<ul>
|
|
367
|
+
<li>If <code>mwala</code> is not recognized:
|
|
368
|
+
<ul>
|
|
369
|
+
<li>Close and reopen your terminal.</li>
|
|
370
|
+
<li>Double-check that you added the correct path to the environment variable.</li>
|
|
371
|
+
</ul>
|
|
221
372
|
</li>
|
|
373
|
+
<li>Make sure the <code>mwalajs</code> folder contains a file like <code>mwala.mjs</code>.</li>
|
|
374
|
+
<li>Ensure Node.js is installed properly.</li>
|
|
222
375
|
</ul>
|
|
223
|
-
</body>
|
|
224
|
-
</html>
|
|
225
376
|
|
|
377
|
+
<h2>Troubleshooting</h2>
|
|
378
|
+
<table>
|
|
379
|
+
<thead>
|
|
380
|
+
<tr>
|
|
381
|
+
<th>Issue</th>
|
|
382
|
+
<th>Solution</th>
|
|
383
|
+
</tr>
|
|
384
|
+
</thead>
|
|
385
|
+
<tbody>
|
|
386
|
+
<tr>
|
|
387
|
+
<td><code>mwala</code> is not recognized</td>
|
|
388
|
+
<td>Recheck environment path, restart CMD</td>
|
|
389
|
+
</tr>
|
|
390
|
+
<tr>
|
|
391
|
+
<td>File won’t extract</td>
|
|
392
|
+
<td>Install <a href="https://www.7-zip.org" target="_blank">7-Zip</a> or <a href="https://www.rarlab.com" target="_blank">WinRAR</a></td>
|
|
393
|
+
</tr>
|
|
394
|
+
<tr>
|
|
395
|
+
<td>Node.js not found</td>
|
|
396
|
+
<td><a href="https://nodejs.org" target="_blank">Download from Node.js official site</a></td>
|
|
397
|
+
</tr>
|
|
398
|
+
</tbody>
|
|
399
|
+
</table>
|
|
400
|
+
|
|
401
|
+
<h3>LINUX INSTALLATION (Ubuntu / Debian / Fedora / Others)</h3>
|
|
402
|
+
|
|
403
|
+
<div class="note">Make sure Node.js is already installed on your system before you begin.</div>
|
|
404
|
+
|
|
405
|
+
<ol>
|
|
406
|
+
<li><strong>Download MwalaJS:</strong>
|
|
407
|
+
<ul>
|
|
408
|
+
<li>Visit: <a href="https://mwalajs.biasharabora.com" target="_blank">https://mwalajs.biasharabora.com</a></li>
|
|
409
|
+
<li>Select and download either:
|
|
410
|
+
<ul>
|
|
411
|
+
<li><code>MwalaJS.zip</code></li>
|
|
412
|
+
<li><code>MwalaJS.tar.gz</code></li>
|
|
413
|
+
</ul>
|
|
414
|
+
</li>
|
|
415
|
+
</ul>
|
|
416
|
+
</li>
|
|
417
|
+
|
|
418
|
+
<li><strong>Open Terminal and go to the Downloads folder:</strong>
|
|
419
|
+
<pre>cd ~/Downloads</pre>
|
|
420
|
+
</li>
|
|
421
|
+
|
|
422
|
+
<li><strong>Extract the downloaded file:</strong>
|
|
423
|
+
<ul>
|
|
424
|
+
<li>If ZIP:
|
|
425
|
+
<pre>unzip MwalaJS.zip</pre>
|
|
426
|
+
</li>
|
|
427
|
+
<li>If TAR.GZ:
|
|
428
|
+
<pre>tar -xvzf MwalaJS.tar.gz</pre>
|
|
429
|
+
</li>
|
|
430
|
+
</ul>
|
|
431
|
+
</li>
|
|
432
|
+
|
|
433
|
+
<li><strong>Move the extracted folder to a system directory:</strong>
|
|
434
|
+
<pre>sudo mv mwalajs /opt/</pre>
|
|
435
|
+
</li>
|
|
436
|
+
|
|
437
|
+
<li><strong>Make the main file executable (if it's a script):</strong>
|
|
438
|
+
<pre>sudo chmod +x /opt/mwalajs/mwala.mjs</pre>
|
|
439
|
+
</li>
|
|
440
|
+
|
|
441
|
+
<li><strong>Create a system-wide shortcut (symlink):</strong>
|
|
442
|
+
<pre>sudo ln -s /opt/mwalajs/mwala.mjs /usr/local/bin/mwala</pre>
|
|
443
|
+
</li>
|
|
444
|
+
|
|
445
|
+
<li><strong>Test the installation:</strong>
|
|
446
|
+
<pre>mwala</pre>
|
|
447
|
+
<p>If everything is set up correctly, you’ll see a welcome message or command list.</p>
|
|
448
|
+
</li>
|
|
449
|
+
</ol>
|
|
226
450
|
|
|
451
|
+
<h4>Troubleshooting</h4>
|
|
452
|
+
<table>
|
|
453
|
+
<thead>
|
|
454
|
+
<tr><th>Issue</th><th>Solution</th></tr>
|
|
455
|
+
</thead>
|
|
456
|
+
<tbody>
|
|
457
|
+
<tr>
|
|
458
|
+
<td><code>mwala: command not found</code></td>
|
|
459
|
+
<td>Check if the symlink is correct: <code>ls -l /usr/local/bin/mwala</code></td>
|
|
460
|
+
</tr>
|
|
461
|
+
<tr>
|
|
462
|
+
<td>Node.js not installed</td>
|
|
463
|
+
<td>Install Node.js using:
|
|
464
|
+
<pre>sudo apt install nodejs npm</pre>
|
|
465
|
+
</td>
|
|
466
|
+
</tr>
|
|
467
|
+
<tr>
|
|
468
|
+
<td>Permission denied</td>
|
|
469
|
+
<td>Try using <code>sudo</code> or ensure the file has executable permission</td>
|
|
470
|
+
</tr>
|
|
471
|
+
</tbody>
|
|
472
|
+
</table>
|
|
227
473
|
|
|
474
|
+
<footer>
|
|
475
|
+
<h3>Need Help?</h3>
|
|
476
|
+
<p>Feel free to contact the developer or support:</p>
|
|
477
|
+
<ul>
|
|
478
|
+
<li>Email: <a href="mailto:biasharaboraofficials@biasharabora.com">biasharaboraofficials@biasharabora.com</a></li>
|
|
479
|
+
<li>Website: <a href="https://mwalajs.biasharabora.com" target="_blank">https://mwalajs.biasharabora.com</a></li>
|
|
480
|
+
</ul>
|
|
481
|
+
</footer>
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
<!-- Footer -->
|
|
485
|
+
<footer class="text-center">
|
|
486
|
+
<div class="container">
|
|
487
|
+
© 2025 MwalaJS Framework. Built by MwalaJS Development Team.
|
|
488
|
+
</div>
|
|
489
|
+
</footer>
|
|
490
|
+
|
|
491
|
+
<!-- Bootstrap JS -->
|
|
492
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
493
|
+
</body>
|
|
494
|
+
</html>
|