Skip to content

princedev-toptal/gojs-project123

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎨 DiagramPro - Professional Diagramming Suite

A comprehensive, enterprise-grade diagramming application built with GoJS, React, and modern web technologies

React GoJS React Flow Tailwind CSS Vite

✨ Features Overview

DiagramPro is a professional-grade diagramming application that combines the power of GoJS and React Flow to deliver 9 different specialized diagram types for business, technical, and strategic use cases.

🎯 Core Capabilities

  • βœ… 9 Professional Diagram Types - From org charts to Gantt charts
  • βœ… GoJS Integration - Enterprise-level diagramming library
  • βœ… React Flow Canvas - Modern, flexible node-based editor
  • βœ… State Management - Zustand for efficient global state
  • βœ… Theme Support - Light/Dark mode with seamless switching
  • βœ… Import/Export - JSON, PNG, SVG, PDF, SQL export capabilities
  • βœ… Undo/Redo - Full history management
  • βœ… Context Menus - Right-click operations on nodes
  • βœ… Drag & Drop - Intuitive node manipulation
  • βœ… Auto-Layout - Intelligent automatic layouting
  • βœ… Real-time Editing - Live updates and editing
  • βœ… Properties Panel - Dynamic node configuration
  • βœ… Responsive Design - Works on all screen sizes
  • βœ… 🎯 WalkMe Integration - In-app guidance and walkthroughs for all diagram types

πŸ“Š Diagram Types

1. 🏒 Organization Chart (GoJS)

Perfect for: HR, Management, Team Structure

  • Hierarchical employee structure
  • Photo integration with avatars
  • Department categorization
  • Color-coded levels
  • Context menu for quick actions (Add Report, Delete, Change Color)
  • Tree layout with configurable styling
  • Export to JSON/PNG
  • Right-click to add subordinates

Use Cases:

  • Company organizational structure
  • Department hierarchies
  • Reporting relationships
  • Team compositions

2. πŸ”„ BPMN Workflow Designer (GoJS)

Perfect for: Business Process Mapping, Operations, Quality Management

Node Types:

  • Start Event (Green circle) - Process initiation
  • Task (Blue rectangle) - Process steps with descriptions
  • Gateway (Orange diamond) - Decision points (X = XOR)
  • Subprocess (Purple rectangle) - Expandable sub-processes
  • Data Object (Document icon) - Data references
  • End Event (Red circle) - Process termination

Features:

  • BPMN 2.0 compliant shapes
  • Conditional flows with labels
  • Orthogonal routing with jump-over
  • Animated connections
  • Process validation
  • Export workflow definitions

Use Cases:

  • Standard Operating Procedures (SOPs)
  • Business process documentation
  • Workflow automation planning
  • Process optimization

3. πŸ—„οΈ Entity Relationship Diagram (GoJS)

Perfect for: Database Design, Software Architecture, Data Modeling

Features:

  • Primary Keys (Yellow diamond marker)
  • Foreign Keys (Red square marker)
  • Attributes (Blue circle marker)
  • Data type specification
  • Cardinality labels (1, N, 1:N, M:N)
  • Relationship naming
  • SQL Export - Generate CREATE TABLE statements automatically
  • Visual FK relationships

Use Cases:

  • Database schema design
  • Data modeling
  • System architecture
  • Migration planning

Bonus: Export directly to SQL with proper PRIMARY KEY and data type definitions!


4. 🌐 Network Topology Diagram (GoJS)

Perfect for: IT Infrastructure, Network Design, System Architecture

Device Types:

  • Server (Blue rectangle) - Web/App/Database servers
  • Router (Orange diamond) - Network routing
  • Firewall (Red pentagon) - Security appliances
  • Switch (Purple hexagon) - Network switches
  • Client (Blue ellipse) - Workstations/endpoints
  • Cloud (Green cloud) - Internet/Cloud services
  • Database (Pink cylinder) - Data storage

Features:

  • IP address tracking
  • Connection bandwidth labels
  • Device status indicators
  • Color-coded connection types
  • Force-directed layout
  • Infrastructure documentation

Use Cases:

  • Network infrastructure planning
  • System architecture diagrams
  • IT documentation
  • Disaster recovery planning

5. πŸ“… Gantt Chart Timeline (GoJS)

Perfect for: Project Management, Sprint Planning, Resource Allocation

Features:

  • Timeline visualization (Jan-May 2024 scale)
  • Task duration bars with color coding
  • Progress tracking (visual progress bars)
  • Task dependencies with arrows
  • Drag to reposition tasks
  • Resize to adjust duration
  • Duration calculation (auto-displays days)
  • Hierarchical task relationships

Visual Indicators:

  • Task name and duration
  • Progress percentage overlay
  • Dependency arrows
  • Color-coded by task type

Use Cases:

  • Project timeline planning
  • Sprint scheduling
  • Resource allocation
  • Milestone tracking

6. 🧠 Mind Map (React Flow)

