Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 30, 2025

This PR implements a production-ready monorepo structure for the Biodiversity Indicator Service (BioIS) with three integrated components:

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Angular UI     β”‚  ← Interactive web interface
β”‚  (TypeScript)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ HTTP/REST
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  TS Bindings    β”‚  ← Auto-generated type-safe client
β”‚  (Generated)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ Type-safe calls
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Rust Service   β”‚  ← Backend API with OpenAPI
β”‚  (Axum/utoipa)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ What's Included

1. Rust Biodiversity Indicator Service (service/)

  • Built with Axum 0.7 web framework for high performance
  • utoipa 5.x for automatic OpenAPI specification generation from Rust code
  • Embedded Swagger UI at /swagger-ui for interactive API documentation
  • Three API endpoints ready for biodiversity calculations:
    • GET /health - Health check
    • GET /indicators - List available biodiversity indicators
    • POST /indicators/calculate - Calculate indicators for geographic areas
  • CORS enabled for frontend integration
  • Prepared for integration with geoengine API and georust/ogcapi

2. TypeScript OpenAPI Bindings (bindings/)

  • Auto-generated TypeScript types from OpenAPI specification
  • Type-safe client using openapi-fetch
  • Published as npm package @biois/bindings
  • Zero runtime overhead - types are compile-time only
  • Full IDE support with autocomplete and type checking

3. Angular Frontend (frontend/)

  • Angular 19+ with standalone components architecture
  • Signal-based state management for reactive UI
  • Service layer integrating TypeScript bindings for type-safe API calls
  • Interactive form for:
    • Selecting biodiversity indicators
    • Entering geographic bounding boxes
    • Calculating and displaying results
  • Comprehensive error handling and loading states

4. CI/CD Pipeline (.github/workflows/ci.yml)

GitHub Actions workflow with three sequential jobs:

  • rust: Build service, run tests, check formatting (rustfmt) and linting (clippy)
  • bindings: Generate OpenAPI spec and build TypeScript bindings
  • frontend: Build and test Angular application

Includes caching for npm and Rust toolchain to speed up builds.

5. Comprehensive Documentation

  • README.md - Project overview and development guide
  • QUICKSTART.md - Get up and running in 5 minutes
  • ARCHITECTURE.md - Detailed system design with diagrams
  • CONTRIBUTING.md - Development guidelines and workflow
  • IMPLEMENTATION_SUMMARY.md - Technical implementation notes

6. Developer Tools

  • build-all.sh - One command to build the entire monorepo
  • test-all.sh - Run all tests across all components
  • Comprehensive .gitignore covering Rust, Node.js, and Angular artifacts

🎯 Key Features

  • End-to-end type safety: Changes to the Rust API automatically propagate to TypeScript/Angular
  • Single source of truth: API defined in Rust code, everything else auto-generated
  • Self-documenting: Swagger UI provides always up-to-date interactive documentation
  • Modern development workflow: Fast iteration with automatic code generation
  • Production-ready structure: Proper separation of concerns, comprehensive testing, and CI/CD

🚦 Quick Start

# Build everything
./build-all.sh

# Terminal 1: Start the Rust service
cd service && cargo run

# Terminal 2: Start the Angular frontend
cd frontend && npm start

# Open http://localhost:4200
# API docs at http://localhost:3000/swagger-ui

πŸ“Š Development Workflow

  1. Define API in Rust with utoipa annotations
  2. Generate OpenAPI spec automatically from Rust code
  3. Generate TypeScript types automatically from OpenAPI spec
  4. Use in Angular with full type safety and autocomplete

Changes to the API are type-checked across the entire stack!

πŸ”œ Ready for Enhancement

The structure is prepared for:

  • Integration with geoengine API for real biodiversity data
  • Integration with georust/ogcapi for OGC API Features support
  • Real biodiversity calculation algorithms
  • Database layer for persistence
  • Authentication and authorization
  • Docker deployment

βœ… Testing

All components build and test successfully:

  • Rust: cargo build && cargo test && cargo clippy
  • Bindings: npm run build
  • Frontend: npm run build

The CI pipeline validates the entire build chain on every commit.

Original prompt

Monorepo with

  • Rust project for a biodiversity indicator service, using geoengine API and georust/ogcapi.
  • OpenAPI bindings for typescript, based on Rust service
  • Angular/Typescript project which uses OpenAPI bindings
  • .gitignore that covers all three things
  • CI that tests everything

✨ Let Copilot coding agent set things up for you β€” coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits September 30, 2025 14:23
@Copilot Copilot AI changed the title Monorepo with - Rust project for a biodiversity indicator service, using geoengine API and georust/ogcapi. - OpenAPI bindings for typescript, based on Rust service - Angular/Typescript project which uses OpenAPI bindings - .gitignore that covers all t... Implement complete BioIS monorepo with Rust service, TypeScript bindings, and Angular frontend Sep 30, 2025
Copilot finished work on behalf of ChristianBeilschmidt September 30, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants