A modern, customizable progress bar component designed for Contentstack marketplace applications. This app provides an intuitive slider interface that allows Contentstack users (developers, content managers, and content creators) to set and track progress values within their content entries using a custom field.
This app is designed to be installed and used within your Contentstack stack as a custom field. Here's how to get started:
-
Install from Marketplace
- Navigate to your Contentstack stack
- Go to the Marketplace section
- Search for "Progress Bar App" or install directly from the marketplace
- Follow the installation prompts
-
Add to Content Type
- Go to your Content Types
- Edit the content type where you want to add progress tracking
- Add a new custom field
- Select "Progress Bar App" as the field type
- Configure the field settings as needed
-
Start Using
- Create or edit content entries
- Use the progress bar slider to set completion percentages
- Values are automatically saved with your content
If you're a developer looking to contribute or customize this app:
- Node.js (version 16 or higher)
- npm or yarn package manager
- Contentstack account (for testing)
-
Clone the repository
git clone https://github.com/contentstack-expert-services/marketplace-progressbar-app.git cd marketplace-progressbar-app
-
Install dependencies
npm install
-
Start development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
to see the application running.
This project has been migrated from Create React App to Vite for faster development and building. The development environment includes:
- Hot Module Replacement (HMR) for instant updates
- TypeScript for type safety
- ESLint and Prettier for code quality
- Husky for git hooks and pre-commit validation
npm run dev
ornpm start
- Start the development server with HMRnpm run build
- Build the app for productionnpm run preview
- Preview the production build locally
npm test
- Run tests in watch mode with Vitestnpm run test:ui
- Run tests with Vitest UI interfacenpm run test:run
- Run tests once (CI mode)npm run test:coverage
- Run tests with coverage report
npm run test:chrome
- Run Playwright tests in Chromenpm run test:firefox
- Run Playwright tests in Firefoxnpm run test:safari
- Run Playwright tests in Safarinpm run test:chrome-headed
- Run Playwright tests in Chrome (headed mode)npm run show-report
- Show Playwright test report
npm run prettify
- Format code with Prettiernpm run lint:fix
- Fix ESLint issues automaticallynpm run precommit
- Run prettify and lint:fix (used in git hooks)
src/
βββ components/ # Reusable UI components
β βββ ErrorBoundary/ # Error boundary component
βββ containers/ # Main application containers
β βββ App/ # Main app component and routing
β βββ CustomField/ # Progress bar custom field component
βββ hooks/ # Custom React hooks
β βββ useJsErrorTracker.tsx
βββ common/ # Shared utilities and types
β βββ types/ # TypeScript type definitions
βββ test/ # Test setup and utilities
Create a .env
file in the root directory for local development:
# Add your environment variables here
VITE_APP_TITLE=Marketplace Progress Bar App
The project uses Vite with the following key configurations:
- Port: 3000 (configurable in
vite.config.ts
) - Source Maps: Enabled for better debugging
- React Plugin: Configured for JSX support
- Framework: Vitest
- Testing Library: React Testing Library
- Coverage: Istanbul for coverage reports
- Framework: Playwright
- Browsers: Chrome, Firefox, Safari
- Configuration:
playwright.config.ts
# Run all unit tests
npm test
# Run tests with coverage
npm run test:coverage
# Run E2E tests
npm run test:chrome
# Build the application
npm run build
# Preview the production build
npm run preview
The build output will be in the dist/
directory, ready for deployment.
Once the Progress Bar App is installed in your Contentstack stack:
-
Creating Content with Progress Tracking
- Navigate to your content entries
- Create a new entry or edit an existing one
- Find the Progress Bar field in your content form
- Use the slider to set the completion percentage (0-100%)
- The value is automatically saved when you save the content
-
Understanding the Progress Bar
- The slider shows a visual representation of completion
- Values range from 0% (not started) to 100% (completed)
- The current value is displayed above the slider
- Changes are saved automatically as you move the slider
-
Best Practices
- Use consistent progress values across your team
- Update progress regularly to maintain accurate tracking
- Consider using this for project milestones, content completion, or task tracking
-
Build the application:
npm run build
-
Upload the
dist/
folder contents to your Contentstack marketplace app -
Configure the app in your Contentstack stack
For different environments, you can create environment-specific build scripts:
# Development build
npm run build:dev
# Staging build
npm run build:staging
# Production build
npm run build:prod
We welcome contributions! Please follow these guidelines:
-
Fork the repository
-
Create a feature branch following the naming convention:
feature/ESI-XXXX-descriptive-name bugfix/ESI-XXXX-descriptive-name hotfix/ESI-XXXX-descriptive-name
-
Make your changes
-
Run tests and linting:
npm run precommit
-
Commit your changes with a clear commit message
-
Push to your fork and create a Pull Request
- Follow the existing code style (enforced by ESLint and Prettier)
- Write tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting
Branches must follow this pattern:
^(feature|bugfix|hotfix)/ESI-[0-9]+-[a-z0-9-]{5,30}$
Examples:
feature/ESI-1234-add-new-progress-theme
bugfix/ESI-5678-fix-slider-value-persistence
hotfix/ESI-9999-critical-security-fix
Issue: Development server won't start
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
Issue: Tests failing
# Clear test cache
npm run test:run -- --reporter=verbose
Issue: Build errors
# Check TypeScript errors
npx tsc --noEmit
For support and questions:
- Create an issue
- Check the documentation
Made with β€οΈ by the Contentstack team