Hello Airavata Community,

I’m writing to share a summary of my progress so far over the last two
months on modernizing the Apache Admin functionalities. The primary goal
has been to begin migrating the functionality of the legacy PHP-based admin
server into a modern React based application in the
airavata-research-portal repo.


The first phase of my progress so far involved significant UI development.
Working with my peers on UI/UX designs, I implemented several new
components and pages for the research-portal. Some work included a revamped
research catalogue page, providing new views for managing models,
repositories, datasets, and notebooks. Other work included building the UI
for adding new items such as new compute resources & storage resources and
starting new sessions. All of this development was on top of the current
research portal which was being built on Chakra UI v3 library. Furthermore,
I also moved all of my changes into a fork of the new airavata portal
repository so that my changes can be easily integrated with a pull request.
Temporarily, the UI used mock data in order to promote easy building of the
UI.


The next major step was to replace the mock data in the UI with live data
from the backend via the Apache Thrift API. This proved to be a significant
technical challenge, and here I will share the journey and findings with
the community so that future Thrift-based work can benefit from my
experiences.


The first hurdle was generating a modern TypeScript client compatible with
our Vite-based React application. The standard Thrift compiler generates
code using CommonJS rather than ESModules (as CommonJS used to be much more
popular in the past). Since then, most React based applications have begun
to adopt ESModules and Thrift’s implementation of esmodule based generation
is known to be filled with bugs within the community. In order to resolve
this, I had to build thrift from source (main branch) which has unreleased
changes that help Thrift run in the browser. Furthermore, I had to generate
polyfills to give the browser which provided necessary functionality for
the thrift code to run.


So the main things to note if you pursue using Thrift in the browser in the
future are that: the latest official release of thrift doesn’t properly
build Javascript/Typescript code for the browser so you should build from
source: https://github.com/apache/thrift . Also, you should be ready to add
polyfills as needed.


>From here, I was still getting many errors being able to connect to the
main thrift server so I built a local Thrift server in order to fix issues
and I was able to build a fully functional portal using my local Thrift
server. From here, I will work with the Airavata community to get the
research portal’s necessary APIs up and running in HTTP format, rather than
TSocket for future use!


Thanks,

Krish Katariya

Reply via email to