MwalaJS - Complete Documentation

Welcome to MwalaJS! This guide will help you install, configure, and use MwalaJS efficiently.

1. Installation

You can install MwalaJS in multiple ways:

Using GitHub Repository

Clone the repository from GitHub:

git clone https://github.com/mwala400/mwalajs.git

from github https://github.com/mwala400/mwalajs v1.0.0

Using a ZIP, EXE, or RAR File

Download and extract the files from the available compressed format:


1. VERSION RELEASE

LATEST

MwalaJS Framework

MwalaJS is a lightweight and modular JavaScript framework designed for building scalable server-side applications using modern Node.js features.


Installation

Install MwalaJS globally to use CLI tools:

npm install -g mwalajs

If you're using it in a specific project, install locally:

npm install mwalajs

Note: In case of errors regarding missing fs-extra, you can install it manually:

npm install -g fs-extra

Note 2: NOW MWALAJS IS ONE OF NPM PACKAGE NO NEED TO DOWNLOAD .ZIP, .RAR OR .EXE FILES

before any create a .json file and preparing mwalajs by running mwala init make sure in your .json file you have "dependencies": { "mwalajs": "^version(example, 1.0.5 or above)" } and "type": "module", these are more important to be set before run mwala serve
, you can install it BY npm install -g mwalajs:


Usage

Once installed globally, you can use the CLI command:

mwala

Or check the version:

mwala -v

??? CLI Commands

Command Description
mwala create-project Create a new project using MwalaJS
mwala init initialization of .json file and mwala environment in the project
mwala serve Run the project in development mode
mwala help Display help instructions

?? Security Notes


Click below to download the installer For Mwalajs framework:


Download MwalaJS COMMAND SHELL (CLS) download .exe file here

Click below to download zip file mwalajs framework:


Download MwalaJS mwalajs.zip v1.0.0

Click below to download rar file mwalajs framework :


Download MwalaJS mwalajs.rar v1.0.0

2. Setting Up MwalaJS

Initialize MwalaJS

mwala init

Creating a New Project

mwala create-project

3. Running the Application

mwala serve

4. Database Operations

Creating a Database

mwala create-db

Creating a Table

mwala create-table <table_name>

Dropping a Table

mwala drop-table <table_name>

5. Code Generation

            mwala generate model <name>
            mwala generate controller <name>
            mwala generate route <name>
            mwala generate view <name>
            mwala generate midware <name>
        

6. Additional Information

For more details, visit: GitHub Repository

MwalaJS Framework Documentation

MwalaJS Framework Documentation

A lightweight, easy-to-use Node.js framework to create scalable web applications with MVC architecture and powerful built-in features.

GitHub Repository: https://github.com/mwala400/mwalajs

1. Overview

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.

Download Documentation

1. VERSION RELEASE

Click below to download the installer For Mwalajs framework:


Download MwalaJS COMMAND SHELL (CLS) download .exe file here

Click below to download zip file mwalajs framework:


Download MwalaJS mwalajs.zip v1.0.0

Click below to download rar file mwalajs framework :


Download MwalaJS mwalajs.rar v1.0.0
git clone https://github.com/mwala400/mwalajs.git

Clone from github https://github.com/mwala400/mwalajs v1.0.0

Key Features:

  • MVC Architecture: Automatically generates models, controllers, routes, and views.
  • Database Management: Includes commands to create and drop tables, run migrations, and manage the database.
  • Middleware Support: Add custom middleware to handle requests.
  • EJS Template Engine: Integrated for view rendering.
  • Static File Support: Easily serve static assets like CSS, JavaScript, and images.
MwalaJS Documentation

. Example Application

app.mjs

Here is an example of the default app.mjs file for starting the server:


    import mwalajs from 'mwalajs';
    import { homeRoutes } from './routes/homeRoutes.mjs';
    import { fileURLToPath } from 'url';
    import path from 'path';
    
    const __filename = fileURLToPath(import.meta.url);
    const __dirname = path.dirname(__filename);
    
    mwalajs.set('view engine', 'ejs');
    mwalajs.set('views', path.join(__dirname, 'views'));
    
    mwalajs.useStatic(path.join(__dirname, 'public'));
      
    mwalajs.use('/', homeRoutes);
    
    const port = process.env.PORT || 3000;
    mwalajs.listen(port, () => {
      console.log(`Server running on http://localhost:${port}`);
    });
            

homeRoutes.mjs

Here is an example of the default homeRoutes.mjs file:


    import mwalajs from 'mwalajs';
    import { homeController, Steps, welcome, about } from '../controllers/homeController.mjs';
    
    const router = mwalajs.Router();
    
    router.get('/', homeController.getHomePage);
    router.get('/steps', Steps.getSteps);
    router.get('/welcome', welcome.getwelcome);
    router.get('/about', about.getabout);
    
    export { router as homeRoutes };
            

homeController.mjs

Here is an example of the homeController.mjs file:


    export const homeController = {
      getHomePage: (req, res) => {
        res.render('index', { title: 'Welcome to MwalaJS MVC' });
      }
    };
    
    export const Steps = {
      getSteps: (req, res) => {
        res.render('steps', { title: 'Steps in MwalaJS MVC' });
      }
    };
    
    export const welcome = {
      getwelcome: (req, res) => {
        res.render('welcome', { title: 'Welcome to MwalaJS MVC' });
      }
    };
    
    export const about = {
      getabout: (req, res) => {
        res.render('about', { title: 'About MwalaJS MVC' });
      }
    };
            

6. Conclusion

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.

For full documentation and to contribute, visit the GitHub repository.