Perfect for: Brainstorming, Idea Organization, Strategic Planning

Features:

  • Central idea with radiating branches
  • Multi-level hierarchy (Level 0, 1, 2, 3)
  • Color-coded nodes by level
  • Smooth animated connections
  • Drag and drop positioning
  • Real-time connection creation
  • Export to JSON
  • Mini-map overview

Use Cases:

  • Brainstorming sessions
  • Project planning
  • Knowledge mapping
  • Study notes

7. πŸ”€ Workflow Builder (React Flow)

Perfect for: Process Design, Automation Workflows, Decision Trees

Node Types:

  • Start nodes
  • Process steps
  • Decision points
  • End nodes

Features:

  • Step-by-step process flow
  • Conditional branching
  • Custom node styling
  • Connection validation

8. 🎯 Strategy Map (React Flow)

Perfect for: Strategic Planning, OKRs, Balanced Scorecard

Four-Tier Hierarchy:

  1. Vision (Purple) - Overall strategic vision
  2. Goals (Blue) - Strategic goals
  3. Objectives (Green) - Tactical objectives
  4. Initiatives (Orange) - Action items

Features:

  • Balanced scorecard methodology
  • Clear alignment from vision to execution
  • Color-coded strategic elements
  • Connection of initiatives to objectives

9. βš™οΈ Process Mapping (React Flow)

Perfect for: System Flows, Data Pipelines, Manufacturing Processes

Node Types:

  • Input nodes
  • Process nodes
  • Storage nodes
  • Validation nodes
  • Output nodes

Features:

  • System architecture visualization
  • Data flow diagrams
  • Directed edges with arrows
  • Process documentation

πŸš€ Getting Started

Prerequisites

  • Node.js 16+ installed
  • npm or yarn package manager
  • Modern web browser

Installation

# Clone the repository
git clone <your-repo-url>
cd gojs-project123

# Install dependencies
npm install

# Start development server
npm run dev

The application will open at http://localhost:5173

Build for Production

npm run build
npm run preview

πŸ› οΈ Technology Stack

Core Libraries

Technology Version Purpose
React 18.2 UI Framework
GoJS Latest Professional diagramming
React Flow 11.10 Node-based canvas
Zustand 4.4 State management
Tailwind CSS 3.3 Styling framework
Vite 5.0 Build tool
html2canvas Latest Image export
jsPDF Latest PDF export
Lucide React Latest Icon library

Architecture Highlights

  • Component-based architecture - Modular, reusable components
  • Global state management - Zustand for theme, canvas type, history
  • Immutable state updates - Immer middleware for safe mutations
  • Type-safe exports - Utility functions for all export formats
  • Responsive design - Works on desktop, tablet, and mobile

πŸ“ Project Structure

gojs-project123/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ gojs/                 # GoJS-based components
β”‚   β”‚   β”‚   β”œβ”€β”€ OrgChartCanvas.jsx    # Organization Chart
β”‚   β”‚   β”‚   β”œβ”€β”€ BPMNCanvas.jsx        # BPMN Workflow
β”‚   β”‚   β”‚   β”œβ”€β”€ ERDCanvas.jsx         # Entity Relationship Diagram
β”‚   β”‚   β”‚   β”œβ”€β”€ NetworkCanvas.jsx     # Network Topology
β”‚   β”‚   β”‚   └── GanttCanvas.jsx       # Gantt Chart
β”‚   β”‚   β”œβ”€β”€ common/               # Shared components
β”‚   β”‚   β”‚   └── PropertiesPanel.jsx   # Properties editor
β”‚   β”‚   β”œβ”€β”€ MindMapCanvas.jsx     # React Flow mind map
β”‚   β”‚   β”œβ”€β”€ WorkflowCanvas.jsx    # React Flow workflow
β”‚   β”‚   β”œβ”€β”€ StrategyCanvas.jsx    # React Flow strategy map
β”‚   β”‚   β”œβ”€β”€ ProcessCanvas.jsx     # React Flow process map
β”‚   β”‚   └── Sidebar.jsx           # Navigation sidebar
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── useStore.js           # Zustand state management
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── exportHelpers.js      # Export/import utilities
β”‚   β”œβ”€β”€ App.jsx                   # Main application
β”‚   β”œβ”€β”€ main.jsx                  # Entry point
β”‚   └── index.css                 # Global styles
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.js
β”œβ”€β”€ tailwind.config.js
└── README.md

🎨 Key Features Explained

State Management

// Global store with Zustand + Immer
const useStore = create(immer((set) => ({
  theme: 'light',              // Light/Dark theme
  activeCanvas: 'orgchart',    // Current diagram type
  diagrams: {},                 // Diagram data storage
  history: { past, present, future }, // Undo/Redo
  selectedNode: null,           // Selected element
  showProperties: true,         // Properties panel toggle
  showGrid: true,               // Grid visibility
  snapToGrid: true,             // Snap to grid
  autoLayout: true,             // Auto-layout enabled
})))

