A modern, accessible star rating custom field extension for Contentstack marketplace apps. This React-based application provides an intuitive rating interface that integrates seamlessly with Contentstack's content management system.
- Interactive Star Rating: Intuitive click and hover interactions for rating selection
- Half-Star Ratings: Optional half-star precision for more granular ratings
- TypeScript: Fully typed for better development experience
- Testing: Comprehensive test suite with Playwright for E2E testing
- Modern UI: Clean, professional interface using Contentstack's Venus components
- Display Modes: Show ratings as stars, numbers, or both
- Node.js (v20 or higher)
- npm
- Contentstack account
# Clone the repository
git clone https://github.com/contentstack/marketplace-starrating-app.git
cd marketplace-starrating-app
# Install dependencies
npm install
# Start development server
npm run dev
# Run E2E tests
npm run test:chrome
# Build the application
npm run build
#Serve the application
npm run serve
marketplace-starrating-app/
βββ src/
β βββ components/ # Reusable React components
β βββ containers/ # Main app containers
β β βββ App/ # Main app component
β β βββ CustomField/ # Star rating custom field
β β βββ 404/ # 404 error page
β βββ common/
β β βββ contexts/ # React contexts
β β βββ hooks/ # Custom React hooks
β β βββ locales/ # Internationalization
β β βββ providers/ # Context providers
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Utility functions
β βββ assets/ # Static assets
βββ e2e/ # End-to-end tests
βββ public/ # Public assets
βββ config files...
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:safari # Run E2E tests in Safari
npm run lint # Run ESLint
npm run lint:fix # Fix linting issues
npm run typecheck # TypeScript type checking
npm run format # Format code with Prettier
Create a .env
file in the root directory:
REACT_APP_STACK_API_KEY=your_stack_api_key
REACT_APP_ENVIRONMENT=your_environment
The app configuration is defined in update-app-info.json
:
{
"name": "Star Rating",
"target_type": "stack",
"ui_location": {
"locations": [
{
"type": "cs.cm.stack.custom_field",
"meta": [
{
"signed": true,
"path": "/custom-field",
"data_type": "number"
}
]
}
]
}
}
- Create feature branch from
main
- Implement your changes
- Add tests for new functionality
- Update documentation
- Submit pull request
This project uses:
- ESLint for code linting
- Prettier for code formatting
- Husky for git hooks
- lint-staged for pre-commit checks
This project follows Conventional Commits:
We welcome contributions! Please see the following guide for details.
- 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.
This project is licensed under the MIT License - see the LICENSE file for details.
- Contentstack for the amazing CMS platform.
- Issues: GitHub Issues
- Documentation: Contentstack Developer Hub
- Marketplace: Contentstack Marketplace App Guide
- Community: Contentstack Community
Made with β by the Contentstack team