Contributions are welcome! Whether you are fixing bugs, adding features, improving documentation, or suggesting ideas, your help makes this project better. This guide covers the contribution workflow, code conventions, and security requirements.Documentation Index
Fetch the complete documentation index at: https://worldmonitor.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
Getting Started
- Fork the repository on GitHub
- Clone your fork locally:
- Install dependencies:
- Create a feature branch:
- Start the development server:
Code Style & Conventions
This project follows specific patterns to maintain consistency: TypeScript- Strict type checking enabled, avoid
anywhere possible - Use interfaces for data structures, types for unions
- Prefer
constoverlet, never usevar
- Services (
src/services/) handle data fetching and business logic - Components (
src/components/) handle UI rendering - Config (
src/config/) contains static data and constants - Utils (
src/utils/) contain shared helper functions
- Expensive computations should run in the Web Worker
- Use virtual scrolling for lists with 50+ items
- Implement circuit breakers for external API calls
- Code should be self-documenting through clear naming
- Only add comments for non-obvious algorithms or workarounds
- Never commit commented-out code
Security & Input Validation
The dashboard handles untrusted data from dozens of external sources. Defense-in-depth measures prevent injection attacks and API abuse.XSS Prevention
All user-visible content is sanitized before DOM insertion:- News headlines and sources (RSS feeds)
- Search results and highlights
- Monitor keywords (user input)
- Map popup content
- Tension pair labels
mark element highlighting in search escapes text before wrapping matches, preventing injection via crafted search queries.
Proxy Endpoint Validation
Serverless proxy functions validate and clamp all parameters:| Endpoint | Validation |
|---|---|
/api/yahoo-finance | Symbol format [A-Za-z0-9.^=-], max 20 chars |
/api/coingecko | Coin IDs alphanumeric+hyphen, max 20 IDs |
/api/polymarket | Order field allowlist, limit clamped 1-100 |
Content Security
- URLs are validated via
URL()constructor, onlyhttp:andhttps:protocols are permitted - External links use
rel="noopener"to prevent reverse tabnapping - No inline scripts or
eval(), all code is bundled at build time
Security Contributions
- Always use
escapeHtml()when rendering user-controlled or external data - Use
sanitizeUrl()for any URLs from external sources - Validate and clamp parameters in API proxy endpoints
Submitting a Pull Request
-
Ensure your code builds:
- Test your changes manually in the browser
-
Write a clear commit message:
-
Push to your fork:
-
Open a Pull Request with:
- A clear title describing the change
- Description of what the PR does and why
- Screenshots for UI changes
- Any breaking changes or migration notes
What Makes a Good PR
| Do | Don’t |
|---|---|
| Focus on one feature or fix | Bundle unrelated changes |
| Follow existing code patterns | Introduce new frameworks without discussion |
| Keep changes minimal and targeted | Refactor surrounding code unnecessarily |
| Update README if adding features | Add features without documentation |
| Test edge cases | Assume happy path only |
Types of Contributions
Bug Fixes- Found something broken? Fix it and submit a PR
- Include steps to reproduce in the PR description
- New data layers (with public API sources)
- UI/UX improvements
- Performance optimizations
- New signal detection algorithms
- Additional RSS feeds for news aggregation
- New geospatial datasets (bases, infrastructure, etc.)
- Alternative APIs for existing data
- Clarify existing documentation
- Add examples and use cases
- Fix typos and improve readability
- Report vulnerabilities via GitHub Issues (non-critical) or email (critical)
- XSS prevention improvements
- Input validation enhancements
Review Process
- Automated checks run on PR submission
- Maintainer review within a few days
- Feedback addressed through commits to the same branch
- Merge once approved
