A production-ready project management solution integrating Bryntum Gantt with Next.js frontend, Express.js backend, and MongoDB persistence.
This project provides a complete, enterprise-grade implementation of Bryntum Gantt chart library integrated with modern web technologies. It demonstrates best practices for:
- Frontend: Next.js 14 with App Router, TypeScript, and client-side rendering
- Backend: Express.js RESTful API with MongoDB persistence
- Data Management: Real-time synchronization using Bryntum's CrudManager
- User Experience: Professional Gantt chart with full feature set matching Bryntum's official demos
β
Full Feature Parity with Bryntum Gantt professional demo
β
Type-Safe TypeScript implementation
β
Production-Ready error handling and validation
β
Scalable architecture supporting large datasets
β
Real-Time Sync with automatic conflict resolution
β
Comprehensive task management (CRUD, dependencies, resources)
Full-featured Gantt chart with tasks, dependencies, and timeline visualization
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client (Browser) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Next.js Frontend (Port 3000) β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β Bryntum Gantt Component β β β
β β β - Task Management β β β
β β β - Dependency Visualization β β β
β β β - Resource Assignment β β β
β β β - Real-time Updates β β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β CrudManager API β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HTTP/REST
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Express.js Backend (Port 3001) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β REST API Endpoints β β
β β - GET /api/load (Load all data) β β
β β - POST /api/sync (Sync changes) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Mongoose ODM β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β MongoDB Database β β
β β Collections: tasks, dependencies, β β
β β resources, assignments β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-
Task Management
- Create, read, update, delete tasks
- Hierarchical task structure (parent/child relationships)
- WBS (Work Breakdown Structure) support
- Task duration and effort tracking
- Progress percentage visualization
- Milestone conversion
-
Dependencies
- Visual dependency lines between tasks
- Predecessor/successor relationships
- Dependency types (Finish-to-Start, etc.)
- Lag time configuration
- Automatic constraint calculation
-
Resource Management
- Resource assignment to tasks
- Resource allocation units
- Resource calendar support
-
Visual Features
- Task Color Customization: Right-click any task bar to change its color
Customize task bar colors via context menu- Milestone Conversion: Convert tasks to milestones via context menu
Convert tasks to milestones with a single click- Progress bars with percentage completion
- Timeline visualization with customizable view presets
- Zoom controls (in, out, fit, previous/next)
- Current time indicator
-
Toolbar
- Create new tasks
- Undo/Redo operations
- Expand/Collapse all tasks
- Zoom controls
- Task search/filter
-
Context Menu (Right-click on tasks)
- Edit task
- Add task (above/below/subtask)
- Convert to milestone
- Delete task
- Cut/Copy/Paste
- Duplicate task
- Split task
- Indent/Outdent
- Add dependencies
- Color picker for task bars
Rich context menu with all task management options- Scroll to task
- Expand to fit
-
Task Editor Dialog
- General tab (name, dates, duration, progress, effort)
- Predecessors tab
- Successors tab
- Resources tab
- Advanced tab (scheduling mode, constraints, calendar)
- Color field for task customization
- Automatic save on changes (autoSync)
- Optimistic UI updates
- Conflict resolution
- Transaction support (undo/redo)
- Dirty state tracking
Bryntum Gantt uses 4 core data models that are part of the official Bryntum data structure:
-
Task - Represents project tasks/work items
- Properties: name, dates, duration, progress, hierarchy (parent/child)
- Purpose: The fundamental building blocks of your project plan
-
Dependency - Defines relationships between tasks
- Properties: fromEvent, toEvent, type, lag
- Purpose: Creates the project's critical path and task sequencing
-
Resource - Represents people, equipment, or materials
- Properties: name, email, calendar, imageUrl
- Purpose: Tracks who/what is available to work on tasks
-
Assignment - Links resources to tasks
- Properties: eventId, resourceId, units (allocation %)
- Purpose: Manages resource allocation and workload
These models are official Bryntum data structures and are required for the Gantt chart to function. They follow industry-standard project management practices.
π For detailed information, see Data Model Documentation
- Node.js v18+ (Download)
- MongoDB v6.0+ (Download)
- Or use MongoDB Atlas (cloud)
- npm or yarn package manager
This project uses the Bryntum Gantt trial version. The trial files should be located at:
bryntum-gantt-trial/gantt-6.3.3-trial/
For production use, you'll need a valid Bryntum license.
cd Activity-Tracker-Bryntum-Gantt-Chartscd backend
npm installCreate backend/.env:
PORT=3001
MONGODB_URI=mongodb://localhost:27017/gantt_db
NODE_ENV=developmentFor MongoDB Atlas:
MONGODB_URI=mongodb+srv://username:[email protected]/gantt_dbcd ../frontend
npm installImportant: Set up Bryntum Gantt packages. Since we're using the trial version:
# Create symlink to Bryntum build directory
mkdir -p node_modules/@bryntum
ln -s ../../../bryntum-gantt-trial/gantt-6.3.3-trial/build node_modules/@bryntum/gantt
# Copy theme assets
mkdir -p public/themes
cp -r ../../bryntum-gantt-trial/gantt-6.3.3-trial/build/gantt.stockholm*.css public/themes/
cp -r ../../bryntum-gantt-trial/gantt-6.3.3-trial/build/fonts public/themes/Start MongoDB (if local):
# macOS
brew services start mongodb-community
# Linux
sudo systemctl start mongod
# Windows - Start MongoDB service from Services panelSeed the database:
cd backend
npm run seedTerminal 1 - Backend:
cd backend
npm run devTerminal 2 - Frontend:
cd frontend
npm run devOpen your browser and navigate to:
http://localhost:3000
Application running with full Gantt chart functionality
Activity-Tracker-Bryntum-Gantt-Charts/
βββ frontend/ # Next.js application
β βββ app/ # Next.js App Router
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Main page
β β βββ globals.css # Global styles
β βββ components/ # React components
β β βββ Gantt.tsx # Gantt wrapper component
β β βββ GanttConfig.ts # Gantt configuration
β βββ public/ # Static assets
β β βββ themes/ # Bryntum theme files
β βββ package.json
β βββ tsconfig.json
β βββ next.config.js
β
βββ backend/ # Express.js server
β βββ models/ # Mongoose models
β β βββ Task.js # Task schema
β β βββ Dependency.js # Dependency schema
β β βββ Resource.js # Resource schema
β β βββ Assignment.js # Assignment schema
β βββ routes/ # API routes
β β βββ gantt.js # Gantt CRUD endpoints
β βββ scripts/ # Utility scripts
β β βββ seed.js # Database seeding
β βββ server.js # Express server entry
β βββ package.json
β βββ .env # Environment variables
β
βββ README.md # This file
Environment Variables (backend/.env):
PORT=3001 # Server port
MONGODB_URI=mongodb://localhost:27017/gantt_db # MongoDB connection
NODE_ENV=development # Environment modeEnvironment Variables (frontend/.env.local):
NEXT_PUBLIC_API_URL=http://localhost:3001/apiGantt Configuration (frontend/components/GanttConfig.ts):
Key configuration options:
{
project: {
autoLoad: true, // Auto-load data on init
autoSync: true, // Auto-save changes
loadUrl: '/api/load', // Load endpoint
syncUrl: '/api/sync' // Sync endpoint
},
showTaskColorPickers: true, // Enable color pickers
}Task Model:
id(Number, unique, indexed) - Bryntum task IDparentId(Number) - Parent task referencename(String) - Task namestartDate,endDate(Date) - Task datesduration(Number) - Task durationpercentDone(Number) - Completion percentageeventColor(String) - Task bar color- ... and more fields
Dependency Model:
id(Number, unique)fromEvent(Number) - Source task IDtoEvent(Number) - Target task IDtype(Number) - Dependency typelag(Number) - Lag time
Resource & Assignment Models:
- Similar structure following Bryntum's data model
Loads all Gantt data from MongoDB. Returns tasks, dependencies, resources, and assignments in Bryntum's expected format.
Synchronizes changes from the Gantt chart to MongoDB. Accepts added, updated, and removed records for all data types (tasks, dependencies, resources, assignments). Returns success status and any newly created record IDs mapped from phantom IDs.
-
Frontend (Gantt Features)
- Edit
frontend/components/GanttConfig.ts - Add feature configuration to
featuresobject - Update TypeScript types if needed
- Edit
-
Backend (API Endpoints)
- Edit
backend/routes/gantt.js - Add new endpoints or modify existing ones
- Update models in
backend/models/if schema changes
- Edit
- TypeScript: Strict mode enabled
- ESLint: Next.js recommended rules
- Prettier: Auto-formatting (if configured)
# Backend
cd backend
npm test # (if tests are configured)
# Frontend
cd frontend
npm run lint
npm run build # Test production buildBackend:
- Check console logs in terminal
- MongoDB queries: Use
mongoshor MongoDB Compass - API testing: Use Postman or curl
Frontend:
- Browser DevTools console
- React DevTools extension
- Network tab for API calls
Set production environment variables:
NEXT_PUBLIC_API_URL- Backend API URLMONGODB_URI- Production MongoDB connectionNODE_ENV=production
- β CORS configured for specific origins
- β Input validation on backend
- β MongoDB injection prevention (Mongoose)
β οΈ Add authentication/authorizationβ οΈ Add rate limitingβ οΈ Use HTTPS in productionβ οΈ Secure MongoDB connection (SSL/TLS)
For detailed troubleshooting guides and solutions to common issues, please refer to:
π Common Issues and Troubleshooting Guide
This comprehensive guide covers:
- Installation Issues - Node.js, package installation, permissions
- Bryntum Package Issues - Module not found, theme loading, watermark
- Database Connection Issues - MongoDB local and Atlas connections
- API and Network Issues - CORS, 404/500 errors, network failures
- Build and Compilation Issues - TypeScript errors, Next.js build failures
- Runtime Errors - Gantt rendering, task menu, data saving
- Performance Issues - Slow loading, memory leaks, large datasets
Bryntum packages not found:
cd frontend
rm -rf node_modules/@bryntum
mkdir -p node_modules/@bryntum
ln -s ../../../bryntum-gantt-trial/gantt-6.3.3-trial/build node_modules/@bryntum/ganttMongoDB connection errors:
- Verify MongoDB is running:
mongoshormongo - Check connection string in
backend/.env - For Atlas: Whitelist your IP address
Data not loading:
- Check browser console for errors
- Verify backend is running:
curl http://localhost:3001/api/load - Seed database:
cd backend && npm run seed
For more detailed solutions, see the Common Issues Guide.
- Create a feature branch
- Make changes
- Test thoroughly
- Update documentation
- Submit pull request
- Code follows project style guide
- TypeScript types are correct
- No console.logs in production code
- Error handling is implemented
- Documentation is updated
- Tests pass (if applicable)
This project uses Bryntum Gantt trial version. For production use, you need a valid Bryntum license.
See Bryntum Licensing for details.
Built with β€οΈ using Bryntum Gantt, Next.js, Express.js, and MongoDB