Skip to content

contentstack/marketplace-starrating-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Marketplace Star Rating App

License: MIT TypeScript React Playwright

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.

⭐ Features

  • 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

πŸ“‹ Prerequisites

  • Node.js (v20 or higher)
  • npm
  • Contentstack account

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/contentstack/marketplace-starrating-app.git
cd marketplace-starrating-app

# Install dependencies
npm install

Development

# Start development server
npm run dev

# Run E2E tests
npm run test:chrome

Building for Production

# Build the application
npm run build

#Serve the application
npm run serve

πŸ—οΈ Project Structure

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...

πŸ§ͺ Testing

This project includes comprehensive testing:

E2E Tests

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

Code Quality

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

πŸ”§ Configuration

Environment Variables

Create a .env file in the root directory:

REACT_APP_STACK_API_KEY=your_stack_api_key
REACT_APP_ENVIRONMENT=your_environment

App Configuration

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"
          }
        ]
      }
    ]
  }
}

πŸ› οΈ Development

Adding New Features

  1. Create feature branch from main
  2. Implement your changes
  3. Add tests for new functionality
  4. Update documentation
  5. Submit pull request

Code Style

This project uses:

  • ESLint for code linting
  • Prettier for code formatting
  • Husky for git hooks
  • lint-staged for pre-commit checks

Commit Convention

This project follows Conventional Commits:

🀝 Contributing

We welcome contributions! Please see the following guide for details.

How to Contribute

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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ⭐ by the Contentstack team

About

This is a modern, accessible Star Rating custom field app for Contentstack.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 6