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.
package/ujasi/README.md DELETED
@@ -1,542 +0,0 @@
1
- Here's a list of all useful commands for MwalaJS:
2
-
3
- General Commands:
4
- mwala -v or mwala --version → Show the MwalaJS version.
5
- mwala help → Show all available commands and their descriptions.
6
- Project Management:
7
- mwala create-project → Create a new MwalaJS project.
8
- mwala init → Initialize MwalaJS in the current project.
9
- Running the Application:
10
- mwala serve or mwala app.mjs → Start the MwalaJS application.
11
- Database Operations:
12
- mwala create-db → Create the database specified in the .env file.
13
- mwala create-table <table_name> → Create a specific database table.
14
- mwala drop-table <table_name> → Drop a specific database table.
15
- mwala migrate all → Run all pending migrations.
16
- Code Generation:
17
- mwala generate model <name> → Create a new model.
18
- mwala generate controller <name> → Create a new controller.
19
- mwala generate route <name> → Create a new route.
20
- mwala generate view <name> → Create a new view file.
21
- mwala generate midware <name> → Create a new middleware.
22
- This list ensures you can efficiently manage your MwalaJS project, handle databases, and generate key components. Would you like to add a mwala help command to display this list in the CLI?
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
- # mwalajs
31
- # MwalaJS - The Next Evolution in Web Development
32
-
33
- ## Introduction
34
- MwalaJS is a powerful and modern JavaScript framework designed to simplify web application development while offering high performance, scalability, and flexibility. Unlike traditional frameworks, MwalaJS introduces a new way of handling routing, state management, and database interactions.
35
-
36
- ## Why Choose MwalaJS?
37
- ### High Performance
38
- - Optimized for speed and efficiency
39
- - Minimal memory usage
40
- - Faster execution compared to traditional frameworks
41
-
42
- ### Simplicity & Flexibility
43
- - Easy to learn and use
44
- - Clean and modular code structure
45
- - Supports both small-scale and enterprise-level applications
46
-
47
- ### Built-In Features
48
- - Automatic API routing
49
- - Integrated database management
50
- - Scalable real-time processing
51
- - Simple yet powerful templating engine
52
-
53
- ## Getting Started
54
-
55
- ### Installation
56
- To install MwalaJS, use the following command:
57
- ```sh
58
- npm install -g mwalajs
59
- ```
60
-
61
- ### Creating a New Project
62
- To create a new MwalaJS project, run:
63
- ```sh
64
- mwala create-project myApp
65
- cd myApp
66
- npm install
67
- ```
68
-
69
- ### Running the Application
70
- Start the development server with:
71
- ```sh
72
- mwala serve
73
- ```
74
-
75
- ## Example Application
76
-
77
- ### app.mjs
78
- Here is an example of the default `app.mjs` file for starting the server:
79
-
80
- ```javascript
81
- import mwalajs from 'mwalajs';
82
- import { homeRoutes } from './routes/homeRoutes.mjs';
83
- import { fileURLToPath } from 'url';
84
- import path from 'path';
85
-
86
- const __filename = fileURLToPath(import.meta.url);
87
- const __dirname = path.dirname(__filename);
88
-
89
- mwalajs.set('view engine', 'ejs');
90
- mwalajs.set('views', path.join(__dirname, 'views'));
91
-
92
- mwalajs.static(path.join(__dirname, 'public'));
93
-
94
- mwalajs.use('/', homeRoutes);
95
-
96
- const port = process.env.PORT || 3000;
97
- mwalajs.listen(port, () => {
98
- console.log(`Server running on http://localhost:${port}`);
99
- });
100
- ```
101
-
102
- ### homeRoutes.mjs
103
- Here is an example of the default `homeRoutes.mjs` file:
104
-
105
- ```javascript
106
- import mwalajs from 'mwalajs';
107
- import { homeController, Steps, welcome, about } from '../controllers/homeController.mjs';
108
-
109
- const router = mwalajs.constructor.Router();
110
-
111
- router.get('/', homeController.getHomePage);
112
- router.get('/steps', Steps.getSteps);
113
- router.get('/welcome', welcome.getwelcome);
114
- router.get('/about', about.getabout);
115
-
116
- export { router as homeRoutes };
117
- ```
118
-
119
- ### homeController.mjs
120
- Here is an example of the default `homeController.mjs` file:
121
-
122
- ```javascript
123
- export const homeController = {
124
- getHomePage: (req, res) => {
125
- res.render('index', { title: 'Welcome to MwalaJS MVC' });
126
- }
127
- };
128
-
129
- export const Steps = {
130
- getSteps: (req, res) => {
131
- res.render('steps', { title: 'Welcome to MwalaJS MVC' });
132
- }
133
- };
134
-
135
- export const welcome = {
136
- getwelcome: (req, res) => {
137
- res.render('welcome', { title: 'Welcome to MwalaJS MVC' });
138
- }
139
- };
140
-
141
- export const about = {
142
- getabout: (req, res) => {
143
- res.render('about', { title: 'Welcome to MwalaJS MVC' });
144
- }
145
- };
146
- ```
147
-
148
- ## Summary
149
-
150
- ### MwalaJS CLI - List of Commands:
151
-
152
- #### General Commands:
153
- - `mwala -v` | `mwala --version` → Show the MwalaJS version.
154
- - `mwala help` | `mwala h` → Show this help message.
155
-
156
- #### Project Management:
157
- - `mwala create-project <name>` → Create a new MwalaJS project.
158
- - `mwala init` → Initialize MwalaJS in the current project.
159
-
160
- #### Running the Application:
161
- - `mwala serve` | `mwala app.mjs` → Start the MwalaJS application.
162
-
163
- #### Database Operations:
164
- - `mwala create-db` → Create the database specified in the `.env` file.
165
- - `mwala create-table <name>` → Create a specific database table.
166
- - `mwala drop-table <name>` → Drop a specific database table.
167
- - `mwala migrate all` → Run all pending migrations.
168
- - `mwala rollback all` → Undo migration.
169
-
170
- #### Code Generation:
171
- - `mwala generate model <name>` → Create a new model.
172
- - `mwala generate controll
173
- MwalaJS
174
- Overview
175
- Installation
176
- Commands
177
- Project Structure
178
- Example Application
179
- Conclusion
180
- MwalaJS - Complete Documentation
181
- Welcome to MwalaJS! This guide will help you install, configure, and use MwalaJS efficiently.
182
-
183
- 1. Installation
184
- You can install MwalaJS in multiple ways:
185
-
186
- Using GitHub Repository
187
- Clone the repository from GitHub:
188
-
189
- git clone https://github.com/mwala400/mwalajs.git
190
-
191
- Using a ZIP, EXE, or RAR File
192
- Download and extract the files from the available compressed format:
193
-
194
- ZIP: Extract using WinRAR or 7-Zip.
195
- RAR: Extract using WinRAR.
196
- EXE: Run the installer and follow the instructions.
197
-
198
- 1. VERSION RELEASE
199
- Click below to download the installer For Mwalajs framework:
200
-
201
-
202
-
203
- Click below to download zip file mwalajs framework:
204
-
205
-
206
-
207
- Click below to download rar file mwalajs framework :
208
-
209
-
210
-
211
- 2. Setting Up MwalaJS
212
- Initialize MwalaJS
213
- mwala init
214
- Creating a New Project
215
- mwala create-project
216
- 3. Running the Application
217
- mwala serve
218
- 4. Database Operations
219
- Creating a Database
220
- mwala create-db
221
- Creating a Table
222
- mwala create-table <table_name>
223
- Dropping a Table
224
- mwala drop-table <table_name>
225
- 5. Code Generation
226
- mwala generate model <name>
227
- mwala generate controller <name>
228
- mwala generate route <name>
229
- mwala generate view <name>
230
- mwala generate midware <name>
231
-
232
- 6. Additional Information
233
- For more details, visit: GitHub Repository
234
-
235
- MwalaJS Framework Documentation
236
- A lightweight, easy-to-use Node.js framework to create scalable web applications with MVC architecture and powerful built-in features.
237
-
238
- GitHub Repository: https://github.com/mwala400/mwalajs
239
-
240
- 1. Overview
241
- 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.
242
-
243
- Download Documentation
244
-
245
- 1. VERSION RELEASE
246
- Click below to download the installer For Mwalajs framework:
247
-
248
-
249
-
250
- Click below to download zip file mwalajs framework:
251
-
252
-
253
-
254
- Click below to download rar file mwalajs framework :
255
-
256
-
257
- git clone https://github.com/mwala400/mwalajs.git
258
-
259
-
260
-
261
- Key Features:
262
- MVC Architecture: Automatically generates models, controllers, routes, and views.
263
- Database Management: Includes commands to create and drop tables, run migrations, and manage the database.
264
- Middleware Support: Add custom middleware to handle requests.
265
- EJS Template Engine: Integrated for view rendering.
266
- Static File Support: Easily serve static assets like CSS, JavaScript, and images.
267
- MwalaJS Docs
268
- Examples
269
- Conclusion
270
- . Example Application
271
- app.mjs
272
- Here is an example of the default app.mjs file for starting the server:
273
-
274
-
275
- import mwalajs from 'mwalajs';
276
- import { homeRoutes } from './routes/homeRoutes.mjs';
277
- import { fileURLToPath } from 'url';
278
- import path from 'path';
279
-
280
- const __filename = fileURLToPath(import.meta.url);
281
- const __dirname = path.dirname(__filename);
282
-
283
- mwalajs.set('view engine', 'ejs');
284
- mwalajs.set('views', path.join(__dirname, 'views'));
285
-
286
- mwalajs.static(path.join(__dirname, 'public'));
287
-
288
- mwalajs.use('/', homeRoutes);
289
-
290
- const port = process.env.PORT || 3000;
291
- mwalajs.listen(port, () => {
292
- console.log(`Server running on http://localhost:${port}`);
293
- });
294
-
295
- homeRoutes.mjs
296
- Here is an example of the default homeRoutes.mjs file:
297
-
298
-
299
- import mwalajs from 'mwalajs';
300
- import { homeController, Steps, welcome, about } from '../controllers/homeController.mjs';
301
-
302
- const router = mwalajs.constructor.Router();
303
-
304
- router.get('/', homeController.getHomePage);
305
- router.get('/steps', Steps.getSteps);
306
- router.get('/welcome', welcome.getwelcome);
307
- router.get('/about', about.getabout);
308
-
309
- export { router as homeRoutes };
310
-
311
- homeController.mjs
312
- Here is an example of the homeController.mjs file:
313
-
314
-
315
- export const homeController = {
316
- getHomePage: (req, res) => {
317
- res.render('index', { title: 'Welcome to MwalaJS MVC' });
318
- }
319
- };
320
-
321
- export const Steps = {
322
- getSteps: (req, res) => {
323
- res.render('steps', { title: 'Steps in MwalaJS MVC' });
324
- }
325
- };
326
-
327
- export const welcome = {
328
- getwelcome: (req, res) => {
329
- res.render('welcome', { title: 'Welcome to MwalaJS MVC' });
330
- }
331
- };
332
-
333
- export const about = {
334
- getabout: (req, res) => {
335
- res.render('about', { title: 'About MwalaJS MVC' });
336
- }
337
- };
338
-
339
- 6. Conclusion
340
- 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.
341
-
342
- For full documentation and to contribute, visit the GitHub repository.
343
-
344
- Summary of MwalaJS Commands
345
- General Commands:
346
- - mwala -v | mwala --version → Show MwalaJS version.
347
- - mwala help | mwala h → Show help message.
348
- Project Management:
349
- - mwala create-project → Create a new project.
350
- - mwala init → Initialize MwalaJS.
351
-
352
- Running the Application:
353
- - mwala serve | mwala app.mjs → Start MwalaJS app.
354
-
355
- 🔹 Database Operations:
356
- - mwala create-db → Create database from .env file.
357
- - mwala migrate all → Run all pending migrations.
358
- - mwala rollback all → Undo migration.
359
-
360
- 🔹 Code Generation:
361
- - mwala generate model → Create a model.
362
- - mwala generate controller → Create a controller.
363
- - mwala generate route → Create a route.
364
- - mwala generate view → Create a view.
365
-
366
- 🔹 To execute a command, use:
367
- mwala
368
-
369
- mwalajsm/ # Root directory
370
- mwalajsm/ # Root directory
371
- │── app.mjs # Main application file
372
- │── runMigrations.mjs # Handles database migrations
373
- │── createProject.mjs # Script for creating new projects
374
- │── setupMwalajs.mjs # Setup script for MwalaJS
375
- │── start.bat # Batch script to start the server
376
- │── setup.bat # Batch script for installation
377
- │── setup.bash # Bash script for installation (Linux/macOS)
378
- │── setup.sh # Another installation script
379
- │── package.json # Dependencies and project metadata
380
- │── package-lock.json # Dependency lock file
381
- │── README.md # Documentation for MwalaJS
382
- │── migrations/ # Database migration files
383
- │── models/ # Database models
384
- │── controllers/ # Handles application logic
385
- │── routes/ # Defines API routes
386
- │── middlewares/ # Custom middleware for authentication, logging, etc.
387
- │── config/ # Configuration files (e.g., database, app settings)
388
- │── public/ # Static assets like CSS, JavaScript, and images
389
- │── views/ # Template views (if using server-side rendering)
390
- │── mwalajs/ # Core framework files
391
- │── dist/ # Compiled or built files
392
- │── node_modules/ # Dependencies installed via npm
393
- │── YOUR CREATED PROJECT/ # When run mwala create-project will request project name related files (clarify purpose)
394
- │── installer/ # Installation-related files
395
- │── installerimg.png # Image used during installation
396
- │── mwalajs5.png # Framework branding/image
397
- │── mwalajs4_RXv_icon.ico # Framework icons
398
- │── mwalajs4_lyh_icon.ico # Another framework icon
399
- │── mwalajsm.iss # Installer script for Windows
400
- │── background.bmp # Background image (possibly for setup UI)
401
- │── background.png # Another background image
402
- │── bin/ # Executable files or scripts
403
- This structure makes MwalaJS a well-organized and scalable framework. To make it even more convincing, you could add:
404
-
405
- A "tests/" folder – To show built-in support for unit and integration tests.
406
- A "docs/" folder – Dedicated to documentation with detailed guides.
407
- A "scripts/" folder – For automation scripts instead of having them in the root directory.
408
- A "logs/" folder – To store logs instead of scattering them.
409
-
410
-
411
- ```
412
- ## Getting Started
413
- ### Installation
414
- 1. **Install MwalaJS globally:**
415
- ```sh
416
- npm install -g mwalajs
417
- ```
418
- OR Run
419
- mwala init
420
- 2. **Create a new project:**
421
- ```sh
422
- mwalajs create-project
423
- will request project name example myApp
424
- cd myApp
425
- npm install
426
- ```
427
- mwala init
428
-
429
- 3. **Run the development server:**
430
- ```sh
431
- mwala serve
432
- OR
433
- mwala app.mjs
434
- OR
435
- pm2 start app.mjs
436
- OR
437
- node app.mjs
438
- OR RUN
439
- npm start
440
- ```
441
-
442
- ## Sample Code
443
- A simple MwalaJS route example:
444
- Your MwalaJS file structure is well-organized, but to make it more convincing for developers to switch, consider:
445
-
446
- 1. Clean File Structure Explanation
447
- Here’s a structured breakdown:
448
- FOLDERS
449
-
450
- -- mwalajsm/ # Root directory
451
- │── app.mjs # Main application entry point
452
- │── ATTENDANCE/ # Attendance-related files (clarify purpose)
453
- │── bin/ # Executable scripts
454
- │── config/ # Configuration files
455
- │── controllers/ # Business logic controllers
456
- │── middlewares/ # Request middlewares
457
- │── migrations/ # Database migrations
458
- │── models/ # Database models
459
- │── mwalajs/ # Core framework code
460
- │── public/ # Static assets (CSS, JS, Images)
461
- │── routes/ # API & web routes
462
- │── views/ # Frontend templates (if using templating)
463
- │── dist/ # Compiled or bundled output
464
- │── package.json # Dependencies & scripts
465
- │── README.md # Project documentation
466
- │── start.bat # Windows startup script
467
- │── setup.sh # Unix-based setup script
468
- │── createProject.mjs # Automates project creation
469
- │── runMigrations.mjs # Database migration script
470
- │── installer/ # Installer-related files
471
- │── node_modules/ # Dependencies
472
- 2. Why Developers Should Switch to MwalaJS
473
- MwalaJS should highlight:
474
- Better modular structure (prevents spaghetti code)
475
- Built-in migrations & models (reduces DB setup time)
476
- Simplified setup scripts (automates installation)
477
- Performance optimizations (mention key tech choices)
478
- Security-first approach (middleware for authentication, validation)
479
-
480
- 3. Preventing Module Repetition
481
- Are there duplicate functionalities in middlewares/, controllers/, or mwalajs/?
482
- If mwalajs/ is the core framework, maybe avoid repeating similar logic inside controllers/
483
-
484
- ## Future of Web Development
485
- MwalaJS is designed to replace traditional frameworks by offering a modern, easy-to-use,
486
- and high-performance alternative. Whether you are building a simple website or a complex web application,
487
- MwalaJS provides the tools you need for success.
488
- ## Contribute
489
- We welcome contributors! Feel free to fork the repository, submit issues, and make pull requests.
490
-
491
- ## License
492
- MwalaJS is open-source and licensed under the MIT License.
493
- © 2025 MwalaJS Documentation | All Rights Reserved
494
-
495
- About MwalaJS Framework
496
- Your reliable framework for modern applications
497
-
498
- Founder: Hekima Ambalile Mwala
499
- About the Founder
500
- Hekima Ambalile Mwala is the founder of the MwalaJS framework. He is a highly motivated and passionate software developer with a vision of creating efficient and scalable web applications. He believes in the power of technology to solve real-world problems.
501
-
502
- Also work as Electronics and Telecommunication Engineer
503
-
504
- you may prefer To learn Engineering and Technology in his youtube account link >> youtube chanel
505
-
506
- Contact Information:
507
-
508
- Phone: 0747285438
509
-
510
- Email: hekimamwala1@gmail.com
511
-
512
- Work Email: biasharaboraofficials@gmail.com
513
-
514
- Workplace: Biashara Bora
515
-
516
- Our Locations
517
- MwalaJS operates throughout Tanzania, with a special focus on the following key regions:
518
-
519
- Dodoma, Tanzania (Main Hub)
520
- Arusha, Tanzania (Main Hub)
521
- Dar Es Salaam, Tanzania (Main Branch)
522
- Mbeya, Tanzania (Main Branch)
523
- Morogoro, Tanzania (Main Branch)
524
- SOUTH AFRICA (Main Branch)
525
- Get in Touch with Us
526
- For more information or any inquiries, feel free to reach out to us via the contact details mentioned above. We are committed to providing the best solutions for your business needs.
527
-
528
-
529
- 1. VERSION RELEASE
530
- Click below to download the installer For Mwalajs framework:
531
-
532
-
533
-
534
- Click below to download zip file mwalajs framework:
535
-
536
-
537
-
538
- Click below to download rar file mwalajs framework :
539
-
540
-
541
- git clone https://github.com/mwala400/mwalajs.git
542
-
package/ujasi/app.mjs DELETED
@@ -1,33 +0,0 @@
1
- import mwalajs from 'mwalajs';
2
- import { homeRoutes } from './routes/homeRoutes.mjs';
3
- import { fileURLToPath } from 'url';
4
- import path from 'path';
5
-
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = path.dirname(__filename);
9
-
10
- // Use mwalajs directly (it's an instance now)
11
- mwalajs.set('view engine', 'ejs');
12
- mwalajs.set('views', path.join(__dirname, 'views'));
13
-
14
- // Serve static files correctly
15
- mwalajs.useStatic(path.join(__dirname, 'public'));
16
-
17
- // Use routes
18
- mwalajs.use('/', homeRoutes);
19
-
20
- mwalajs.use('/steps', homeRoutes);
21
-
22
-
23
- mwalajs.use('/about', homeRoutes);
24
-
25
-
26
- mwalajs.use('/welcome', homeRoutes);
27
-
28
-
29
- // Start server
30
- const port = process.env.PORT || 2025;
31
- mwalajs.listen(port, () => {
32
- console.log(`Server running on http://localhost:${port}`);
33
- });