Export Capabilities

  • JSON - Complete diagram data
  • PNG - High-resolution raster image
  • SVG - Vector graphics (GoJS only)
  • PDF - Print-ready documents
  • SQL - Database schema (ERD only)
  • CSV - Tabular node data

Context Menus (GoJS)

Right-click on nodes to:

  • Add child nodes
  • Delete nodes
  • Change colors
  • Edit properties
  • Clone nodes

Keyboard Shortcuts

  • Ctrl+Z / Cmd+Z - Undo
  • Ctrl+Y / Cmd+Y - Redo
  • Delete - Delete selected node
  • Ctrl+C - Copy
  • Ctrl+V - Paste
  • Ctrl+A - Select all

🎯 Use Cases by Industry

🏒 Corporate / Enterprise

  • Organizational structure charts
  • Strategic planning maps
  • Process documentation
  • Compliance workflows

πŸ’» Technology / Software

  • System architecture diagrams
  • Database schema design
  • Network topology maps
  • Project timelines (Gantt)

πŸ“Š Consulting

  • Client org structure analysis
  • Process optimization mapping
  • Strategy roadmaps
  • Workflow automation design

🏭 Manufacturing / Operations

  • Production workflows
  • Quality assurance processes
  • Supply chain mapping
  • Equipment network diagrams

πŸŽ“ Education / Training

  • Mind maps for learning
  • Course structure planning
  • Knowledge organization
  • Concept mapping

πŸ”§ Customization Guide

Adding a New Diagram Type

  1. Create component in src/components/gojs/ or src/components/
  2. Define node templates using GoJS or React Flow
  3. Add to App.jsx in the renderCanvas() switch
  4. Add to Sidebar.jsx in the canvasTypes array
  5. Update store if needed for specific state

Styling Customization

Modify tailwind.config.js to customize:

  • Color schemes
  • Spacing
  • Fonts
  • Breakpoints

Theme Customization

The theme system supports:

  • Light/Dark mode toggle
  • Custom color palettes
  • Per-component theme overrides

πŸ“š API & Utilities

Export Helpers

import { 
  exportToJSON, 
  exportToPNG, 
  exportToPDF,
  importFromJSON 
} from './utils/exportHelpers'

// Export diagram
exportToJSON(diagramData, 'my-diagram')
exportToPNG(elementRef.current, 'my-diagram')

// Import diagram
const data = await importFromJSON()

State Access

import useStore from './store/useStore'

function MyComponent() {
  const { 
    activeCanvas, 
    setActiveCanvas,
    theme,
    toggleTheme 
  } = useStore()
  
  // Use state...
}

πŸš€ Performance Optimization

  • Code splitting - Lazy load diagram components
  • Memoization - React.memo for expensive components
  • Virtual rendering - GoJS efficient rendering
  • Debounced updates - Smooth interaction
  • Optimized layouts - Fast auto-layout algorithms

🀝 Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.


πŸ™ Acknowledgments

  • GoJS - Professional diagramming library
  • React Flow - Node-based UI library
  • Tailwind CSS - Utility-first CSS framework
  • Zustand - Lightweight state management
  • Lucide - Beautiful icon library

πŸ“ž Support & Contact


🌟 What Makes This Special?

1. Dual Engine Architecture

Combines GoJS (enterprise-grade) and React Flow (modern flexibility) for the best of both worlds.

2. Production Ready

  • Comprehensive error handling
  • Export/import functionality
  • Undo/redo support
  • Local storage persistence
  • Theme support

3. Developer Friendly

  • Clean, modular code
  • Well-documented
  • Easy to extend
  • Type-safe utilities

4. Enterprise Features

  • SQL export for ERD
  • BPMN compliance
  • Professional layouts
  • Context menus
  • Properties panels

5. Modern Stack

  • React 18
  • Vite (fast builds)
  • Tailwind CSS
  • Zustand (simple state)

πŸ“ˆ Roadmap

Planned Features

  • Collaborative editing (WebSocket)
  • Cloud storage integration
  • Template library
  • AI-powered auto-layout suggestions
  • Mobile app (React Native)
  • Real-time collaboration
  • Version control for diagrams
  • Comments and annotations
  • Presentation mode
  • Integration with Jira, Confluence, Notion

πŸŽ“ Learning Resources

GoJS Resources

React Flow Resources


πŸ’‘ Tips & Best Practices

For Best Performance

  1. Use React.memo() for diagram components
  2. Minimize re-renders with proper state management
  3. Use lazy loading for large diagrams
  4. Enable auto-layout only when needed

For Best UX

  1. Provide clear visual feedback
  2. Use consistent color schemes
  3. Add helpful tooltips
  4. Implement keyboard shortcuts

For Maintainability

  1. Keep components small and focused
  2. Use TypeScript for type safety (optional)
  3. Document complex logic
  4. Write tests for utilities

Built with ❀️ using modern web technologies and AI-accelerated development techniques

⭐ Star this repo if you find it useful!

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages