A React-based user interface for the Meshflow system.
- Node.js 20.x or later
- npm 9.x or later
- Docker (optional, for containerized development)
- Install dependencies:
npm install- Start the development server:
npm run devThe application will be available at http://localhost:5173 by default.
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run preview- Preview production build locallynpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run format:staged- Format only staged files with Prettiernpm run type-check- Run TypeScript type checkingnpm run prepare- Set up Git hooks (runs automatically afternpm install)
The project uses Husky to manage Git hooks:
-
Pre-commit hook: Automatically runs before each commit
- TypeScript build check (
tsc -b) - ESLint check (
npm run lint) - Prettier format check (only on staged files)
- Tests (
npm test) - Ensures that only code that passes all checks can be committed
- To skip the pre-commit hook (not recommended), use
git commit --no-verify
- TypeScript build check (
-
Commit-msg hook: Validates commit message format
- Ensures commit messages follow the Conventional Commits format
- Example:
feat: add new featureorfix: resolve bug in component
The Git hooks are automatically set up when you run npm install thanks to the prepare script in package.json. If you need to manually set up the hooks (for example, after cloning the repository), you can run:
npm run prepareThis will install and configure Husky to manage the Git hooks for this project.
The application is containerized using a multi-stage Docker build process:
-
Build stage:
- Uses Node.js 20 Alpine as base
- Installs dependencies
- Builds the application
- Injects version from build argument
-
Production stage:
- Uses Nginx Alpine as base
- Serves static files
- Runs as non-root user for security
The application version is injected during the build process:
- Development: Uses 'development' as default version
- Production: Version is set from GitHub release tag or manual build argument
The Docker image is built for multiple architectures:
- linux/amd64
- linux/arm64
Images are automatically built and pushed to GitHub Container Registry (ghcr.io) on:
- Release publication
- Manual workflow trigger
latest- Latest stable releaselatest-rc- Latest release candidate{version}- Specific version (e.g., v1.0.0){version}-{platform}- Platform-specific builds
MeshflowUI/
├── src/ # Source code
│ ├── components/ # React components
│ ├── types/ # TypeScript type definitions
│ └── App.tsx # Main application component
├── public/ # Static assets
├── deploy/ # Deployment configurations
│ └── docker/ # Docker-related files
└── .github/ # GitHub Actions workflows
The application uses a configuration system that:
- Loads default configuration from
config.ts - Can be overridden by a remote
config.json - Supports environment-specific settings
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request