resilienceatlas
Resilience Atlas - Evidence-based decision-making around resilience
https://github.com/ConservationInternational/resilienceatlas
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Resilience Atlas - Evidence-based decision-making around resilience
Basic Info
- Host: GitHub
- Owner: ConservationInternational
- License: mit
- Language: Jupyter Notebook
- Default Branch: develop
- Size: 179 MB
Statistics
- Stars: 13
- Watchers: 6
- Forks: 3
- Open Issues: 7
- Releases: 5
Topics
Metadata Files
README.md
Resilience Atlas
Architecture
This repository contains all the code and documentation necessary to set up and deploy the project. It is organised in 4 main subdirectories, with accompanying documentation inside each.
| Subdirectory name | Description | Documentation | Tech Stack | |-------------------|-------------------------------------------------------------|--------------------------------------------------------|-------------------------------| | frontend | Frontend application | frontend/README.md | React 18.3.1, Next.js 14.2.15, Node.js 22.11.0 | | backend | The Ruby on Rails backend application (API + backoffice) | backend/README.md | Ruby 3.4.4, Rails 7.2.x | | cloud_functions | cloud functions code folder | cloud_functions/README.md | Various AWS Lambda functions | | infrastructure | The Terraform project for TiTiler COG tiler as AWS lambda | infrastructure/README.md | Terraform, AWS | | data | data folder where diverse scripts for data management lives | data/README.md | Various data processing tools |
CI/CD Process
The project uses GitHub Actions for continuous integration and deployment. The CI/CD workflows are organized into comprehensive testing and deployment categories:
Testing Workflows
The project implements comprehensive testing with Docker-based workflows:
Backend Tests (backend_tests.yml)
- Testing: RSpec test suite with PostgreSQL database
- System Tests: Capybara-based browser tests for admin interface using Chrome
- Linting: RuboCop code style checks
- Security: Brakeman security analysis and Bundle Audit for dependency vulnerabilities
- Triggers: Runs on pushes/PRs to the
backend/directory
Frontend Tests (frontend_tests.yml)
- Unit Testing: Jest tests for components and utilities
- E2E Testing: Cypress tests on Chrome and Firefox browsers
- Linting: ESLint and TypeScript validation
- Build Verification: Ensures application builds successfully
- Triggers: Runs on pushes/PRs to the
frontend/directory
Integration Tests (integration_tests.yml)
- Full-Stack Testing: Complete frontend-backend integration testing
- API Testing: Backend integration tests focused on API endpoints
- Performance Testing: Basic response time validation
- Data Consistency: Verifies data flows correctly between systems
- Triggers: Runs on pushes/PRs to
developandmainbranches
Key testing features: - Docker-based isolated test environments - Multi-browser E2E testing (Chrome and Firefox) - System tests for admin interface using Capybara and Chrome - Comprehensive test reporting with JUnit integration - Test artifacts collection (screenshots, videos on failure) - Health checks and service dependency management
Build Optimization
The project uses advanced Docker buildx caching strategies to significantly speed up CI/CD builds:
Caching Features
- Content-based cache keys: Cache invalidation based on Dockerfile and dependency file changes
- Multi-level fallback: Progressive cache key fallback for maximum cache reuse
- GitHub Actions cache: Persistent caching across workflow runs (10GB limit)
- Registry-based caching: Future-ready for cross-repository layer sharing
- Coordinated builds: Docker Bake configuration for multi-service coordination
Performance Benefits
- 50-80% reduction in build times for incremental changes
- 90%+ cache hit rate for dependency-only changes
- Parallel build execution with shared cache layers
- Reduced GitHub Actions minutes consumption
Developer Tools
- Cache validation script:
./test-docker-cache.shfor local testing - Cache analytics: Build-time performance monitoring
- Documentation: Comprehensive caching strategy in
.github/DOCKER_CACHE_STRATEGY.md
Cache keys are generated based on: - Dockerfile content hashes - Dependency file hashes (Gemfile.lock, package-lock.json) - Runtime versions (Ruby, Node.js) - Daily cache refresh for staleness prevention
See .github/TESTING.md for detailed testing documentation.
EC2 Deployment Workflows
The project uses AWS EC2 instances for deployment with separate workflows for staging and production:
Staging Deployment (ec2_deploy_staging.yml)
- Triggers: Pushes to the
developbranch (after tests pass) - Target: staging.resilienceatlas.org
- Features: Deploys directly to EC2 instance using Docker Compose
- Environment: Uses staging-specific environment variables and secrets
- Database Refresh: Automatically copies production database to staging before deployment
Production Deployment (ec2_deploy_production.yml)
- Triggers: Pushes to the
mainbranch (after all tests pass) - Target: resilienceatlas.org
- Features: Deploys directly to EC2 instance using Docker Compose
- Environment: Uses production-specific environment variables and secrets
Key deployment features: - Direct EC2 deployment using Docker Compose - Application Load Balancer for traffic routing - Just-in-time SSH access during deployment - Automatic database refresh for staging environment - Health checks and rollback capabilities - AWS Secrets Manager for secure credential management - Deployment only proceeds after all relevant tests pass - Staging database refresh: Production data automatically copied to staging for realistic testing
TiTiler COGs Workflows
The TiTiler COGs service has dedicated workflows for AWS Lambda deployment:
TiTiler COGs Deployment (titiler_cogs_deployment.yaml)
- Feature Branch Deployment: Automatically deploys feature branches to isolated AWS stacks for testing
- Production Deployment: Deploys master branch to production stack
- Manual Deployment: Supports workflow dispatch for manual deployments
- Triggers: Runs on pushes to
cloud_functions/titiler_cogs/directory
Key features: - Uses AWS SAM CLI for serverless application deployment - Creates isolated stacks for each feature branch with unique FQDNs - Container-based builds for consistent environments - Role-based AWS authentication for secure deployments - Supports custom domain names via Route53
TiTiler COGs Cleanup (titiler_cogs_cleanup.yaml)
- Automatic Cleanup: Removes AWS stacks when feature branches are deleted
- Manual Cleanup: Supports workflow dispatch for manual stack deletion
- Cost Optimization: Prevents accumulation of unused AWS resources
The TiTiler COGs service provides dynamic tile generation for Cloud Optimized GeoTIFFs (COGs) and is deployed as AWS Lambda functions behind API Gateway. See cloudfunctions/titilercogs/README.md for detailed deployment and usage instructions.
Production Deployment
AWS EC2 Deployment
The application is deployed directly to AWS EC2 instances using Docker Compose for both staging and production environments:
- Staging: staging.resilienceatlas.org (deployed from
developbranch) - Production: resilienceatlas.org (deployed from
mainbranch)
Deployment Architecture
- Hosting: EC2 instances running Docker Compose
- Load Balancing: Application Load Balancer for traffic distribution and SSL termination
- Secret Management: Environment variables and AWS Secrets Manager for secure configuration
- SSH Access: Just-in-time SSH access during deployments for security
- Monitoring: CloudWatch logs and instance metrics
Setting Up EC2 Deployment
Prerequisites: AWS account with appropriate IAM permissions, Python 3.8+, AWS CLI configured
Infrastructure Setup:
bash cd scripts pip install -r requirements.txt ./setup_complete_infrastructure.shConfigure GitHub Actions: Set up repository secrets for automatic deployments
Environment Configuration: Update environment files and AWS secrets with real values
See scripts/README.md for detailed setup instructions and script documentation.
Docker Setup
The project includes Docker configuration for easy development and deployment. There are three Docker Compose configurations:
docker-compose.yml- Production setup (frontend + backend only)docker-compose.dev.yml- Development setup (includes PostgreSQL database)docker-compose.test.yml- Test environment for running automated tests
Prerequisites
Quick Start
Clone the repository and navigate to the project root
Set up environment variables ```bash cp .env.example .env
Edit .env with your configuration values
```
For development (includes database):
bash docker compose -f docker-compose.dev.yml up --build
This will start: - PostgreSQL database on port 5432 - Backend API on http://localhost:3001 - Frontend application on http://localhost:3000
- For production:
bash docker compose up --build
This will start: - Backend API on http://localhost:3001 - Frontend application on http://localhost:3000
Note: For production, you need to provide your own PostgreSQL database via the DATABASE_URL environment variable.
Running Tests
Backend Tests (RSpec)
```bash
Run all backend tests (linting, security, unit tests - excludes system tests by default)
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test
Run all tests including system tests
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test rspec
Run specific test commands
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test rspec docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test lint docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test security docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test audit
Run specific test file
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test rspec spec/models/user_spec.rb
Show all available commands
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test help ```
Frontend Tests (ESLint/TypeScript/Prettier)
```bash
Run all frontend checks (linting, type-check, prettier, build)
docker compose -f docker-compose.test.yml run --rm --no-deps frontend-test ./bin/test
Run specific test commands
docker compose -f docker-compose.test.yml run --rm --no-deps frontend-test ./bin/test lint docker compose -f docker-compose.test.yml run --rm --no-deps frontend-test ./bin/test type-check docker compose -f docker-compose.test.yml run --rm --no-deps frontend-test ./bin/test prettier docker compose -f docker-compose.test.yml run --rm --no-deps frontend-test ./bin/test build
Run Cypress e2e tests (requires backend services)
docker compose -f docker-compose.test.yml run --rm frontend-test ./bin/test cypress
Show all available commands
docker compose -f docker-compose.test.yml run --rm --no-deps frontend-test ./bin/test help ```
System Tests (Browser-based)
System tests use Capybara with Chrome to test the admin interface and user interactions:
```bash
Run system tests only (with Chrome verification)
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test system
Run system tests (skip Chrome verification)
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test system-force
Verify Chrome setup for system tests
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test verify-chrome
Run specific system test file
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test system spec/systems/admin/auth_spec.rb ```
System tests cover: - Admin authentication and authorization - CRUD operations for all admin models (layers, indicators, journeys, etc.) - File uploads and data management - User interface interactions - Browser-based workflows
Note: System tests require Chrome and Xvfb for headless browser testing. They are excluded from the default test run due to longer execution time.
Integration Tests (Full E2E)
bash
docker compose -f docker-compose.test.yml up --abort-on-container-exit
Fixing Linting Issues
The project uses ESLint and RuboCop for code quality enforcement. Common issues and their fixes:
Backend (RuboCop)
```bash
Auto-fix most RuboCop issues
docker compose -f docker-compose.test.yml run --rm backend-test bash -c "bundle exec rubocop -A"
Run specific checks
docker compose -f docker-compose.test.yml run --rm backend-test ./bin/test lint ```
Frontend (ESLint)
Common ESLint warnings and fixes:
- Console statements: Add
// eslint-disable-next-line no-consolebefore console statements in development code - Unused variables: Remove unused imports and variables, or prefix with underscore if needed for interface compliance
- React Hook dependencies: Add missing dependencies to useEffect, useCallback, and useMemo dependency arrays
- TypeScript any types: Add `// eslint-disable-next-line @typescript-eslint/no-explicit
Owner
- Name: Conservation International
- Login: ConservationInternational
- Kind: organization
- Repositories: 47
- Profile: https://github.com/ConservationInternational
GitHub Events
Total
- Issues event: 21
- Delete event: 12
- Issue comment event: 52
- Push event: 92
- Pull request review event: 5
- Pull request event: 47
- Create event: 21
Last Year
- Issues event: 21
- Delete event: 12
- Issue comment event: 52
- Push event: 93
- Pull request review event: 5
- Pull request event: 47
- Create event: 21
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Clara Linos | c****a@s****s | 689 |
| David Inga | d****a@v****m | 221 |
| Alvaro Leal | p****e@g****m | 163 |
| martintomas | m****t@g****m | 111 |
| Alex Zvoleff | a****f@c****g | 95 |
| Simao Rodrigues | a****o@g****m | 80 |
| Clément Prod'homme | c****e@v****m | 72 |
| paulahaertel | p****l@m****g | 67 |
| Gerardo | g****o@v****m | 65 |
| Miguel Mendoza | m****a@v****m | 63 |
| Tiago Garcia | t****g@g****m | 61 |
| Alicia | a****a@g****m | 52 |
| Alicia | a****a@M****l | 46 |
| Sebastian Schkudlara | s****a@g****m | 40 |
| Tiago Santos | s****o@g****m | 39 |
| Adeel Kamal Malik | a****7@h****m | 35 |
| Agnieszka Figiel | a****l@g****m | 29 |
| Miguel Mendoza | i****o@m****j | 29 |
| Miguel Barrenechea | m****a@s****s | 23 |
| Andrés González | a****s@s****s | 13 |
| Andrés González Muñoz | a****z@v****m | 11 |
| Gerardo Pacheco | g****o@s****s | 8 |
| dependabot[bot] | 4****] | 7 |
| Adeel Kamal Malik | a****k@g****m | 5 |
| Ajay Ranipeta | a****a@g****m | 4 |
| Gerardo | g****t@g****m | 1 |
| bitTal | a****z@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 25
- Total pull requests: 241
- Average time to close issues: about 4 hours
- Average time to close pull requests: 2 months
- Total issue authors: 5
- Total pull request authors: 15
- Average comments per issue: 0.04
- Average comments per pull request: 0.81
- Merged pull requests: 154
- Bot issues: 0
- Bot pull requests: 86
Past Year
- Issues: 14
- Pull requests: 26
- Average time to close issues: about 4 hours
- Average time to close pull requests: about 10 hours
- Issue authors: 1
- Pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.77
- Merged pull requests: 15
- Bot issues: 0
- Bot pull requests: 13
Top Authors
Issue Authors
- azvoleff (16)
- funkycoda (3)
- MLNoon (3)
- aagm (2)
- vermeulendivan (1)
Pull Request Authors
- dependabot[bot] (86)
- Bluesmile82 (34)
- martintomas (31)
- davidsingal (15)
- agnessa (15)
- Copilot (11)
- tiagojsag (9)
- clementprdhomme (9)
- santostiago (9)
- AdeelKamalMalik (7)
- andresgnlez (4)
- aagm (3)
- azvoleff (3)
- SARodrigues (3)
- funkycoda (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
proxy.golang.org: github.com/conservationinternational/resilienceatlas
- Documentation: https://pkg.go.dev/github.com/conservationinternational/resilienceatlas#section-documentation
- License: mit
-
Latest release: v1.4.0
published over 2 years ago
Rankings
Dependencies
- actions/checkout v3 composite
- aws-actions/configure-aws-credentials v2 composite
- aws-actions/setup-sam v2 composite
- actions/checkout v3 composite
- aws-actions/configure-aws-credentials v2 composite
- aws-actions/setup-sam v2 composite
- public.ecr.aws/lambda/python 3.9 build
- ghcr.io/developmentseed/titiler latest
- base latest build
- mambaorg/micromamba 1.4 build
- python 3.10-slim-buster build
- node 18.15.0-bullseye build
- cypress/included 12.7.0
- @google-cloud/functions-framework ^3.2.0
- @google/earthengine ^0.1.354
- @google-cloud/functions-framework ^3.2.0
- @google/earthengine ^0.1.354
- @transifex/cli ^5.2.0 development
- @types/google.maps ^3.52.5 development
- @types/leaflet ^1.4.4 development
- @types/leaflet-draw ^0.4.14 development
- @types/node 18.14.6 development
- @types/react ^18.0.28 development
- @types/react-dom ^18.0.11 development
- @types/react-foundation ^0.9.8 development
- @types/react-slick ^0.23.10 development
- @typescript-eslint/eslint-plugin 5.13.0 development
- @typescript-eslint/parser 5.13.0 development
- cypress ^12.7.0 development
- eslint 8.23.1 development
- eslint-config-next 12.2.3 development
- eslint-config-prettier 8.6.0 development
- eslint-import-resolver-typescript 3.5.1 development
- eslint-plugin-import 2.26.0 development
- eslint-plugin-prettier 4.2.1 development
- husky ^1.3.1 development
- lint-staged ^13.1.2 development
- prettier 2.8.3 development
- start-server-and-test ^2.0.0 development
- typescript 4.5.2 development
- @carto/carto.js 4.2.2
- @googlemaps/js-api-loader ^1.15.1
- @headlessui/react ^1.7.14
- @reactour/tour ^3.3.0
- @tanstack/react-query ^4.28.0
- @transifex/native ^5.2.0
- @transifex/react ^5.2.0
- @turf/bbox-polygon ^6.5.0
- axios ^0.21.2
- classnames ^2.3.2
- date-fns ^2.30.0
- dotenv ^16.0.3
- dotenv-cli ^7.1.0
- foundation-sites 6.7.5
- html-react-parser ^3.0.16
- leaflet 1.4.0
- leaflet-active-area 1.1.0
- leaflet-utfgrid 0.3.0
- leaflet.pm 2.0.3
- lodash ^4.17.11
- moment ^2.24.0
- next 12.3.4
- next-redux-wrapper ^8.1.0
- normalize.css ^8.0.1
- normalizr ^3.3.0
- numeral ^2.0.6
- qs ^6.9.7
- react 17.0.2
- react-beautiful-dnd ^11.0.0-beta.3
- react-cookie ^4.1.1
- react-dangerous-html ^1.0.0
- react-datepicker ^4.11.0
- react-dom 17.0.2
- react-dropzone ^10.1.4
- react-foundation 0.9.7
- react-iframe ^1.8.0
- react-modal ^3.16.1
- react-redux 6.0.1
- react-router ^4.3.1
- react-slick 0.29.0
- recharts ^1.5.0
- redux ^4.0.1
- redux-devtools-extension ^2.13.8
- redux-form ^8.2.3
- redux-thunk ^2.3.0
- reselect ^4.0.0
- resilience-layer-manager https://github.com/ConservationInternational/resilienceatlas-layermanager.git#1.0.4
- sass ^1.58.3
- slick-carousel ^1.8.1
- use-debounce ^9.0.4
- vega 5.23.0
- vega-lib 4.4.0
- vizzuality-components ^1.1.1
- yup ^0.32.11
- earthengine-api ==0.1.354
- oauth2client ==4.1.3
- earthengine-api ==0.1.232
- rollbar ==0.14.7
- mangum ==0.17.0
- requests ==2.29.0
- titiler.application ==0.11.6
- leafmap ==0.19.0
- localtileserver ==0.6.4
- palettable ==3.3.0
- scikit-learn ==1.2.2
- streamlit ==1.21.0
- streamlit_folium ==0.11.1
- annotate >= 0 development
- awesome_print >= 0 development
- better_errors >= 0 development
- binding_of_caller >= 0 development
- brakeman >= 0 development
- bundler-audit >= 0 development
- byebug >= 0 development
- capistrano ~> 3.9 development
- capistrano-bundler >= 0 development
- capistrano-passenger >= 0 development
- capistrano-rails >= 0 development
- capistrano-rbenv ~> 2.2 development
- capybara >= 3.26 development
- cuprite >= 0 development
- faker >= 0 development
- foreman >= 0 development
- letter_opener_web >= 0 development
- rspec-collection_matchers >= 0 development
- rspec-request_snapshot >= 0 development
- rspec-retry >= 0 development
- rswag-specs >= 0 development
- super_diff >= 0 development
- web-console >= 0 development
- webmock >= 0 development
- active_admin-sortable_tree >= 0
- active_admin_theme >= 0
- active_model_serializers >= 0
- active_storage_validations >= 0
- activeadmin >= 0
- activeadmin-globalize >= 0
- activeadmin_addons >= 0
- acts_as_list >= 0
- addressable >= 0
- ancestry >= 0
- bcrypt_pbkdf >= 0
- cancancan >= 0
- devise >= 0
- dotenv-rails >= 0
- ed25519 >= 0
- factory_bot_rails >= 0
- ffi >= 0
- globalize >= 0
- image_processing >= 0
- importmap-rails >= 0
- jbuilder >= 0
- json-schema >= 0
- jwt >= 0
- matrix >= 0
- pg >= 0
- prawn >= 0
- prawn-table >= 0
- puma >= 0
- rack-cors >= 0
- rails >= 0
- ransack >= 0
- rspec-rails >= 0
- rswag >= 0
- rubyzip >= 0
- seed_dump >= 0
- shrine >= 0
- simple_command >= 0
- slim-rails >= 0
- sparkpost_rails >= 0
- standard >= 0
- terser >= 0
- will_paginate >= 0
- 194 dependencies
- actions/checkout v4 composite
- appleboy/ssh-action v1.0.0 composite
- aws-actions/configure-aws-credentials v4 composite
- actions/checkout v4 composite
- appleboy/ssh-action v1.0.0 composite
- aws-actions/configure-aws-credentials v4 composite
- postgis/postgis 15-3.3
- axios ^1.7.7
- actions/cache v4 composite
- actions/checkout v4 composite
- docker/setup-buildx-action v3 composite
- dorny/test-reporter v1 composite
- actions/cache v4 composite
- actions/checkout v4 composite
- docker/setup-buildx-action v3 composite
- actions/cache v4 composite
- actions/checkout v4 composite
- actions/upload-artifact v4 composite
- docker/setup-buildx-action v3 composite
- dorny/test-reporter v1 composite
- base latest build
- ruby 3.4.4-bullseye build
- node 18.15.0-bullseye
- postgis/postgis 15-3.3
- cypress/included 13.6.2
- postgis/postgis 15-3.3
- redis 7-alpine