mwalajs 1.0.7 → 1.0.9

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/views/welcome.ejs CHANGED
@@ -1,257 +1,315 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>MwalaJS - High-Performance Framework</title>
7
- <link rel="stylesheet" href="styles.css">
8
- </head>
9
- <body>
10
-
11
1
 
2
+ <!-- include partials/header -->
3
+ <%- include('partials/header') %>
12
4
 
13
5
  <!DOCTYPE html>
14
6
  <html lang="en">
15
7
  <head>
16
8
  <meta charset="UTF-8">
17
- <meta name="viewport" content="width=device-width, initial-scale=1">
18
- <meta name="description" content="MwalaJS - A high-performance JavaScript framework for Node.js and Express based on the V8 engine.">
19
- <meta name="keywords" content="MwalaJS, Node.js, Express, high-performance framework, JavaScript, V8 engine, MVC, migrations">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
+ <meta name="description" content="MwalaJS - High-performance Node.js MVC framework powered by Google V8 engine. Full documentation, installation guides, CLI commands, project structure, and examples.">
11
+ <meta name="keywords" content="MwalaJS, Node.js framework, Express MVC, V8 engine, high-performance JavaScript, migrations, CLI tools, EJS templates">
20
12
  <meta name="author" content="Hekima Ambalile Mwala">
21
-
22
- <title>MwalaJS - Documentation</title>
23
-
24
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
25
- <link rel="icon" href="https://yourwebsite.com/favicon.ico" type="image/x-icon">
13
+ <meta property="og:title" content="MwalaJS - High-Performance Web Framework">
14
+ <meta property="og:description" content="Powerful, scalable Node.js framework with MVC architecture, database migrations, code generation, and modern ES modules support.">
15
+ <meta property="og:url" content="https://mwalajs.biasharabora.com">
16
+ <meta property="og:image" content="https://mwalajs.biasharabora.com/images/mwala-logo.png">
17
+
18
+ <title>MwalaJS - High-Performance Framework Documentation</title>
19
+
20
+ <!-- Bootstrap 5 -->
21
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
22
+ <!-- Font Awesome Icons -->
23
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
26
24
 
27
25
  <style>
