Installation script documentation
Background/Purpose
The Installation and Rebuild script was created to streamline the content of the README files that were spread throughout the sub-directories of the project. These README files may be changed or removed, so in order to keep answers to how and why the scripts are the way they are we are documenting their content here.
Below are the original instructions on how to get the environment going.
Museum
Following are the README files that were used to create the Installation and Rebuild scripts.
DockerCompose/README.md
DockerCompose
spin upp all containers with one dockercompose command
Dependencies
all images need to be created before running docker compose
To run the dockercompose (outputs all consoletext from all the containers)
docker compose up
To run dockercomose (detatched, no consoletext)
docker compose up -d
This dockercompose uses volumes instead of binds To see the volumes
docker volumes ls
Docker volumes is normaly saved under /var/lib/docker/volumes/pgdata/_data/ (or \\wsl$\docker-desktop-data\data\docker\volumes\pgdata\_data\ using docker desktop in windows)
entryPoint/README.md
entryPoint
reverse proxy for
- each service -> /api/
- webbapplication -> /app/ using nginx
to build the dockerimage (using Dockerfile)
docker build -t entrypoint .
frontend/README.md
npm start
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
npm run build
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
build the dockerfile
to build the dockerimage (using Dockerfile)
docker build -t frontend .
tempSensorMockup/README.md
tempSensorMockup
Sensor displaying temperature, timestamp and sensorid
to build the dockerimage (using Dockerfile, while running it from the terminal inside of its directory)
docker build -t tempsensormockup .
middleware/README.md
middleware
created using dotnet new console -n middleware
- getdata fom mqttserver
- create tables for each sensor from mqtt
adds data from mqtt to database creates db from the name subscribed to in PostgreSQL
#Build
docker build -t middleware .
#Init
dotnet add package MQTTnet --version 4.3.1.873
dotnet add package Npgsql
readTempSensorMockup/README.md
readTempSensorMockup
Read data from TempSensorMockup Send data to a mqtt server Store data in a database
Dependencies
program uses MQTTnet version 4.3.1.873
dotnet add package MQTTnet --version 4.3.1.873
Sqlite, for it to work on mac & windows we need the 2 extra adds at the end
dotnet add package System.Data.SQLite
dotnet add package Microsoft.Data.Sqlite.Core
dotnet add package SQLitePCLRaw.bundle_e_sqlite3
using mosquitto mqtt server
The Mosquitto MQTT server needs the config to be mounted as a volume at least with a config file Create a folder for persistent data, add a folder for mosqutto and a subfolder called config
add a file mosquitto.conf in the config dir. containing:
listener 1883
allow_anonymous true
(If changed later, you need to update the readSensors)
Run mosquitto (standalone)
docker run -it -p 1883:1883 --name mosquitto -v "$PWD/mosquitto/config:/mosquitto/config" -p 9001:9001 eclipse-mosquitto
to build the dockerimage (using Dockerfile)
docker build -t readtempsensormockup .
tempService/README.md
tempService
Get data from tempdb display in a restlike api
to run the dockerimage
docker run --rm -p 5001:8080 --network dockercompose_DTnet --name tempservice tempservice
to build the dockerimage (using Dockerfile)
docker build -t tempservice .
/README.md
BoundlessFlowCampus2K
Digital Twin is used in some courses at the University of Skövde
Install environment:
Install Docker Install VS Code (with C# extensions) Install dotnet - Note, VS Code does NOT automatically install the dotnet environment! https://dotnet.microsoft.com/en-us/download/dotnet/10.0
After the above steps, check in the terminal in VS if everything is working: dotnet -- info
Note: You need to restart Visual Studio if you install software that should be available from the terminal. So if the terminal command is not recognised, restart Visual Studio (it works slightly differently when working directly in the *NIX CLI).
If you don't have GitHub, make sure to install it: https://git-scm.com/install/ Validate that GitHub is working: git --version Note: It is completely fine to use Git Desktop, but a Git terminal is required as a basic and can also help if things get tricky.
Get the subprojects going
See the readme files within the subprojects:
- middleware
- readTempSensorMockup
- tempSensorMockup
- tempService
- entryPoint
- frontend
You can only build them from within the subdirectories. You can build them with docker buildx build . (note: docker build -t will fail if you try to execute it on Windows from within the Visual Studio terminal command line)
1. Setup
2. Standards
- Coding Conventions
- Issues
- Branch creation
- Reviews
- Implementation Standards
- [WIP] Creating new databases
- Localization
3. Models and Diagrams
4. Testing
5. Documentation
- Documentation for service endpoints
- API documentation
- Webpage Design
- Secrets and .env
- Evaluations
- Installation and Rebuild script documentation
6. Guides and How-to's
7. Micro Service Mockup Api
- Guidelines Mircro Service Mockup
- Documentation of useTemperature/useTemperatureTimeSeries mockup sensor