Posts

ReactJs + NodeJs for Java Developers

  Background I am a Java Developer who enjoyed developing both server side web (frontend) and server side (backend) Http API. In recent years, Java or other JVM languages are predominantly used for server side API and NodeJs stack is the defacto standard for Frontend. This page explores the frontend (UI) development using ReactJs + NodeJs stack using Java lens by comparing tools and framework in Java stack. Source code available at:  https://github.com/harishkannarao/react-nextjs-rest-api In this repository, I explored the ReactJs ecosystem to build, test (unit and integration) and deploy a pure client side rendering (CSR) web application. Development Stack ReactJs is the basic building block to build the UI components and NextJs is built on top of ReactJs to create pages with routing and deployment tools for application built with ReactJs. Axios is a very popular Http Client library to fetch data from server side Http APIs NodeJs Java ReactJs  ...

nodeenv: Isolated node runtimes on MacOS

nodeenv allows to create isolated node runtimes per project which resembles to virtual environments in python world. In enterprise projects, where multiple projects are built against different versions of node runtime and dependencies, it is advantageous to have nodeenv to install multiple versions of node runtimes at project level. Install nodeenv brew install nodeenv or pip install nodeenv List available node runtime versions nodeenv --list Create latest node version as virtual environment nodeenv .nodeenv Create a specific node version as virtual environment nodeenv --node=14.15.0 .nodeenv Activate a virtual environment source .nodeenv/bin/activate Verify node and npm version node --version npm --version Install a package scoped to the virutal environment npm install -g cypress Deactivate or exit from virtual environment deactivate_node Delete the virtual environment rm -rf .nodeenv

GitOps - Viewing and Creating git tags

In a team following continuous delivery based on git tags or otherwise popularly known as GitOps, there will be a frequent need to list the existing tags in a repository in chronological order so that a new tag can be created based on recent commit (HEAD) from master / main branch. The following chained command will list all the remote tags in chronological order along with latest commit, so that new release tags can be quickly created through command line. List all annotated tags name with the commit SHA in chronological order along with recent commit id git fetch origin && git checkout master && git pull && git ls-remote --tags --sort=creatordate origin && git log -n 1 Create a new tag based on master / main branch or specific commit SHA and push the tag to remote server tag_name="production-v1.0" && git tag -a $tag_name master -m "Production version 1.0" && git push origin $tag_name

Creating python virtual environments on Mac OS with pyenv

Using pyenv Install pyenv through homebrew: brew install pyenv List installed versions of python: pyenv versions List available versions of python that can be installed: pyenv install --list Virtual environment for python 3: Install a specific version of python: pyenv install 3.9.0 NOTE for Big Sur (MacOS 11) users: If the install command fails, then try the command as SYSTEM_VERSION_COMPAT=1 pyenv install 3.9.0 Uninstall a version of python: pyenv uninstall 3.9.0 Switch to specific version of python in local terminal window: pyenv local 3.9.0 Switch to specific version of python globally: pyenv global 3.9.0 Switch to specific version of python using environment variable: export PYENV_VERSION=3.9.0 Get pyenv root directory: pyenv root Access the python installation: pyenv exec python --version Create a virtual environment from specific python version: pyenv exec python -m venv .venv Source the virtual environment source .venv/bin/activate Virtual environment for python 2: Install ...

Empowering Backend Engineering Team

Image
I am writing this blog to share the ideas and concepts which will empower the backend developer, devops engineer and QAs. Terraform Presentation Slide These ideas are not tied or limited to particular framework or libraries or cloud providers, instead these can be in many different ways using different tool sets which the team might already be familiar with. To achieve these end goals, the backend application and devops toolsets should be complementing each other in various aspects. I am going to list out the desired features I would like to have in my project / team under various categories. I have also created the following sample repositories on github to showcase these ideas in a simplified way. Sample Java Spring Boot application with Maven: https://github.com/harishkannarao/MySpringBoot Sample QA Acceptance tests with Gradle: https://github.com/harishkannarao/gradle-qa-acceptance-tests Sample Infrastructure as Code in AWS with Terraform: https://github.com/ha...

Install and Switch multiple versions of Java JDK on Linux or MacOS

While working on enterprise level, we often have java projects running on older versions of java for legacy reasons. Hence it is not very uncommon for a developer to have multiple versions of JDK installed in their machines and easy way to switch different versions of JDK on demand for running the build. This blog explains the steps needed to setup and configure multiple JDK versions on Mac OS. Get the architecture of the Machine from Terminal using: uname -m Create a directory for installation: mkdir -p $HOME/tools/java Download java binaries: Download java 25 and 21 binary for Linux / Mac OS operating system with the correct architecture type to directory $HOME/tools/java Download URL https://adoptium.net/en-GB/temurin/releases?mode=filter&os=any&arch=any Extract and rename java binaries: find $HOME/tools/java -type f -name OpenJDK25*.tar.gz | xargs -I {} mv {} $HOME/tools/java/OpenJDK25.tar.gz find $HOME/tools/java -type f -name OpenJDK21*.tar.gz | xargs -I {} mv {} $HOM...

Docker Community Edition download without login

Docker recently changed their download mechanism, which prevented users from downloading the Community Edition without log in. In my opinion, the registration and login should be an optional step instead of a mandatory field. Hence I am listing the download link for Mac OS and Windows OS that allows downloading the Docker Community Edition without having to register an account with login. Mac OS: https://download.docker.com/mac/stable/Docker.dmg Windows OS: https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe