Secure Browser Runtime & Bundler with Django Support
npm install modderengineapp.mdc).
fetch() requests, encrypts the payload, and routes them through a secure server proxy. Hides real API endpoints from the Network tab.
and tags to prevent 404 errors, injecting assets directly from memory.
bash
npm install -g modderengine
`
Or run it locally within your project using npx or by linking it.
---
š» CLI Usage
ModderEngine is controlled via a single command-line interface.
$3
Builds everything in src/ and runs the secure server.
`bash
modderengine --build --run
`
$3
Scans specific folders (like templates), preserves server syntax (like {% url %}), and generates directory mirrors.
`bash
modderengine --build --dirs=templates,static --django=true --server-mode=true
`
$3
| Flag | Description |
| :--- | :--- |
| --build, -b | Compiles the project into dist/ and app.mdc. |
| --run, -r | Starts the Node.js Key Server (Default Port: 3000). |
| --dirs=name | Comma-separated list of folders to scan (e.g., --dirs=templates,static). Default is src. |
| --django=true | Generates "Skeleton" HTML files in dist/ mirroring the input structure. Essential for backend routing. |
| --server-mode=true | Preserves backend syntax (e.g., {{ var }}) inside the bundle without trying to execute it. |
| --route-based=false | Disables clean URLs (auto-routing) if you prefer strict file paths. |
---
š Using with Django (Integration Guide)
ModderEngine allows you to protect your frontend while keeping your Django backend logic.
$3
Assume your Django project looks like this:
`text
my_project/
āāā templates/
ā āāā index.html
ā āāā dashboard/
ā āāā views.html
āāā static/
āāā style.css
`
$3
Run this command in your project root:
`bash
modderengine --build --django=true --server-mode=true --dirs=templates,static
`
$3
* Input: It reads your source templates.
Encryption: It packs the content* of your templates into app.mdc.
* Output (dist/): It recreates the folder structure in dist/.
* dist/templates/index.html will contain a Skeleton Loader, not your code.
* The Skeleton Loader connects to the ModderEngine Key Server to render the content.
$3
1. Terminal 1: Run the Key Server.
`bash
modderengine --run
`
2. Terminal 2: Run Django (pointed to serve files from dist/templates).
`bash
python manage.py runserver
`
---
š Secure API Interceptor (The Tunnel)
ModderEngine can hide your real API endpoints from the browser's Network Tab.
$3
Create an api.json file inside your source directory (e.g., src/api.json or templates/api.json).
`json
{
"https://api.supersecret.com/v1/users": {
"method": "GET",
"redirected_path": "/secure/get-users"
},
"https://api.supersecret.com/v1/login": {
"method": "POST",
"redirected_path": "/auth/login-gateway"
}
}
`
$3
In your frontend code, you call the real URL:
`javascript
// You write this:
fetch('https://api.supersecret.com/v1/users')
.then(res => res.json())
.then(data => console.log(data));
`
$3
1. Intercept: The Engine sees the request matches api.json.
2. Encrypt: It stops the request, encrypts your headers/body/cookies into binary.
3. Redirect: It sends a POST request to http://localhost:3000/secure/get-users.
4. Proxy: The Node server decrypts it, calls the actual external API server-side, and encrypts the response.
5. Result: The browser Network Tab shows only binary garbage sent to /secure/get-users. The real API URL is never exposed.
---
š Architecture
$3
1. Scans directories (--dirs).
2. Removes