-
Notifications
You must be signed in to change notification settings - Fork 0
Setup development environment
You must have the following installed and available on your machine:
- Microsoft .NET 7
- Microsoft SQL Server Compact running locally or in Docker
- Node JS >12.x (16.11.0)
- Yarn 1.x
- https://github.com/coreybutler/nvm-windows
Local overrides of configurations/secret must be done through Secret Manager
These projects have User Secrets:
- EndToEnd.Tests:
ConnectionStrings:DefaultConnection(see "LocalDB" section below) - Api.Standalone
- Api.WithReact, Api.WithReact.Tests:
ActiveDirectoryConfig:AppClientSecret(see "Azure Active Directory" section in the Wiki)
The project comes with connection strings for a docker container specified in docker-compose.yml.
Start the DB with docker-compose up, then no further setup is required.
If you are running Windows with a instance of MS LocalDb, you can avoid using Docker for development and for the end-to-end tests by running these commands.
In the "EndToEnd.Tests" project folder:
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=(localdb)\mssqllocaldb;Database=MUFFINET-TEST;Trusted_Connection=True;MultipleActiveResultSets=true"
In the "Api.WithReact" project folder:
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=(localdb)\mssqllocaldb;Database=MUFFINET;Trusted_Connection=True;MultipleActiveResultSets=true"
In the "Api.Standalone" project folder:
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=(localdb)\mssqllocaldb;Database=MUFFINET;Trusted_Connection=True;MultipleActiveResultSets=true"
If you don't have yarn, install it:
npm install -g yarnRestore dotnet project:
dotnet restoreFirst install dotnet-ef (if you haven't already):
dotnet tool install --global dotnet-efThen run the migrations:
dotnet ef database update --project src/Api.WithReactYou might get an error because the dotnet tools directory is not in your path.
Using zsh or linux/mac, this can be fixed with:
echo 'export PATH="$PATH:$HOME/.dotnet/tools"' >> ~/.zshrc
source ~/.zshrcAdapting the command to bash/fish etc. should be a matter of replacing .zshrc, with for instance .bashrc.
- Run the server:
dotnet run --project src/Api.WithReact - Run backend tests:
dotnet test - Run frontend tests:
yarn test - Run lint:
yarn link - Run prettier:
yarn format