Skip to content

DigitalCommons/land-explorer-back-end

Repository files navigation

Land Explorer Back End

This application provides the back-end functionality for Land Explorer. It has 4 main features:

  • Basic user account management: Authentication, registration, user details
  • Maps: Managing access to maps, creating/updating map data
  • Data groups: Creating/updating data group data
  • Ownership: Accessing company ownership and INSPIRE property boundary polygons data. This data is served by our own separate app, the Property Boundaries Service (repo here), and this back-end application mostly just forwards the data to the Land Explorer client.

This is a Digital Commons Coop project, so please review the [contribution guidelines](# Land Explorer Back End

This application provides the back-end functionality for Land Explorer. It has 4 main features:

  • Basic user account management: Authentication, registration, user details
  • Maps: Managing access to maps, creating/updating map data
  • Data groups: Creating/updating data group data
  • Ownership: Accessing company ownership and INSPIRE property boundary polygons data. This data is served by our own separate app, the Property Boundaries Service (repo here), and this back-end application mostly just forwards the data to the Land Explorer client.

This is a Digital Commons Coop project, so please review the contribution guidelines before work.

Requirements

  • Nodejs 16
  • MySQL 8

Installation

  • Run npm install
  • Copy .env.example and rename the copy to .env
  • If in development, create a MySql schema for testing
  • Fill in the .env with database credentials
  • Run migration npx sequelize-cli db:migrate
  • Run seeder npx sequelize-cli db:seed:all
  • Run npm run dev:serve
  • Access 0.0.0.0:4000

Dev command cheat sheets

  • Reset migration npx sequelize-cli db:seed:undo:all && npx sequelize-cli db:migrate:undo:all

Unit tests

  • Run npm test to run all UTs
  • We use the Mocha testing framework for our tests, with Chai for assertions and Sinon for mocks, spies, stubs, etc.

Writing a unit test

  • See the Testing wiki for general advice on writing UTs
  • Add UTs to a .test.ts file in the same directory as the code you are testing.
  • The files routes/database.test.ts and routes/maps.test.ts contain good examples of UTs
  • In VS Code, install the extensions:
    • ES6 Mocha Snippets to make writing test boilerplate code faster
    • Mocha Test Explorer to run individual tests from sidebar. Note, this extension sometimes doesn't catch exceptions that occur between tests, so you should also occasionally run npm test manually.

APIs

See the full list of APIs and their purpose by looking at the bottom of each file in the src/routes/ directory. ) before work.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors