Running the application locally
Run both the frontend Vue.js application and the Micronaut backend in two terminal windows.
Run the Vue.js frontend
In the vue-frontend
directory, to install the dependencies:
npm install
Then to run the frontend local server:
npm run dev
Open your browser at http://localhost:5173/ The Vue.js frontend will proxy calls to the Micronaut backend service.
Run the Micronaut backend
In the micronaut-backend
directory:
./gradlew run
Building the standalone JAR
In the micronaut-backend
directory:
./gradlew shadowJar
Assemble the front and the backend
In project base directory:
./gradlew assembleFrontAndBack
Build the container image with Docker
In project base directory:
docker build . --tag eu.gcr.io/stootistics/micronaut-backend --platform linux/amd64
Run the built container locally
In project base directory:
docker run -it --rm -p8080:8080 eu.gcr.io/stootistics/micronaut-backend
Deploy to Cloud Run
gcloud
Preparation of your project with gcloud init
gcloud config set run/region europe-west1
gcloud config set run/platform managed
gcloud auth configure-docker
gcloud components install docker-credential-gcr
Pushing the container to the registry
docker push eu.gcr.io/stootistics/micronaut-backend
Service deployment
gcloud run deploy stootistics --image eu.gcr.io/stootistics/micronaut-backend --allow-unauthenticated
Overall deployment process
./gradlew assembleFrontAndBack && \
docker build . --tag eu.gcr.io/stootistics/micronaut-backend --platform linux/amd64 && \
docker push eu.gcr.io/stootistics/micronaut-backend && \
gcloud run deploy stootistics --image eu.gcr.io/stootistics/micronaut-backend --allow-unauthenticated
Deployment of the Firebase configuration
firebase deploy --project stootistics
You'll need to setup Firebase, with
firebase login --reauth
firebase projects:addfirebase stootistics
firebase init hosting
Miscellaneous
This project is not an official Google project.
It is released under the Apache License 2.0.
It was developed as a demonstration for a conference by @glaforge.