Summary of MwalaJS Commands


     General Commands:
      - mwala -v | mwala --version → Show MwalaJS version.
      - mwala help | mwala h → Show help message.
    
     Project Management:
      - mwala create-project → Create a new project.
      - mwala init → Initialize MwalaJS.
    
     Running the Application:
      - mwala serve | mwala app.mjs → Start MwalaJS app.
    
     Database Operations:
      - mwala create-db → Create database from .env file.
      - mwala migrate all → Run all pending migrations.
      - mwala rollback all → Undo migration.
    
     Code Generation:
      - mwala generate model  → Create a model.
      - mwala generate controller  → Create a controller.
      - mwala generate route  → Create a route.
      - mwala generate view  → Create a view.
    
     To execute a command, use:
      mwala 
            
Simpe files and folders expected after create project README.md app.mjs controllers migrations models node_modules package-lock.json package.json public routes views and are only files needed and you may add folders like config or any

mwalajs/ # Root directory

      mwalajs/               # Root directory
      │── app.mjs             # Main application file
      │── runMigrations.mjs   # Handles database migrations
      │── createProject.mjs   # Script for creating new projects
      │── setupMwalajs.mjs    # Setup script for MwalaJS
      │── start.bat           # Batch script to start the server
      │── setup.bat           # Batch script for installation
      │── setup.bash          # Bash script for installation (Linux/macOS)
      │── setup.sh            # Another installation script
      │── package.json        # Dependencies and project metadata
      │── package-lock.json   # Dependency lock file
      │── README.md           # Documentation for MwalaJS
      │── migrations/         # Database migration files
      │── models/             # Database models
      │── controllers/        # Handles application logic
      │── routes/             # Defines API routes
      │── middlewares/        # Custom middleware for authentication, logging, etc.
      │── config/             # Configuration files (e.g., database, app settings)
      │── public/             # Static assets like CSS, JavaScript, and images
      │── views/              # Template views (if using server-side rendering)
      │── mwalajs/            # Core framework files
      │── dist/               # Compiled or built files
      │── node_modules/       # Dependencies installed via npm
      │── YOUR CREATED PROJECT/       # When run mwala create-project will request project name related files (clarify purpose) 
      │── installer/          # Installation-related files
      │── installerimg.png    # Image used during installation
      │── mwalajs5.png        # Framework branding/image
      │── mwalajs4_RXv_icon.ico # Framework icons
      │── mwalajs4_lyh_icon.ico # Another framework icon
      │── mwalajsm.iss        # Installer script for Windows
      │── background.bmp      # Background image (possibly for setup UI)
      │── background.png      # Another background image
      │── bin/                # Executable files or scripts
      This structure makes MwalaJS a well-organized and scalable framework. To make it even more convincing, you could add:
      
      A "tests/" folder – To show built-in support for unit and integration tests.
      A "docs/" folder – Dedicated to documentation with detailed guides.
      A "scripts/" folder – For automation scripts instead of having them in the root directory.
      A "logs/" folder – To store logs instead of scattering them.
      

```
## Getting Started
### Installation
1. **Install MwalaJS globally:**
   ```sh
   npm install -g mwalajs
   ```
2. **Create a new project:**
   ```sh
   mwalajs create myApp
   cd myApp
   npm install
   ```
3. **Run the development server:**
   ```sh
   npm start
   ```

## Sample Code
A simple MwalaJS route example:
Your MwalaJS file structure is well-organized, but to make it more convincing for developers to switch, consider:

1. Clean File Structure Explanation
Here’s a structured breakdown:

FOLDERS


   mwalajs/              # Root directory  
  │──  app.mjs           # Main application entry point  
  │──  ATTENDANCE/       # Attendance-related files (clarify purpose)  
  │──  bin/              # Executable scripts  
  │──  config/           # Configuration files  
  │──  controllers/      # Business logic controllers  
  │──  middlewares/      # Request middlewares  
  │──  migrations/       # Database migrations  
  │──  models/           # Database models  
  │──  mwalajs/          # Core framework code  
  │──  public/           # Static assets (CSS, JS, Images)  
  │──  routes/           # API & web routes  
  │──  views/            # Frontend templates (if using templating)  
  │──  dist/             # Compiled or bundled output  
  │──  package.json      # Dependencies & scripts  
  │──  README.md         # Project documentation  
  │──  start.bat         # Windows startup script  
  │──  setup.sh          # Unix-based setup script  
  │──  createProject.mjs # Automates project creation  
  │──  runMigrations.mjs # Database migration script  
  │──  installer/        # Installer-related files  
  │──  node_modules/     # Dependencies  
  2. Why Developers Should Switch to MwalaJS
  MwalaJS should highlight:
   Better modular structure (prevents spaghetti code)
   Built-in migrations & models (reduces DB setup time)
   Simplified setup scripts (automates installation)
   Performance optimizations (mention key tech choices)
   Security-first approach (middleware for authentication, validation)
  
3. Preventing Module Repetition
Are there duplicate functionalities in middlewares/, controllers/, or mwalajs/?
If mwalajs/ is the core framework, maybe avoid repeating similar logic inside controllers/

## Future of Web Development
MwalaJS is designed to replace traditional frameworks by offering a modern, easy-to-use,
and high-performance alternative. Whether you are building a simple website or a complex web application,
MwalaJS provides the tools you need for success.
## Contribute
We welcome contributors! Feel free to fork the repository, submit issues, and make pull requests.

## License
MwalaJS is open-source and licensed under the MIT License.

Join WhatsApp Whatsapp Group for MwalaJS-Support:

To join click here