Client
Server
Database
DevOps
Client
To set environment variables for client in development, edit the .env file. For production build, you have to set the environment variables into the container itself. You can override the .env with a .env.local file. This file is not included in git repo.
REACT_APP_API_BASE_URL
- Url to backend server
REACT_APP_SOCKET_BASE_URL
- Url to backend server used with websocket connection
REACT_APP_APP_ID
- Application id of server app registration in Azure AD
REACT_APP_CLIENT_ID
- Application id of client app registration in Azure AD
REACT_APP_TENANT_ID
- Azure tenant
REACT_APP_MIMIR_VERSION
- The Mimir version number
REACT_APP_APP_INSIGHTS_CONNECTION_STRING
- Application insight connection string
REACT_APP_SILENT
- Turn off MSAL connection
If you are running the server locally then the values will most likely be
// where x and y = api version
REACT_APP_API_BASE_URL = http://localhost:5001/v{x}.{y}/
REACT_APP_SOCKET_BASE_URL = http://localhost:5001/
REACT_APP_APP_ID = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
REACT_APP_CLIENT_ID = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
REACT_APP_TENANT_ID = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
REACT_APP_MIMIR_VERSION = 2.0
REACT_APP_APP_INSIGHTS_CONNECTION_STRING = InstrumentationKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;...
REACT_APP_SILENT = false
Server
To set environment variables for server in development, edit the appsettings.json file. For production build, you have to set the environment variables into the application container itself. You can override the appsettings.json with a appsettings.local.json file. This file is not included in git repo.
ASPNETCORE_ENVIRONMENT
- Set .NET core environment
ApplicationSetting__CollaborationPartner__Name
- Name of default collaboration partner ex. Mimirorg
ApplicationSetting__CollaborationPartner__Domain
- Domain of default collaboration partner ex. mimirorg.com
ApplicationSetting__CollaborationPartner__Iris__0
- RDF domain of collaboration partner, e.g. rdf.mimirorg.com
ApplicationSetting__TypeLibraryRootUri
- The root uri to Type Library
ApplicationSetting__TypeLibraryVersion
- The version used by Type Library
ApplicationSetting__TypeLibrarySecret
- The secret registered in Type Library. Used to identify and registered hooks
ApplicationSetting__TypeLibraryDomain
- The type library domain
AzureActiveDirectoryConfiguration__TenantId
- Azure tenant
AzureActiveDirectoryConfiguration__ClientId
- Application id of Server application in Azure AD (app registration)
AzureActiveDirectoryConfiguration__Silent
- Set authentication and authorisation in silent demo mode
CorsConfiguration__ValidOrigins
- Comma separated string of valid origins for CORS. E.g. http://localhost:3000,https://mimirorg.com
DatabaseConfiguration__DataSource
- Identifier for database server
DatabaseConfiguration__Port
- Port of database server. E.g. 1443
DatabaseConfiguration__InitialCatalog
- Database name
DatabaseConfiguration__DbUser
- Server application database username, must be db owner on given catalog
DatabaseConfiguration__Password
- Server application database password
This project uses .NET 6 for the server and NPM as package manager for the client, make sure that you have these installed before continuing. Mimir has dependency on Type Library Service, so you also need to clone that project for development purposes. Clone that project as well if not running on external server. You also need a MSSQL database running on your machine. See docker-compose for running sql in docker.
We recomend that you first create a folder 'Mimirorg' and move into that folder:
..\Mimirorg
Then you clone Mimir:
git clone git@github.com:mimir-org/mimir.git
And then you clone typelibrary (Tyle):
git clone git@github.com:mimir-org/typelibrary.git
You now have two new folders inside the 'Mimiorg' folder.
..\Mimirorg\mimir
..\Mimirorg\typelibrary
In this setup we use docker and a docker-compose script. Create a new file at the root of the 'Mimirorg' folder and name it 'docker-compose.yaml'. Copy & paste this content into the file:
version: "3.8"
services:
tyle-client:
build: ./typelibrary/src/client
hostname: 'tyleclient'
container_name: tyleclient
ports:
- "3001:80"
environment:
- TYPELIBRARY_ENV_API_BASE_URL=http://localhost:5001/v1.0/
networks:
- type_library_network
mimir-client:
build:
context: ./mimir/src/client
args:
- MIMIR_VERSION=2.5.0
hostname: 'mimirclient'
container_name: mimirclient
ports:
- "3000:80"
environment:
- MIMIR_ENV_API_BASE_URL=http://localhost:5000/v1.0/
- MIMIR_ENV_SOCKET_BASE_URL=http://localhost:5000/
- MIMIR_ENV_APP_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- MIMIR_ENV_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- MIMIR_ENV_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- MIMIR_ENV_APP_INSIGHTS_CONNECTION_STRING=InstrumentationKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/
- MIMIR_ENV_SILENT=false
networks:
- type_library_network
tyle-server:
build: ./typelibrary/src/server
hostname: 'tyleserver'
container_name: tyleserver
ports:
- "5001:80"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- DatabaseConfiguration__DataSource=mssql
- DatabaseConfiguration__Port=1433
- DatabaseConfiguration__InitialCatalog=TypeLibrary
- DatabaseConfiguration__DbUser=sa
- DatabaseConfiguration__Password=P4ssw0rd1
- MimirorgAuthSettings__DatabaseConfiguration__DataSource=mssql
- MimirorgAuthSettings__DatabaseConfiguration__Port=1433
- MimirorgAuthSettings__DatabaseConfiguration__InitialCatalog=MimirorgAuthentication
- MimirorgAuthSettings__DatabaseConfiguration__DbUser=sa
- MimirorgAuthSettings__DatabaseConfiguration__Password=P4ssw0rd1
- ApplicationSettings__ApplicationSemanticUrl=http://localhost:5001/v1/ont
- ApplicationSettings__ApplicationUrl=http://localhost:5001
- CorsConfiguration__ValidOrigins=http://localhost:3001
networks:
- type_library_network
depends_on:
- mssql
mimir-server:
build: ./mimir/src/service
hostname: 'mimirserver'
container_name: mimirserver
ports:
- "5000:80"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- DatabaseConfiguration__DataSource=mssql
- DatabaseConfiguration__Port=1433
- DatabaseConfiguration__InitialCatalog=ModelBuilder
- DatabaseConfiguration__DbUser=sa
- DatabaseConfiguration__Password=P4ssw0rd1
- AzureActiveDirectoryConfiguration__TenantId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- AzureActiveDirectoryConfiguration__ClientId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- AzureActiveDirectoryConfiguration__Silent=false
- CorsConfiguration__ValidOrigins=http://localhost:3000
- ApplicationSetting__TypeLibraryRootUri=http://tyleserver/
- ApplicationSetting__TypeLibraryVersion=v1
- ApplicationSetting__TypeLibrarySecret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- ApplicationSetting__TypeLibraryDomain=runir.net
networks:
- type_library_network
depends_on:
- mssql
mssql:
image: "mcr.microsoft.com/mssql/server:2017-CU8-ubuntu"
hostname: 'mssql'
container_name: mssql
ports:
- '127.0.0.1:1433:1433'
volumes:
- mssql:/var/opt/mssql
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=P4ssw0rd1
- MSSQL_PID=Standard
networks:
- type_library_network
restart: unless-stopped
volumes:
mssql:
driver: local
networks:
type_library_network:
driver: bridge
To keep it simple in this example we use db user: 'sa' and db passord: 'P4ssw0rd1'. You can change this to your liking. The 'Mimirorg' folder should now look like this:
..\Mimirorg\mimir
..\Mimirorg\typelibrary
..\Mimirorg\docker-compose.yaml
To spool up everything in docker use this command when standing in the 'Mimirorg' folder:
docker compose up -d --build
If you now run this command:
docker ps -a
You should see all your docker images:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b89d794be253 mimirorg_mimir-server "dotnet ModelBuilderā¦" 9 seconds ago Up 7 seconds 443/tcp, 0.0.0.0:5000->80/tcp mimirserver
84e7600fdcf9 mimirorg_tyle-server "dotnet TypeLibrary.ā¦" 9 seconds ago Up 7 seconds 443/tcp, 0.0.0.0:5001->80/tcp tyleserver
ed558855c314 mimirorg_mimir-client "/bin/sh -c '\"./starā¦" 9 seconds ago Up 7 seconds 0.0.0.0:3000->80/tcp mimirclient
42d843407f0d mimirorg_tyle-client "/bin/sh -c '\"./starā¦" 9 seconds ago Up 7 seconds 0.0.0.0:3001->80/tcp tyleclient
d914b6d4d538 mcr.microsoft.com/mssql/server:2017-CU8-ubuntu "/opt/mssql/bin/sqlsā¦" 9 seconds ago Up 7 seconds 127.0.0.1:1433->1433/tcp mssql
Client | Server | |
---|---|---|
āļø Installation | cd src/client npm install |
cd src/server dotnet build |
š Run Locally | cd src/client npm start |
cd src/server/ModelBuilder.Api dotnet run |
You can use Yalc to manage local package development. It allows you to work on your local package and test it as if it were installed from NPM, without publishing it.
Yalc allows you to work on the "component-library" locally and test it within the "mimir" project without publishing it to NPM. Here's how you can set it up:
First, you need to install Yalc globally on your machine:
npm install -g yalc
Navigate to the "component-library" directory and publish the package to Yalc's local store:
cd path/to/component-library
yalc publish
Now, navigate to the "mimir" project directory and add the "component-library" package using Yalc:
cd path/to/mimir
yalc add component-library
If you want to reflect the changes in the "component-library" instantly in the "mimir" project, you can use the yalc link
command:
cd path/to/component-library
yalc link mimir
Whenever you make changes to the "component-library," you can push the updates to the "mimir" project using:
yalc push
If you want to remove the "component-library" from the "mimir" project and revert to the NPM version, you can use:
cd path/to/mimir
yalc remove component-library
To update the "component-library" in the "mimir" project with the latest version from Yalc's local store, you can use:
cd path/to/mimir
yalc update component-library
We welcome community pull requests for bug fixes, enhancements, and documentation. See How to contribute for more information.
Architecture sketches overall. See Mimir overall for more information.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.
Distributed under the MIT License. See LICENSE for more information.
Mimir-org - orgmimir@gmail.com
Project Link: https://github.com/mimir-org/mimir