Attempt to provide unopinionated aid in language transition between one and the other. Using clean architecture and design patterns, such as Pipeline, IOC, Mediator and CQRS. Domain and test driven.
Scafolding project serving SPA(Angular or React) over HTTP2
https://docs.microsoft.com/en-us/dotnet/core/
https://github.com/jbogard/MediatR
./gradlew Run
docker service ls
all services has at least 1 Replica
./gradlew tasks
Java13, .NETcore3 C#8, Angular8, React16, Gradle6, Docker3, Jetty9, Redis5, RabbitMQ3, Tinkerpop3, Alpine3, Visual Studio Code & extensions
- Build .NET, Java and stack using Gradle
- Http2 with TLS
- serviceloader(java)
- redis cache
- rabbit messaging
- separate domain logic providers to handlers, querys, commands and notifications
public class Program {
public static void main(String[] args) {
App.Run(new Startup());
}
}
public class Startup {
public void ConfigureServices(IServiceCollection.Builder services) {
services
.AddSingleton(IMessageService.class, EmailService.class)
.AddSingleton(IShortMessageService.class, SmsService.class)
.AddController("/weatherforecast", WeatherForecastController.class)
.AddController("/feature", FeatureController.class)
.AddController("/hello", HelloController.class)
.AddEmail()
.AddSms();
}
public void Configure(IApplication.Builder app){
app.UseEmail();
app.UseSms();
}
}
with VS code, hit F5
./gradlew DotnetRun (dotnet run)
./gradlew run
(docker swarm - docker swarm init)
docker-compose -f stack.docker.yml build
docker stack deploy -c stack.docker.yml app
docker service ls
point your browser to
https://localhost:8080
https://localhost
- docker service ls
- docker service logs -f app_dotnet
- docker service logs -f app_java
- docker service ps app_java --no-trunc
- docker service inspect app_java
- docker run -it --entrypoint /bin/bash $IMAGE_NAME -s
- docker build -t javanetapp -f docker/java.Dockerfile .
- docker build -t dotnetapp -f docker/dotnet.Dockerfile .
- docker run -it --rm --name javanetapp -p 8080:8080 javanetapp
- docker run -it --rm --name dotnetapp -p 80:80 -p 443:443 dotnetapp
cd ClientApp
ng serve
docker run --name jetty --rm -v war:/var/lib/jetty -v [local path to wars]:/myvol vol -it -p 80:8080 jetty:9-jre11
cp /myvol/webapps/*.war webapps
point your browser to
http://localhost/app-1.0/hello
./gradlew install
build/install/Java.NETcore/bin/Java.NETcore
docker service update --replicas 2 app_redis
docker stack rm app
docker system prune
[java]/bin/keytool -genkey
-alias myPrivateServer
-keyalg EC
-keypass changeit
-storepass changeit
-validity 30
-dname "CN=PrivateServer, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown"
-ext san=dns:localhost,dns:Anders-Mac.local,ip:127.0.0.1,ip:::1
-storetype PKCS12
-keystore myPrivateServerCert.pfx
[java]/bin/keytool -export
-alias myPrivateServer
-storepass changeit
-storetype PKCS12
-keystore myPrivateServerCert.pfx
-file myPublicServer.cer
[java]/bin/keytool -import -v -trustcacerts
-alias publicClient
-file myPublicClient.cer
-keypass changeit
-storepass changeit
-storetype PKCS12
-keystore clienttruststore.pfx
drag myPrivateServerCert.pfx to login keychain
For Certificate in login keychain, setup Trust for SSL
add publicClient certificate to request or in code setNeedClientAuth(false)
[java]/bin/keytool -printcert -file myPublicServer.cer
[java]/bin/keytool -list -v -keystore myPrivateServerCert.pfx
var cer = (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(new FileInputStream ("myPublicServer.cer"));
var expDate = cer.getNotAfter()
dotnet dev-certs https -ep myPrivateServerCert.pfx -p changeit
dotnet dev-certs https --trust
var cert = X509Certificate.CreateFromCertFile("myPublicServer.cer");
var expDate = cert.GetExpirationDateString();
remove certificate from keychain
./gradlew StackStop
./gradlew DockerClean
rm myPrivateServerCert.pfx myPublicServer.cer clienttruststore.pfx