- Node.js (v18 or higher)
- pnpm package manager
- Git
- GitHub account (for deployment)
# Clone or use template
git clone <repository-url>
# or create from template
# Navigate to project directory
cd webstats
# Install dependencies
pnpm installwebstats/
├── apps/
│ ├── site/ # Frontend application
│ └── runner/ # Monitoring engine
├── data/ # Monitoring data
├── scripts/ # Utility scripts
├── docs/ # Documentation
├── .github/ # GitHub Actions workflows
├── monitor.config.yml # Main configuration
├── pnpm-workspace.yaml # Workspace configuration
└── package.json # Root configuration# Start both applications in development mode
pnpm dev
# Start just the frontend
cd apps/site && pnpm dev
# Start just the runner
cd apps/runner && pnpm dev- Main Config:
monitor.config.yml - Frontend Config:
apps/site/astro.config.mjs - Runner Config:
apps/runner/tsconfig.json - Workspace Config:
pnpm-workspace.yaml
None required for local development
- Use strict mode (
"strict": true) - Prefer interfaces over types
- Use JSDoc for exported functions/classes
- Follow naming conventions (PascalCase for classes, camelCase for functions)
- Use Tailwind CSS utility classes
- Component-based architecture
- Type-safe props with Astro
- Semantic HTML elements
- Accessibility considerations
- Async/await for asynchronous operations
- Error handling for network requests
- Type safety for configuration objects
- Logging for debugging purposes
# Build both applications
pnpm build
# Build frontend only
cd apps/site && pnpm build
# Build runner only
cd apps/runner && pnpm build# No automated tests currently (planned for future)
# Manual testing workflow:
# 1. Update monitor.config.yml with test services
# 2. Run runner locally: pnpm runner:check
# 3. Verify data generation in data/ directory
# 4. Run site locally: pnpm site:dev
# 5. Verify data display on status pages# Run monitoring checks locally
cd apps/runner && pnpm build
cd .. && node apps/runner/dist/index.js
# Verify data was generated
ls -la data/checks/
ls -la data/summary/- Edit
monitor.config.yml - Add new service to
servicesarray - Configure URL, assertions, and grouping
- Commit changes to trigger GitHub Actions
- Create new file in
apps/site/src/pages/ - Use Astro syntax and layout
- Import necessary components
- Add navigation link if needed
- Locate component in
apps/site/src/components/ - Update Astro component
- Test in development mode
- Verify responsive behavior
- Modify
apps/runner/src/index.ts - Update data structures if needed
- Test locally with sample configuration
- Verify data compatibility with frontend
- Enable GitHub Actions in repository settings
- Configure GitHub Pages source to "GitHub Actions"
- Push changes to main branch
- Monitor workflow runs in Actions tab
- Configure DNS with CNAME record
- Set custom domain in GitHub Pages settings
- Update
monitor.config.ymlwith custom domain - Commit changes to trigger deployment
- Monitor Workflow: Runs every 5 minutes via cron
- Deploy Workflow: Runs on pushes to main branch
- Cleanup Workflow: Runs weekly to maintain data
- Check GitHub Actions permissions
- Verify workflow files are in
.github/workflows/ - Ensure runner builds successfully
- Confirm service URLs are accessible
- Verify data files exist in
data/directory - Check file permissions and formats
- Confirm Astro can read configuration
- Verify build process completes successfully
- Check workflow syntax
- Verify permissions in workflow files
- Ensure dependencies are properly installed
- Confirm pnpm is available in runner environment
# Check runner locally
cd apps/runner && pnpm build && cd .. && node apps/runner/dist/index.js
# Check site build
cd apps/site && pnpm build
# Verify data structure
cat data/summary/*.json
cat data/checks/*.ndjson | head -n 5
# Check configuration validity
node -e "console.log(require('js-yaml').load(require('fs').readFileSync('monitor.config.yml', 'utf8')))"- Optimize timeout values in config
- Adjust concurrency settings
- Group related services for efficiency
- Monitor GitHub Actions execution time
- Minimize external dependencies
- Optimize image assets
- Use efficient data loading strategies
- Implement caching where appropriate
- Regular cleanup of old data
- Efficient NDJSON storage format
- Incremental data updates
- Compression for large datasets
main: Production-ready code- Feature branches: New functionality
- Pull requests: Code review and testing
Follow conventional commits:
feat: add new monitoring service
fix: resolve data parsing issue
docs: update configuration guide
style: refactor component styling
refactor: improve monitoring logic
test: add unit tests for runner
chore: update dependencies
- Keep related files together
- Use descriptive names
- Maintain consistent structure
- Document significant changes
- Monitor GitHub Actions workflows
- Review monitoring data quality
- Update dependencies periodically
- Verify custom domain configurations
- Weekly cleanup of old monitoring data
- Verification of data integrity
- Backup of important configurations
- Archive historical information
- Keep dependencies updated
- Review third-party integrations
- Protect sensitive configuration
- Monitor for vulnerabilities