A comprehensive boilerplate template for MapColonies applications built with React, TypeScript and i18n support.
- ⚛️ React 18 with TypeScript
- 🌍 i18n - Hebrew and English language support
- 🚦 React Router - Client-side routing
- 🐳 Docker - Containerization support
- ⎈ Helm - Kubernetes deployment
- 🔄 Release Please - Automated releases and changelogs
- 🛠️ Runtime Configuration - Environment variables support via confd
- Node.js 16
- yarn
# Clone the repository
git clone https://github.com/MapColonies/app-boilerplate.git
cd app-boilerplate
# Install dependencies
yarn
# Generate runtime environment variables
yarn confd
# Start development server
yarn startThe application will be available at http://localhost:3000
yarn global add serve
# Build for production
yarn build
# Preview production build
npx serve -s build
# Lint code
yarn eslint:fix
# Format code
yarn prettier:fix# Build Docker image
docker build -t app-boilerplate .
# Run container
docker run -p 3000:8080 \
-e CONFIGURATION_LANGUAGE=en \
app-boilerplate# Install the Helm chart
helm install app-boilerplate ./helm \
--set image.repository=your-registry/app-boilerplate \
--set image.tag=latest \
--set env.language=en
# Upgrade the deployment
helm upgrade app-boilerplate ./helm
# Uninstall
helm uninstall app-boilerplateThe application supports Hebrew (RTL) and English (LTR) languages. Add translations in:
src/i18n/locales/en.jsonsrc/i18n/locales/he.json
Use the useIntl hook from react-intl:
import { useIntl } from 'react-intl';
const Component = () => {
const intl = useIntl();
return <h1>{intl.formatMessage({ id: 'app.title' })}</h1>;
};Important
We depend on Red-Hat Yaml Extension for validating the values files against the relevant schemas from helm-common.
That means, you should install the extension from vscode in order to be able to edit values files according to our schemas.
To update helm dependencies
yarn helm-updateIn order to create/renew values schemas
yarn helm-assetsTo deploy: helm values MUST be combined from global.yaml and values.yaml (use npm script!)
yarn helm-installSee helm values
This project uses Release Please for automated releases.
Follow Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changeschore:- Maintenance tasks
- Fork the repository
- Create a feature branch
- Commit your changes using conventional commits
- Push to the branch
- Create a Pull Request
MIT
For support and questions, please open an issue in the GitHub repository.