How to setup a local development environment for GIRAF (Windows 10)

Installing MySQL

mysql install 1 mysql install 2 mysql install 3 mysql install 4 If any of the downloads fail, just click "Try Again" mysql install 5 mysql install 6 mysql install 7 mysql install 8 mysql install 9 mysql install 10 mysql install 11 mysql install 12 mysql install 13 mysql install 14 mysql install 15 mysql install 16 mysql install 17 mysql install 18

Starting the MySQL server

  1. Start the MySQL80 service

"Tjenester" = "Services" in English tjenester1 tjenester2

Configuring Weekplanner and Web-API repositories to work locally

  1. Go to weekplanner/lib/main.dart
  2. Change 'assets/environments.dev.json' to 'assets/environments.local.json' on line 29
  3. Go to web-api/GirafRest/appsettings.Development.json
  4. Change the server variable to server=localhost in the DefaultConnection key

Building the database for the Web-API and running it with sample data

  1. Open command prompt in web-api/GirafRest

Command Prompt

  1. Type dotnet-ef database update
  2. Type dotnet run --sample-data

Making sure everything works

  1. Run the weekplanner application on your emulator
  2. Login using the default credentials

  3. Username: guardian-dev

  4. Password: password

If you successfully log in and see output in the Web-API console window, then you are successfully running everything locally

Updating the database when changes are made to the Web-API without migrations

Method 1

  1. Open command prompt in web-api/GirafRest

Command Prompt

  1. Type dotnet-ef database drop
  2. Rebuild the database

Method 2

  1. Drop the giraf database in the MySQL server

updatedb1 updatedb2

  1. Rebuild the database

Last update: December 12, 2023