npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

modernx-gui

v1.3.0

Published

ModernX development GUI with real-time visualization

Downloads

673

Readme

ModernX GUI

Development GUI with real-time visualization for ModernX applications, providing comprehensive debugging and state inspection capabilities.

Features

  • Real-time Visualization: Live display of Redux state and actions
  • Project Structure Analysis: Automatic detection and visualization of ModernX models
  • WebSocket Communication: Real-time data synchronization between app and GUI
  • Action History: Complete history of Redux actions with timestamps and payloads
  • State Inspector: Visual tree view of application state
  • Hot Module Replacement: Automatic GUI updates during development

Installation

npm install modernx-gui --save-dev

Usage

Command Line Interface

Start the GUI from any ModernX project directory:

npx modernx-gui

This will:

  1. Automatically detect your ModernX project structure
  2. Start a local development server
  3. Open your default browser to the GUI interface
  4. Begin real-time state monitoring

Programmatic Integration

import modernx from 'modernx';
import gui from 'modernx-gui';

const app = modernx({
  plugins: [
    gui({
      port: 3000,
      autoOpen: true,
      websocket: true,
    }),
  ],
});

CLI Integration

When creating a new ModernX project, you can include the GUI automatically:

npx modernx create my-app --tools gui

GUI Interface

Project Structure Panel

  • Models List: Displays all detected ModernX models
  • File Tree: Shows project structure and relationships
  • Configuration: Shows current ModernX configuration

State Viewer

  • Current State: Real-time display of application state
  • State Tree: Expandable tree view of nested state
  • State Diff: Visual diff between state changes

Action History

  • Action Timeline: Chronological list of all actions
  • Action Details: Payload, timestamp, and metadata
  • State Transitions: Visual representation of state changes

Real-time Monitoring

  • Live Updates: Automatic state and action updates
  • Performance Metrics: Action execution time and performance
  • Error Tracking: Visual error reporting and stack traces

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | port | number | 3000 | GUI server port | | autoOpen | boolean | true | Auto-open browser | | websocket | boolean | true | Enable WebSocket communication | | host | string | 'localhost' | GUI server host |

Example Configuration

gui({
  port: 3001,
  autoOpen: false,
  websocket: true,
  host: '0.0.0.0', // Allow remote connections
});

Development Workflow

1. Start Development Server

cd my-modernx-app
npx modernx-gui

2. Start Your Application

npm run dev

3. Open GUI Interface

The GUI will automatically:

  • Detect your running ModernX application
  • Connect via WebSocket for real-time updates
  • Display current state and action history

4. Monitor and Debug

Use the GUI interface to:

  • Inspect current application state
  • Review action history and payloads
  • Monitor performance metrics
  • Track state changes in real-time

WebSocket Protocol

The GUI communicates with your application via WebSocket:

// Send state update to GUI
ws.send(JSON.stringify({
  type: 'state_update',
  payload: newState,
  timestamp: Date.now(),
}));

// Send action to GUI
ws.send(JSON.stringify({
  type: 'action',
  payload: {
    type: 'USER_ACTION',
    payload: actionData,
  },
  timestamp: Date.now(),
}));

Migration from DVA GUI

If you're migrating from DVA, the ModernX GUI provides enhanced capabilities:

// DVA GUI (Electron-based)
import dva from 'dva';
import gui from 'dva-gui';

// ModernX GUI (Web-based, enhanced)
import modernx from 'modernx';
import gui from 'modernx-gui';

// Enhanced features:
// - WebSocket real-time communication
// - Cross-browser compatibility
// - Hot module replacement
// - Enhanced state visualization

Browser Compatibility

  • Chrome: Full support
  • Firefox: Full support
  • Safari: Full support
  • Edge: Full support
  • Legacy browsers: Graceful degradation

Development

Building

npm run build

Development Mode

npm run dev

Testing

npm test

Troubleshooting

Common Issues

  1. GUI not connecting

    • Check if WebSocket is enabled
    • Verify port availability
    • Check firewall settings
  2. Project not detected

    • Ensure package.json has ModernX dependency
    • Check for src/models/ directory
    • Verify project structure
  3. Browser not opening

    • Check default browser settings
    • Try manual browser navigation to GUI URL
    • Verify port is not in use

Debug Mode

Enable debug logging:

DEBUG=modernx-gui:* npx modernx-gui

License

MIT