Skip to content
Oliver Thomas edited this page Jan 3, 2024 · 2 revisions

Welcome to the landscapes wiki!


Notes on the app

Structure

The app mostly follows the standard directory structure for all Rails apps. Here's an overview of the most important parts:

  • Gemfile - specifies the app's backend Ruby dependencies
  • package.json - specifies the app's frontend Javascript dependencies
  • /app/assets - some of the stylesheets live in here, some live elsewhere (I want to fix this)
  • /app/models, /app/views, /app/controllers - most of the backend functionality of the app is here (Rails is an MVC framework)
  • /app/jobs - contains background jobs that run on the server-side, for things like creating or extracting zip files etc.
  • /app/javascript - most of the frontend functionality lives here
  • controllers - Stimulus controllers live here
  • interactions, sources - these are OpenLayers-related
  • modelling - the flowchart-based model editor lives here
  • projects - the new map view that I'm currently working on lives here; long-term we want to merge the model editor into this
  • stylesheets - this is where the other half of the stylesheets live 😅
  • packs - this contains the Webpack entry points for the app - the main one is application.js; modelling_worker.js is a web worker that allows the model editor to be multithreaded
  • /test - the backend (Rails) test suite lives here. https://guides.rubyonrails.org/testing.html

We don't currently have a test suite for the frontend...

Frontend

  • OpenLayers:
  • Rete.js: This one is a bit difficult to get started with, maybe check out the examples on their website?
  • React: I think the tutorial on the new Beta docs site is a good place to start because it uses the newer functional style components
  • D3: You probably have more experience with this than me! The only unusual plugin I'm using is d3-sankey, which you might want to check out if you haven't used it before
  • Typescript: This is probably better learned through experience (and I'm still new to it myself), but they do have a handbook on their website
  • Stimulus: This is a small js framework used to add little sprinkles of extra functionality in the admin tools
  • Turbolinks: You don't need to know how it works, but it's good to be aware of what it is and how it affects DOM events

GIS Concepts

Backend