26
+ :root {
27
+ --primary-gradient: linear-gradient(135deg, #1e3c72, #2a5298);
28
+ --accent-blue: #1e3c72;
29
+ --text-light: #f8f9fa;
30
+ --card-bg: #ffffff;
31
+ }
32
+
28
33
  body {
34
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
29
35
  background-color: #f4f4f4;
30
- font-family: Arial, sans-serif;
36
+ line-height: 1.7;
31
37
  }
32
38
 
33
39
  .navbar {
34
- background-color: #1e3c72;
40
+ background: var(--primary-gradient) !important;
41
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
35
42
  }
36
43
 
37
- .navbar-brand, .nav-link {
44
+ .nav-link, .navbar-brand {
38
45
  color: white !important;
46
+ font-weight: 500;
47
+ transition: color 0.3s ease;
39
48
  }
40
49
 
41
- .header-section {
42
- background: linear-gradient(135deg, #1e3c72, #2a5298);
43
- color: white;
44
- padding: 50px 0;
50
+ .nav-link:hover {
51
+ color: #ffd700 !important;
52
+ }
53
+
54
+ .hero-header {
55
+ background: var(--primary-gradient);
56
+ color: var(--text-light);
57
+ padding: 80px 0;
45
58
  text-align: center;
59
+ clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
46
60
  }
47
61
 
48
- .header-section h1 {
49
- font-size: 36px;
50
- font-weight: bold;
62
+ .hero-header h1 {
63
+ font-size: 3.5rem;
64
+ font-weight: 800;
65
+ margin-bottom: 1rem;
51
66
  }
52
67
 
53
- .content-section {
54
- padding: 30px;
55
- background-color: #ffffff;
56
- border-radius: 10px;
57
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
58
- margin: 20px;
68
+ .hero-header p {
69
+ font-size: 1.3rem;
70
+ max-width: 800px;
71
+ margin: 0 auto;
72
+ }
73
+
74
+ .section-card {
75
+ background: var(--card-bg);
76
+ border-radius: 12px;
77
+ padding: 2.5rem;
78
+ margin-bottom: 2.5rem;
79
+ box-shadow: 0 6px 20px rgba(0,0,0,0.1);
80
+ transition: transform 0.3s ease;
81
+ }
82
+
83
+ .section-card:hover {
84
+ transform: translateY(-8px);
59
85
  }
60
86
 
61
87
  pre {
62
- background-color: #2d2d2d;
88
+ background: #2d2d2d;
63
89
  color: #f4f4f4;
64
- padding: 15px;
65
- border-radius: 8px;
90
+ padding: 1.5rem;
91
+ border-radius: 10px;
66
92
  overflow-x: auto;
93
+ font-size: 0.95rem;
94
+ border-left: 5px solid #2a5298;
95
+ }
96
+
97
+ .structure-tree {
98
+ background: #f8f9fa;
99
+ padding: 1.5rem;
100
+ border-radius: 10px;
101
+ font-family: 'Courier New', monospace;
102
+ white-space: pre;
67
103
  }
68
104
 
69
- .footer {
105
+ .feature-icon {
106
+ font-size: 2.5rem;
107
+ color: #2a5298;
108
+ margin-bottom: 1rem;
109
+ }
110
+
111
+ .download-btn {
112
+ font-size: 1.1rem;
113
+ padding: 0.8rem 1.5rem;
114
+ margin: 0.5rem;
115
+ }
116
+
117
+ footer {
118
+ background: var(--primary-gradient);
119
+ color: var(--text-light);
120
+ padding: 3rem 0;
70
121
  text-align: center;
71
- padding: 20px;
72
- background-color: #1e3c72;
73
- color: white;
74
- margin-top: 20px;
122
+ margin-top: 4rem;
75
123
  }
76
124
 
77
- /* Responsive adjustments */
78
125
  @media (max-width: 768px) {
79
- .header-section h1 {
80
- font-size: 28px;
81
- }
126
+ .hero-header h1 { font-size: 2.5rem; }
127
+ .hero-header p { font-size: 1.1rem; }
128
+ pre { font-size: 0.85rem; }
82
129
  }
83
130
  </style>
84
131
  </head>
85
132
  <body>
86
133
 
87
134
  <!-- Navbar -->
88
- <nav class="navbar navbar-expand-lg navbar-dark">
135
+ <!-- <nav class="navbar navbar-expand-lg navbar-dark sticky-top">
89
136
  <div class="container">
90
- <a class="navbar-brand" href="/">MwalaJS</a>
137
+ <a class="navbar-brand fw-bold" href="/"><i class="fas fa-rocket me-2"></i>MwalaJS</a>
91
138
  <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
92
139
  <span class="navbar-toggler-icon"></span>
93
140
  </button>
94
141
  <div class="collapse navbar-collapse" id="navbarNav">
95
142
  <ul class="navbar-nav ms-auto">
96
143
  <li class="nav-item"><a class="nav-link" href="#overview">Overview</a></li>
144
+ <li class="nav-item"><a class="nav-link" href="#features">Features</a></li>
97
145
  <li class="nav-item"><a class="nav-link" href="#installation">Installation</a></li>
98
- <li class="nav-item"><a class="nav-link" href="#commands">Commands</a></li>
99
- <li class="nav-item"><a class="nav-link" href="#structure">Project Structure</a></li>
146
+ <li class="nav-item"><a class="nav-link" href="#downloads">Downloads</a></li>
147
+ <li class="nav-item"><a class="nav-link" href="#structure">Structure</a></li>
100
148
  <li class="nav-item"><a class="nav-link" href="#example">Example</a></li>
101
- <li class="nav-item"><a class="nav-link" href="#conclusion">Conclusion</a></li>
102
149
  </ul>
103
150
  </div>
104
151
  </div>
105
- </nav>
152
+ </nav> -->
106
153
 
107
- <!-- Header Section -->
108
- <section class="header-section">
154
+ <!-- Hero Header -->
155
+ <section class="hero-header">
109
156
  <div class="container">
110
- <h1>Welcome to MwalaJS Documentation</h1>
111
- <p>A high-performance framework for JavaScript, Node.js, and Express.</p>
157
+ <h1>MwalaJS - High-Performance Web Framework</h1>
158
+ <p>A powerful, efficient, and scalable Node.js MVC framework powered by the <strong>Google V8 Engine</strong>.</p>
159
+ <p class="mt-4">Build lightning-fast, modern web applications with ease.</p>
112
160
  </div>
113
161
  </section>
114
162
 
115
- <!-- Content Sections -->
116
- <div class="container">
117
- <div class="content-section" id="overview">
118
- <h2>Overview of MwalaJS</h2>
119
- <p>MwalaJS is an advanced web development framework that uses the **Google V8 engine** to enhance the performance of JavaScript applications.</p>
120
- </div>
163
+ <div class="container my-5">
121
164
 
122
- <div class="content-section" id="installation">
123
- <h2>Installation</h2>
124
- <p>To install MwalaJS, use the following command:</p>
125
- <pre><code class="command">npm install -g mwalajs</code></pre>
126
- </div>
165
+ <!-- Overview -->
166
+ <section id="overview" class="section-card">
167
+ <h2 class="text-center mb-4"><i class="fas fa-eye feature-icon"></i><br>Overview of MwalaJS</h2>
168
+ <p>MwalaJS is a cutting-edge, high-performance framework for <strong>JavaScript, Node.js, and Express</strong>. Leveraging the full power of the <strong>Google V8 engine</strong>, it delivers exceptional speed, scalability, and developer productivity.</p>
169
+ <p>Designed with modern development practices in mind, MwalaJS combines the simplicity of Express with advanced features like MVC architecture, database migrations, code generation, and full ES module support.</p>
170
+ </section>
127
171
 
128
- <div class="content-section" id="commands">
129
- <h2>Basic Commands</h2>
130
- <p>Here are some useful MwalaJS commands:</p>
131
- <pre><code class="command">
132
- # Create a new project
133
- mwala new project_name
172
+ <!-- Core Features -->
173
+ <section id="features" class="section-card">
174
+ <h2 class="text-center mb-4"><i class="fas fa-star feature-icon"></i><br>Core Features</h2>
175
+ <div class="row">
176
+ <div class="col-md-6">
177
+ <ul class="list-group list-group-flush">
178
+ <li class="list-group-item"><strong>Ultra-High Performance</strong>: Powered by Google V8 for rapid JavaScript execution</li>
179
+ <li class="list-group-item"><strong>Modern ES Modules</strong>: Full support for .mjs and cleaner modular code</li>
180
+ <li class="list-group-item"><strong>Advanced Migrations</strong>: Laravel/Django-style database schema management</li>
181
+ <li class="list-group-item"><strong>MVC Architecture</strong>: Clean separation of concerns</li>
182
+ </ul>
183
+ </div>
184
+ <div class="col-md-6">
185
+ <ul class="list-group list-group-flush">
186
+ <li class="list-group-item"><strong>Express Integration</strong>: Enhanced routing and middleware system</li>
187
+ <li class="list-group-item"><strong>Cross-Platform</strong>: Windows, macOS, Linux compatible</li>
188
+ <li class="list-group-item"><strong>Built-in Security</strong>: Protection against common web vulnerabilities</li>
189
+ <li class="list-group-item"><strong>Open Source</strong>: Community-driven with regular updates</li>
190
+ </ul>
191
+ </div>
192
+ </div>
193
+ </section>
134
194
 
135
- # Start the development server
136
- mwala serve
195
+ <!-- Why Choose MwalaJS -->
196
+ <section class="section-card">
197
+ <h2 class="text-center mb-4"><i class="fas fa-trophy feature-icon"></i><br>Why Choose MwalaJS?</h2>
198
+ <div class="row text-center">
199
+ <div class="col-md-4">
200
+ <i class="fas fa-bolt fa-3x text-warning mb-3"></i>
201
+ <h5>Blazing Speed</h5>
202
+ <p>V8 engine optimization for lightning-fast performance</p>
203
+ </div>
204
+ <div class="col-md-4">
205
+ <i class="fas fa-layer-group fa-3x text-info mb-3"></i>
206
+ <h5>Scalability</h5>
207
+ <p>From startups to enterprise-grade applications</p>
208
+ </div>
209
+ <div class="col-md-4">
210
+ <i class="fas fa-tools fa-3x text-success mb-3"></i>
211
+ <h5>Rapid Development</h5>
212
+ <p>CLI tools, scaffolding, and migrations accelerate workflow</p>
213
+ </div>
214
+ </div>
215
+ </section>
137
216
 
138
- # Run migrations
139
- mwala migrate
140
- </code></pre>
141
- </div>
217
+ <!-- Installation & Downloads -->
218
+ <section id="installation" class="section-card">
219
+ <h2 class="text-center mb-4"><i class="fas fa-download feature-icon"></i><br>Getting Started</h2>
220
+ <p class="lead text-center">Recommended for latest versions (≥1.0.4): Install via NPM</p>
221
+ <pre><code>npm install -g mwalajs</code></pre>
142
222
 
143
- <div class="content-section" id="structure">
144
- <h2>Project Structure</h2>
145
- <pre><code>
146
- /project_name
147
- ├── controllers/
148
- ├── models/
149
- ├── views/
150
- ├── routes/
151
- ├── public/
152
- ├── config/
153
- ├── index.js
154
- </code></pre>
155
- </div>
223
+ <h3 id="downloads" class="mt-5 text-center">Version Releases & Downloads</h3>
224
+ <p class="text-center">For older versions or offline installation:</p>
225
+ <div class="text-center">
226
+ <a href="https://mwalajs.biasharabora.com/files/mwalaJS_installer.exe" class="btn btn-success download-btn">
227
+ <i class="fas fa-file-archive"></i> Download .exe Installer
228
+ </a>
229
+ <a href="https://mwalajs.biasharabora.com/files/mwalajsm.zip" class="btn btn-primary download-btn">
230
+ <i class="fas fa-file-zipper"></i> Download .zip (v1.0.0)
231
+ </a>
232
+ <a href="https://mwalajs.biasharabora.com/files/mwalajsm.rar" class="btn btn-info download-btn">
233
+ <i class="fas fa-file-archive"></i> Download .rar (v1.0.0)
234
+ </a>
235
+ </div>
236
+ </section>
237
+
238
+ <!-- Project Structure -->
239
+ <section id="structure" class="section-card">
240
+ <h2 class="text-center mb-4"><i class="fas fa-folder-tree feature-icon"></i><br>Project Structure</h2>
241
+ <p>Main entry point: <code>app.mjs</code> (required). Other files support both <code>.mjs</code> and <code>.js</code>.</p>
242
+
243
+ <div class="structure-tree">
244
+ <pre><code></code>
245
+ mwalajs-project/
246
+ ├── app.mjs # Main application entry (must be .mjs)
247
+ ├── migrations/ # Database migration files
248
+ ├── models/ # Data models (.js or .mjs)
249
+ ├── controllers/ # Business logic (.js or .mjs)
250
+ ├── routes/ # Route definitions (.js or .mjs)
251
+ ├── middlewares/ # Custom middleware
252
+ ├── config/ # Configuration files
253
+ ├── public/ # Static assets (CSS, JS, images)
254
+ │ ├── css/
255
+ │ ├── js/
256
+ │ └── images/
257
+ ├── views/ # EJS templates
258
+ ├── package.json
259
+ └── README.md
260
+ </code></pre>
261
+ </div>
262
+ </section>
156
263
 
157
- <div class="content-section" id="example">
158
- <h2>Example Application</h2>
159
- <p>Below is a simple **Hello World** example using MwalaJS:</p>
160
- <pre><code>
161
- const Mwala = require('mwalajs');
162
- const app = new Mwala();
264
+ <!-- Example Application -->
265
+ <section id="example" class="section-card">
266
+ <h2 class="text-center mb-4"><i class="fas fa-code feature-icon"></i><br>Example Application</h2>
267
+ <p>A simple "Hello World" using MwalaJS:</p>
268
+ <pre><code>// app.mjs
269
+ import mwalajs from 'mwalajs';
270
+ import path from 'path';
271
+ import { fileURLToPath } from 'url';
163
272
 
164
- app.get('/', (req, res) => {
165
- res.send('Hello, World!');
273
+ const __filename = fileURLToPath(import.meta.url);
274
+ const __dirname = path.dirname(__filename);
275
+
276
+ mwalajs.set('view engine', 'ejs');
277
+ mwalajs.set('views', path.join(__dirname, 'views'));
278
+ mwalajs.useStatic(path.join(__dirname, 'public'));
279
+
280
+ mwalajs.get('/', (req, res) => {
281
+ res.render('index', { message: 'Hello from MwalaJS!' });
166
282
  });
167
283
 
168
- app.listen(3000, () => console.log('Server running on port 3000'));
169
- </code></pre>
170
- </div>
284
+ mwalajs.listen(3000, () => {
285
+ console.log('Server running on http://localhost:3000');
286
+ });</code></pre>
287
+ </section>
288
+
289
+ <!-- Conclusion -->
290
+ <section class="section-card">
291
+ <h2 class="text-center mb-4"><i class="fas fa-flag-checkered feature-icon"></i><br>Conclusion</h2>
292
+ <p class="lead text-center">MwalaJS represents the future of high-performance web development.</p>
293
+ <p>With unmatched speed from the V8 engine, modern tooling, robust MVC structure, and developer-friendly features, MwalaJS empowers you to build anything from simple APIs to complex enterprise systems.</p>
294
+ <p class="text-center mt-4"><strong>Start building the future today with MwalaJS! 🚀</strong></p>
295
+ </section>
171
296
 
172
- <div class="content-section" id="conclusion">
173
- <h2>Conclusion</h2>
174
- <p>MwalaJS is a powerful, high-performance framework that simplifies web development with Node.js and Express. Whether you're building small apps or enterprise solutions, MwalaJS provides scalability and efficiency.</p>
175
- </div>
176
297
  </div>
177
298
 
299
+ <!-- Footer
300
+ <footer>
301
+ <div class="container">
302
+ <p class="mb-0"> MwalaJS Framework | Built with ❤️ by <strong>Hekima Ambalile Mwala</strong></p>
303
+ <p class="mt-2">
304
+ <a href="https://mwalajs.biasharabora.com" class="text-white">Official Website</a> |
305
+ <a href="https://github.com/mwala400/mwalajs" class="text-white">GitHub Repository</a>
306
+ </p>
307
+ </div>
308
+ </footer> -->
178
309
 
179
-
180
-
181
- <section>
182
- <h1>MwalaJS - High-Performance Web Framework</h1>
183
- <p>A powerful, efficient, and scalable framework built on the Google <strong>V8 Engine</strong>.</p>
184
- </section>
185
-
186
- <section class="overview">
187
- <h2>🚀 Overview of MwalaJS</h2>
188
- <p>MwalaJS is a high-speed framework designed for <strong>JavaScript, Node.js, and Express</strong>.
189
- With its integration of the <strong>Google V8 engine</strong>, it ensures your applications run efficiently,
190
- making web development <em>faster, smoother, and more scalable</em>.</p>
191
- </section>
192
-
193
- <section class="features">
194
- <h2> Core Features of MwalaJS</h2>
195
- <ul>
196
- <li><strong> High Performance:</strong> Uses the <em>Google V8 engine</em> for rapid execution.</li>
197
- <li><strong> ES6 & .mjs Support:</strong> Cleaner, modular JavaScript code.</li>
198
- <li><strong> Full Database Migrations:</strong> Inspired by Laravel & Django for seamless schema updates.</li>
199
- <li><strong> MVC Architecture:</strong> Organized application structure.</li>
200
- <li><strong> Node.js & Express Integration:</strong> Enhanced backend functionalities.</li>
201
- <li><strong> Cross-Platform Compatibility:</strong> Runs on Windows, macOS, and Linux.</li>
202
- <li><strong> Security:</strong> Built-in measures to safeguard applications.</li>
203
- <li><strong> Open Source & Community Driven:</strong> Regular updates and contributions.</li>
204
- </ul>
205
- </section>
206
-
207
- <section class="why-mwala">
208
- <h2> Why Choose MwalaJS?</h2>
209
- <ul>
210
- <li><strong> Speed:</strong> Powered by V8 for lightning-fast performance.</li>
211
- <li><strong> Efficiency:</strong> Optimized for maintainability and scalability.</li>
212
- <li><strong> Scalability:</strong> From small apps to enterprise-level projects.</li>
213
- <li><strong> Rapid Development:</strong> Built-in support for migrations, MVC, and modern JS features.</li>
214
- <li><strong> Developer-Friendly:</strong> Minimal setup, easy-to-follow documentation.</li>
215
- </ul>
216
- </section>
217
-
218
- <section class="getting-started">
219
- <h2>🛠 Getting Started with MwalaJS</h2>
220
- <p>Follow these steps to start using MwalaJS:</p>
221
-
222
- <h3> Step 1: Download the Setup</h3>
223
-
224
- <section id="release">
225
- <br> <h2 class="section-title">1. VERSION RELEASE</h2>
226
- <p>Click below to download the installer For Mwalajs framework:</p>
227
- <br><a class="btn" href="https://mwalajs.biasharabora.com/files/mwalaJS_installer.exe" download>Download MwalaJS COMMAND SHELL (CLS) download .exe file here </a>
228
- <br> <p>Click below to download zip file mwalajs framework:</p>
229
- <br> <a class="btn" href="https://mwalajs.biasharabora.com/files/mwalajsm.zip" download>Download MwalaJS mwalajs.zip v1.0.0</a>
230
- <br> <p>Click below to download rar file mwalajs framework :</p>
231
- <br> <a class="btn" href="https://mwalajs.biasharabora.com/files/mwalajsm.rar" download>Download MwalaJS mwalajs.rar v1.0.0</a>
232
-
233
- <br>
234
- </section>
235
-
236
- <h3> Step 2: Set Up Your Environment</h3>
237
- <p>Follow the on-screen instructions to complete the installation. MwalaJS is compatible with all major operating systems.</p>
238
-
239
- <h3> Step 3: Read the Documentation</h3>
240
- <p>Visit our <a href="#">official documentation</a> to explore features, tutorials, and guides.</p>
241
- </section>
242
-
243
- <section class="conclusion">
244
- <h2> Conclusion</h2>
245
- <p>MwalaJS is a game-changer in modern web development. Whether you're building small web applications or enterprise systems, MwalaJS offers unmatched performance, security, and scalability. <br><br>
246
- Start building the future of web development today! 🚀</p>
247
- </section>
248
-
249
-
250
- <!-- Footer -->
251
- <footer class="footer">
252
- <p>&copy; 2025 MwalaJS | Built with by Hekima Ambalile Mwala</p>
253
- </footer>
254
-
255
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
310
+ <!-- Bootstrap JS -->
311
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
256
312
  </body>
257
313
  </html>
314
+
315
+ <%- include('partials/footer') %>