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.
- Nodejs 16
- MySQL 8
- Run
npm install - Copy
.env.exampleand rename the copy to.env - If in development, create a MySql schema for testing
- Fill in the
.envwith 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
- Reset migration
npx sequelize-cli db:seed:undo:all && npx sequelize-cli db:migrate:undo:all
- Run
npm testto run all UTs - We use the Mocha testing framework for our tests, with Chai for assertions and Sinon for mocks, spies, stubs, etc.
- See the Testing wiki for general advice on writing UTs
- Add UTs to a
.test.tsfile in the same directory as the code you are testing. - The files
routes/database.test.tsandroutes/maps.test.tscontain 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 testmanually.
See the full list of APIs and their purpose by looking at the bottom of each file in the src/routes/ directory.
) before work.