Debug Environment Setup - IsraelHikingMap/Site GitHub Wiki
Setting Up the Project for Website Development
In order to be able to build this website you'll need some tools:
- Install Docker
- Install .Net core SDK 9.0
- Install node.js (20+).
- Run from command line
dotnet restore
and after thatdotnet build
- Go to
IsraelHiking.Web
and run from command line:npm install
to install all npm packages for the client side codenpm run build
to generate the Angular UI client. It should createwwwroot
folder on a successful run
- Run
docker compose up graphhopper
- it should fail for the first time - Run
gh-update.ps1
(set chmod +x if needed) to generate the graphhopper routing data - Run
docker compose up
to load the rest of the sercives - Run
dotnet run --project IsraelHiking.Web
- [Optional] For a full end-to-end with ability to upload to wikimedia and imgur set the following secrets:
dotnet user-secrets set "wikiMediaUserName" "your wikimedia user"
dotnet user-secrets set "wikiMediaPassword" "your wikimedia password"
dotnet user-secrets set "imgurClientId" "your imgur client ID"
Capacitor (iOS, Android)
In order to debug the Capacitor app (iOS or Android) make sure to setup everything needed according to the Capacitor setup instructions: See Capacitor's instructions here. In order to debug the app follow these steps:
- Go to
IsraelHiking.Web
folder - Run
npm run build:mobile
- this will make the UI up-to-date with changes - Before starting a debug session in the IDE (xcode or Android Studio) run
npx cap sync
ornpx cap sync android
(for android platform) - Connect a device to the workstation or via wifi
- Make sure the device allows debugging (for android)
- Start the app from the IDE in debug mode
- For Android: open chrome, surf to
chrome://inspect
and click on IsraelHiking link to open the console - For iOS: open safari on the mac and connect to the device to see the console. There are also prints to the xcode IDE logger from the console you can check
Watch for changes in typescript/html
In order to regenerate the client code on every change use the following command inside IsraelHiking.Web
folder:
npm run build:watch
.
This will keep the wwwroot
typescript transpiled files up-to-date so you can change the code and instantly see the changes.
Once this is up and running you can debug the client side code using the developer tools.
For mobile use npm run build:mobile-watch
OSM data update
- Make sure the backend is up and running using the
dotnet run --project IsraelHiking.Web
- Surf to
localhost:5000/swagger/
and you should be presented with the API of the site- Expand the POST under Update
- Select the relevant configuration and click try it out!
- The update of the database will be running for about 10 minutes and can be seen in the logs (can be seen in the console where you ran
dotnet
) - Once completed the server is ready!
Tests
- To run UI tests use
npm run test
inIsraelHiking.Web
folder - To run server tests use run
dotnet test
- Use Rider for running specific tests and debug .net code