Development Documentation β
Welcome to the MeshMonitor development documentation. This section covers everything you need to know to contribute to or extend MeshMonitor.
Getting Started with Development β
Prerequisites β
- Node.js 18 or later
- npm or pnpm
- Git
- A Meshtastic device or
meshtasticd - SQLite3 (optional, for database inspection)
Development Setup β
See the Development Setup guide for detailed instructions on setting up your development environment.
Project Structure β
meshmonitor/
βββ src/
β βββ server/ # Backend Express.js application
β βββ components/ # React components
β βββ hooks/ # React custom hooks
β βββ services/ # Frontend services
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
βββ docs/ # Documentation (VitePress site)
βββ helm/ # Kubernetes Helm charts
βββ public/ # Static assets
βββ tests/ # Test files
βββ docker-compose.yml # Docker Compose configurationKey Technologies β
Frontend β
- React 19: UI framework
- TypeScript: Type safety
- Leaflet: Interactive maps
- Recharts: Data visualization
- Vite: Build tool and dev server
Backend β
- Node.js: Runtime
- Express 5: Web framework
- TypeScript: Type safety
- better-sqlite3: Database
- Protobuf: Meshtastic protocol
- openid-client: OIDC authentication
Development Guides β
Development Setup β
Complete guide to setting up your local development environment, including Docker and native setups.
Architecture β
Overview of MeshMonitor's architecture, design patterns, and system components.
Database β
Database schema, migrations, and data models.
Authentication β
Authentication system implementation, including local auth and OIDC.
API Documentation β
Complete API reference for all endpoints.
Development Workflow β
1. Fork and Clone β
# Fork the repository on GitHub, then clone
git clone https://github.com/YOUR_USERNAME/meshmonitor.git
cd meshmonitor2. Create a Branch β
# Create a feature branch
git checkout -b feature/my-new-feature3. Make Changes β
# Start development server
npm run dev:full
# Make your changes...4. Test β
# Run tests
npm test
# Run type checking
npm run typecheck
# Run linter
npm run lint5. Commit β
# Add changes
git add .
# Commit with descriptive message
git commit -m "feat: add new feature"6. Push and Create PR β
# Push to your fork
git push origin feature/my-new-feature
# Create pull request on GitHubCode Style β
TypeScript β
- Use TypeScript for all new code
- Enable strict mode
- Define types for all function parameters and return values
- Use interfaces for object shapes
React β
- Use functional components with hooks
- Keep components small and focused
- Use custom hooks for reusable logic
- Follow React best practices
Naming Conventions β
- Files:
camelCase.tsfor utilities,PascalCase.tsxfor components - Components:
PascalCase - Functions:
camelCase - Constants:
UPPER_SNAKE_CASE - Interfaces/Types:
PascalCase
Testing β
MeshMonitor uses Vitest for testing.
Running Tests β
# Run all tests
npm test
# Watch mode
npm test -- --watch
# With coverage
npm run test:coverage
# UI mode
npm run test:uiSystem Tests (End-to-End) β
We also have a comprehensive system test suite that verifies the full deployment using Docker.
# Run the full system test suite (builds fresh Docker image)
./tests/system-tests.sh
# Run tests against your running dev environment (Fast!)
./tests/dev-test.sh
# Run tests against a specific Meshtastic node
TEST_NODE_IP=192.168.1.50 ./tests/system-tests.shWriting Tests β
import { describe, it, expect } from 'vitest';
import { myFunction } from './myFunction';
describe('myFunction', () => {
it('should do something', () => {
const result = myFunction('input');
expect(result).toBe('expected');
});
});Building β
Development Build β
npm run buildProduction Build β
NODE_ENV=production npm run build
npm run build:serverDocker Build β
docker build -t meshmonitor:latest .Contributing β
We welcome contributions! Please:
- Check existing issues or create a new one
- Fork the repository
- Create a feature branch
- Make your changes
- Write/update tests
- Ensure all tests pass
- Submit a pull request
Commit Message Format β
We follow Conventional Commits:
<type>(<scope>): <subject>
<body>
<footer>Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding/updating testschore: Maintenance tasks
Examples:
feat(auth): add OIDC support
fix(map): correct node positioning
docs(readme): update installation instructionsResources β
- TypeScript Documentation
- React Documentation
- Vitest Documentation
- Meshtastic Documentation
- Meshtastic Protobufs
Getting Help β
- GitHub Issues: Report bugs or request features
- GitHub Discussions: Ask questions or discuss ideas
- Documentation: Check this documentation first
- Code Comments: Read inline comments in the codebase