A modern, comprehensive dashboard widget for Contentstack marketplace apps that uses the Management SDK to retrieve real-time stack statistics and generates interactive dashboards displaying content types, entries, and assets counts with navigation capabilities.
- Real-time Stack Statistics: Displays live counts of content types, entries, and assets using Management SDK
- Interactive Dashboard Widget: Clean, professional interface using Contentstack's Venus components
- Parallel Data Processing: Efficient fetching with concurrent API calls for optimal performance
- Error Handling & Retry: Comprehensive error states with user-friendly retry functionality
- Direct Navigation: Quick access links to content types, entries, and assets in Contentstack
- TypeScript: Fully typed for better development experience and code reliability
- Responsive Design: Works seamlessly across different screen sizes and devices
- Testing: Comprehensive test suite with Playwright for E2E testing
- Modern UI: Accessible interface with loading states and smooth animations
- Node.js (v18 or higher)
- npm (v8 or higher)
- Contentstack account (for marketplace deployment)
# Clone the repository
git clone https://github.com/contentstack/marketplace-quick-info-dashboard-app.git
cd marketplace-quick-info-dashboard-app
# Install dependencies
npm install# Start development server
npm run dev
# Run tests
npm run test:chrome
# Run E2E tests
npm run test:chrome-headed# Build the application
npm run build
# The built files will be in the `dist` directorymarketplace-quick-info-dashboard-app/
βββ src/
β βββ components/ # Reusable React components
β β βββ ui/ # UI components (StackIcons, etc.)
β β βββ types/ # Component-specific TypeScript interfaces
β β βββ StackMetrics.tsx # Main widget component
β β βββ stat-card.tsx # Individual statistic card component
β β βββ loading-skeleton.tsx # Loading state components
β β βββ AppFailed.tsx # Error fallback component
β β βββ ErrorBoundary.tsx # React error boundary
β βββ containers/ # Main app containers
β β βββ App/ # Main app component
β β βββ DashboardWidget/ # Stack dashboard widget container
β β βββ 404/ # 404 error page
β βββ common/
β β βββ contexts/ # React contexts (MarketplaceAppContext)
β β βββ hooks/ # Custom React hooks (useAppSdk, useManagementClient)
β β βββ locales/ # Internationalization files
β β βββ providers/ # Context providers (MarketplaceAppProvider)
β β βββ types/ # TypeScript type definitions
β βββ assets/ # Static assets
βββ e2e/ # End-to-end tests
β βββ pages/ # Page object models
β βββ tests/ # Test specifications
β βββ utils/ # Test utilities
βββ public/ # Public assets
βββ config files... # package.json, vite.config.ts, etc.
This project includes comprehensive testing:
npm run test:chrome # Run E2E tests in Chrome
npm run test:firefox # Run E2E tests in Firefox
npm run test:chrome-headed # Run E2E tests in Chrome (headed mode)
npm run test:firefox-headed # Run E2E tests in Firefox (headed mode)npm run lint # Run ESLint
npm run typecheck # TypeScript type checking
npm run format # Format code with Prettier
npm run build:check # Type check and build verificationCreate a .env file in the root directory:
VITE_APP_BASE_URL=https://app.contentstack.comThe app configuration is defined in manifest.json:
{
"name": "Quick Info Widget",
"target_type": "stack",
"ui_location": {
"locations": [
{
"type": "cs.cm.stack.dashboard",
"meta": [
{
"path": "/stack-dashboard",
"signed": false,
"enabled": true,
"default_width": "half"
}
]
}
]
}
}- Create feature branch from
main - Implement your changes in the
srcdirectory - Add tests for new functionality
- Update documentation if necessary
- Submit pull request
This project uses:
- ESLint for code linting
- Prettier for code formatting
- TypeScript for type safety
- Conventional Commits for commit messages
This project follows Conventional Commits:
feat: add new statistics display feature
fix: resolve data fetching timeout issue
docs: update README with new configuration options
test: add unit tests for stat card component
- Build the application:
npm run build - Package the
distdirectory - Upload to Contentstack marketplace
- Install in your Contentstack stack
For local development with Contentstack:
- Use Contentstack's local development tools
- Configure your stack API key in the manifest
- Run
npm run devfor development server - Access the widget through your Contentstack dashboard
We welcome contributions!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Install dependencies
npm install
# Start development server
npm run dev
# Run tests to ensure everything works
npm run test:chromeThis project is licensed under the MIT License - see the LICENSE file for details.
- Contentstack for the marketplace platform
- Contentstack Management SDK for data fetching capabilities
- Venus Components for the UI components
- Vite for the build tooling and development experience
- Issues: GitHub Issues
- Documentation: Contentstack Developer Hub
- Community: Contentstack Community
Made with β€οΈ by the Contentstack team