Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My thai star net #5

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
7 changes: 7 additions & 0 deletions my-thai-star-net/finish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Congratulations!

You finished the My Thai Star - Java Tutorial.

For further informations please visit the documentation:

https://devonfw.com/website/pages/docs/getting-started.asciidoc_guides.html#guide-sample-application.asciidoc
35 changes: 35 additions & 0 deletions my-thai-star-net/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"title": "Try My Thai Star - Dotnet",
"description": "This will let you try My Thai Star - Dotnet online.",
"difficulty": "Beginner",
"time": "10 minutes",
"details": {
"steps": [
{
"title": "Step 1",
"text": "step1.md"
},
{
"title": "Step 2",
"text": "step2.md"
},
{
"title": "Step 3",
"text": "step3.md"
}
],
"intro": {
"text": "intro.md"
},
"finish": {
"text": "finish.md"
}
},
"environment": {
"showide": true,
"uilayout": "terminal"
},
"backend": {
"imageid": "ubuntu:2004"
}
}
13 changes: 13 additions & 0 deletions my-thai-star-net/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
In this scenario you will use "My Thai Star" for the first time.

The first step is to start the server.

In the second step you will build and use the app.





You can find the documentation for the "My Thai Star" tutorial application here:

https://devonfw.com/website/pages/docs/getting-started.asciidoc_guides.html#guide-sample-application.asciidoc
14 changes: 14 additions & 0 deletions my-thai-star-net/step1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Okay let's start!

First you need to clone the My Thai Star repository. Run `git clone https://github.com/devonfw/my-thai-star.git`{{execute}}

First you need to install dotnet 2.1.

`wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb`{{execute}}

`dpkg -i packages-microsoft-prod.deb`{{execute}}

`apt-get update`{{execute}}
`apt-get install -y apt-transport-https`{{execute}}
`apt-get update`{{execute}}
`apt-get install -y aspnetcore-runtime-2.1`{{execute}}
52 changes: 52 additions & 0 deletions my-thai-star-net/step2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
`apt-get update`{{execute}}

`apt-get install nginx`{{execute}}

`y`{{execute}}

`service nginx start`{{execute}}

`service nginx status`{{execute}}

`nano /etc/nginx/sites-available/default`{{execute}}

add:
` proxy_pass http://localhost:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;`{{copy}}

`cd /var/www`{{execute}}

`mkdir myThaiStar`{{execute}}

`cd`{{execute}}

`nano /etc/systemd/system/mythaistar.service`{{execute}}

`\[Unit\]
Description=My Thai Star Web App

[Service]
WorkingDirectory=/var/www/myThaiStar
ExecStart=/usr/bin/dotnet /var/www/myThaiStar/myThaiStar.dll
Restart=always
#Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
SyslogIdentifier=myThaiStar
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target `{{copy}}

`systemctl enable mythaistar.service`{{execute}}

`cd my-thai-star/net/netcore/OASP4Net.Application.WebApi`{{execute}}

`dotnet publish -c release -o /var/www/myThaiStar`{{execute}}

`env DOTNET_CLI_HOME=/root systemctl start mythaistar.service`{{execute}}
25 changes: 25 additions & 0 deletions my-thai-star-net/step3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Now you want to build the app in a second terminal. After all you can test the app.

To open a second terminal click on the plus sign. A drop-down list will open and you click on "Open New Terminal".

The next step is to install globally Angular CLI. Don't worry a second terminal will open when you execute the command. `npm install -g @angular/cli`{{execute T2}}

After a while you will be asked if you like to share anonymous usage data with the Angular Team at Google. Either choose `y`{{execute T2}} or `n`{{execute T2}}

Now switch to the angular folder in jump-the-queue directory. `cd my-thai-star/angular`{{execute T2}}

After that install the dependencies in the local folder. `npm install`{{execute T2}}

After a while you will be asked if you like to share anonymous usage data with the Angular Team at Google. Either choose `y`{{execute T2}} or `n`{{execute T2}}

This will take some time.

In the next step you need to change the Base URL for the REST Services. Open the IDE, wait until it is fully loaded and then open `my-thai-star/angular/src/app/core/config/config.ts`{{open}}

Now change the restPathRoot to `https://[[HOST_SUBDOMAIN]]-8081-[[KATACODA_HOST]].environments.katacoda.com/mythaistar/`{{copy}} And restServiceRoot to `https://[[HOST_SUBDOMAIN]]-8081-[[KATACODA_HOST]].environments.katacoda.com/mythaistar/services/rest/`{{copy}}

Last but not least switch back to terminal 2. Now you build and start the app. `ng serve --host 0.0.0.0 --disable-host-check`{{execute T2}}

Wait until you see the message "Compiled successfully".

Now you can open the following link to use My Thai Star. https://[[HOST_SUBDOMAIN]]-4200-[[KATACODA_HOST]].environments.katacoda.com/