Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
/ hellocoreclr Public archive

Just a playground for CoreClr experiments.

License

Notifications You must be signed in to change notification settings

jp7677/hellocoreclr

Repository files navigation

hellocoreclr

Just a playground... P.S. I'm a terrible designer :)

Continuous integration status

Status
Debug build and unit tests status (Windows): Debug build and unit tests status
Unit tests coverage status: Coverage status
Release build and unit tests status (Linux): Release build Status

Instructions

Obviously you should have Net Core SDK 3.1.x or higher and Nodejs/npm 12.x already up and running for everything that follows.

If you prefer MariaDb you'll have to override the connectionString in appsettings.json with e.g.

export connectionString="Server=localhost;database=helloworld;uid=helloworld;pwd=helloworld;"

The easiest way to fire up a database is by using docker:

docker run --name mariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=helloworld -e MYSQL_USER=helloworld -e MYSQL_PASSWORD=helloworld -d mariadb --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
docker run --name myadmin -d --link mariadb:db -p 8080:80 phpmyadmin/phpmyadmin

Production build and publish

Restore packages, building, assembling and publishing goes like

dotnet publish --configuration Release --output ../../artifacts/approot src/HelloCoreClrApp
dotnet msbuild /t:publish /p:configuration=Release /p:output=../artifacts/wwwroot ui

Find the result within the artifacts/ folder. Please read http://docs.asp.net/en/latest/publishing/linuxproduction.html how to go ahead with installation and front-end servers.

Testing setup

Use

dotnet build
dotnet build ui

to restore packages, bindings, building and for assembling the web application. Use

dotnet test
npm run test --prefix ui

to run C#, TypeScript/JavaScript unit tests and e2e tests.

Use

export ASPNETCORE_ENVIRONMENT=Staging
dotnet run --project src/HelloCoreClrApp/HelloCoreClrApp.csproj

to run the web server. Use

npm run serve --prefix ui

in a separate console to run the dedicated front end server. Open http://localhost:3000/ in you browser. Enjoy!

Development setup

For a nice web programming experience I'm using Visual Studio Code with the following extensions:

ESLint, stylelint, HTMLHint, markdownlint, Cucumber (Gherkin) Full Support, Debugger for Chrome, Wallaby.js for Visual Studio Code

Note that Wallaby.js is a commercial extension.

My choice for C# development is JetBrains Rider.

Use again

dotnet build
dotnet build ui

to restore packages and bindings. Finally run the following commands in separate terminals for building and testing on file save.

export ASPNETCORE_ENVIRONMENT=Development
(cd src/HelloCoreClrApp;dotnet watch run)
(cd test/HelloCoreClrApp.Test;dotnet watch test)
npm run watch --prefix ui
npm run unit-tests:watch --prefix ui

Your favorite browser should fire up and should open http://localhost:3000/. Happy coding!

About

Just a playground for CoreClr experiments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •