/Noor-ul-huda

Primary LanguageTypeScript

NHA Admin Application

Micro frontend for managing NHA operations

Technology stack

  • React
  • Typescript
  • Chakra UI
  • Spring Boot
  • Spring Cloud Gateway
  • JDK 11
  • Kotlin
  • Docker

The application is split into 2 modules. The frontend react application and spring boot backend

Development Setup for Frontend

Available Scripts

The frontend module is located at src/main/frontend. The same location should be used to load the project in IDE

In the project directory, you can run the following commands in the terminal:

npm install

Installs all the required dependencies for the project

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.

npm test

Launches the test runner in the interactive watch mode.

npm run build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

Development Setup for Backend

  • Install SDKMAN to setup and manage different versions of JDK. AdoptOpenJDK is recommended JDK implementation for installation
  • Install Docker. Different OS have different installation guides.
  • Install Docker Compose. Different OS have different installation guides.
  • Install an IDE of your choice. At the time of writing, IntelliJ is the only IDE with comprehensive support for kotlin

Building the backend application

Maven is used as a build tool for building the application. The project has maven wrapper for Linux and Windows environments and scripts to execute the build respectively. Maven installation is not required

For Linux machines, use the following command to build the application.

  • cd into the project directory
  • ./mvnw clean verify command to build the application

For Windows machines, use the following command to build the application.

  • cd into the project directory
  • ./mvnw.cmd clean verify command to build the application

The maven command will also copy over artifacts generated by the frontend build under src/main/frontend/build folder to public folder under target/classes folder.

If there are changes in the frontend code, rebuild the frontend react app and execute the following maven command from the terminal or from maven tool window if using IntelliJ IDE

mvn resources:resources

To the run the application locally, set the following environment variable in IDE

SPRING_PROFILES_ACTIVE=development