4bnode

v4.0.4 Proprietary

A professional CLI tool and visual dashboard to generate, manage, and test Node.js/Express applications. Built by 4Brains Technologies.

  ██╗  ██╗██████╗ ███╗   ██╗ ██████╗ ██████╗ ███████╗
  ██║  ██║██╔══██╗████╗  ██║██╔═══██╗██╔══██╗██╔════╝
  ███████║██████╔╝██╔██╗ ██║██║   ██║██║  ██║█████╗
  ╚════██║██╔══██╗██║╚██╗██║██║   ██║██║  ██║██╔══╝
       ██║██████╔╝██║ ╚████║╚██████╔╝██████╔╝███████╗
       ╚═╝╚═════╝ ╚═╝  ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝

Quick Start

Terminal
$ npx 4bnode init my-app
$ cd my-app
$ npm run dev

Your app runs at http://localhost:3000 with a built-in visual dashboard at http://localhost:3000/_dev.

CLI Commands

Create a Project

Terminal
$ npx 4bnode init <name>

Scaffolds a new Express project with:

Add Features

Use the interactive menu:

Terminal
$ npx 4bnode add

Or add directly:

Command Description
4bnode add api <name>Create a new API endpoint
4bnode add mongoConfigure MongoDB connection
4bnode add crudAdd CRUD operations to a route
4bnode add loginAdd JWT authentication & login
4bnode add socketIntegrate Socket.IO
4bnode add websocketAdd native WebSocket support
4bnode add serialportSerial port communication

API Endpoint Creation

Terminal
$ 4bnode add api users

When creating an API endpoint:

Schema Management

Terminal
$ 4bnode schema              # Interactive create/view/edit
$ 4bnode schema user         # Create or edit 'user' schema

Supported field types: String, Number, Boolean, Date, Array, ObjectId, Mixed, Buffer

Field constraints: required, unique, default

Presets available: user, product, post

List Project Info

Terminal
$ 4bnode list                # Show all models, routes & config
$ 4bnode list models         # List models only
$ 4bnode list routes         # List routes only

Update 4bnode

To update to the latest version of 4bnode, run:

Terminal
$ npx 4bnode@latest

Dashboard Passkey

During npx 4bnode init, you'll be prompted to set a 6-digit passkey to protect the dev dashboard.

To change the passkey later, run inside your project:

Terminal
$ 4bnode passkey

Start Dev Dashboard

Terminal
$ 4bnode ui

Runs npm run dev and opens the visual dashboard. Must be run inside a 4bnode project.

Visual Dashboard

Access at http://localhost:3000/_dev when running npm run dev. A full-featured development environment built right into your app.

Overview

Project status, configured features, and quick stats at a glance.

Database

MongoDB connection setup and URI management. Connect, disconnect, and monitor your database.

Schemas

Create, view, and edit MongoDB schemas with visual field management. Add/remove fields, toggle required/unique, set defaults.

String Number Boolean Date ObjectId Array

Environment

View and edit .env.development and .env.production files directly from the dashboard.

API Routes

Full route management with visual controls:

  • Create new routes (Methods, CRUD, Login, Register)
  • Add methods to existing routes with field selection
  • Select fields from models or add custom fields
  • File upload fields auto-configure multer
  • View route source code, edit inline
  • Share endpoint docs with frontend team (Markdown format)
  • Delete routes (removes file + index.js registration)

API Tester

Built-in Postman-like API testing tool with REST, Socket.IO, and WebSocket support.

  • Body types: JSON, Form Data, URL Encoded, Raw, Binary
  • File uploads: Choose file, send as File or Base64
  • Auto-detect fields: Matches URL to route and pre-fills body/form fields from route code
  • Path variables: Auto-detects :id params, shows editable fields
  • Query params: Key-value editor, auto-fills from req.query
  • Headers: Key-value editor with quick presets (Bearer Auth, JSON, Form Data, URL Encoded, Accept)
  • Response viewer: Body + Headers tabs, copy response, save responses
  • Collection management: Save requests, organize with responses, delete with confirmation
  • Import from routes: One-click import endpoints from your project routes
  • All data persisted in .4bnode/ JSON files (not localStorage)

Share Collection

Generate a shareable API documentation page:

Endpoint details cURL examples Fetch examples Axios examples File upload code Response examples Search & filter Persistent URL

Reports

Export MongoDB data as styled Excel (.xlsx) reports.

  • Select models and fields to include
  • Populate referenced ObjectId fields
  • Custom column headers and prefixes
  • Drag-and-drop column reordering
  • Configurable date format & timezone
  • Preview before download

Logs

Real-time server log monitoring via SSE.

  • Filter by type (LOG, INFO, WARN, ERROR)
  • Search through log entries
  • Auto-scroll with toggle
  • Keeps last 500 entries

Real-time

Socket.IO and WebSocket configuration panel. Set up real-time communication in seconds.

SerialPort

Serial port setup with path and baud rate config. Communicate with hardware devices directly.

Generated Project Structure

my-app/ ├── index.js # Express app entry point ├── package.json ├── .env.development # Dev environment variables ├── .env.production # Production environment variables ├── .4bnode/ # Dashboard engine & data (managed by 4bnode) ├── public/ # Static files │ └── index.html # App status landing page └── src/ ├── db.js # MongoDB connection (after add mongo) ├── models/ # Mongoose schemas └── routes/ # API route files

Real-time Communication

Socket.IO

Terminal
$ 4bnode add socket

Access in routes via req.io:

JavaScript
router.get('/notify', (req, res) => {
  req.io.emit('message', 'Hello from server');
  res.json({ sent: true });
});

WebSocket

Terminal
$ 4bnode add websocket

Access in routes via req.wss:

JavaScript
router.get('/broadcast', (req, res) => {
  req.wss.clients.forEach(client => {
    if (client.readyState === WebSocket.OPEN) {
      client.send('Hello from server');
    }
  });
  res.json({ sent: true });
});

Help

Terminal
$ 4bnode -h
$ 4bnode --help

License

Proprietary License

© 2025 4Brains Technologies. All rights reserved.

Unauthorized copying, distribution, modification, or use of this code is strictly prohibited.

For licensing or commercial use: contact@4brains.in