Update 2024-01-27: Re-deployed the app on Vercel since they support Python serverless functions now as well. You can check it out at Gutachten Generator
In many professions one needs to write evaluations (”Gutachten” in German). For example a professor judging academic work, a teacher reviewing her students work or an engineer assessing the stability of a bridge. All of these have in common that they almost always consist of similar text snippets that vary along grade dimensions. So you would have a certain text snippet evaluating giving the grade “good” for a certain aspect of the work for example in school or university.
This calls for an automated solution that allows you to click together your evaluations text snippets. Sure Word can do that but that quickly becomes chaotic if you need lots of text to describe your evaluation dimensions and if there are lots of different quality grades. Gutachten Generator attempts to solve this problem. You can review the frontend- and backend code on Github.
It utilises the awesome lexical framework open-sourced by Facebook a couple of years ago. It is a fully functional text editor for the web similar to Google Docs but highly customisable. It generates a data structure akin to the virtual DOM in React that tracks changes in your text and its formatting. Extensions of lexical are written as React components. Custom functionality like in my case appending text snippets to the document on click can be implemented in this way. It even allows for creating custom nodes to be inserted into its data structure.
With Gutachten Generator you can define rating dimensions for your evaluation, define grades of that dimension, map them to text snippets and then conveniently append them to the text in your editor. Further editing can be done and everything is synched to the backend.
Aside from lexical I used this project to learn other technologies new to me thus far:
- FastAPI for the backend I was tired of serverless functions and the trade-offs that come along with reducing cold start time. Additionally I wanted to have more deployment options than just Vercel. Since I already know Python from my data engineering work FastAPI seemed a natural choice. It is indeed very intuitive and is supposed to as fast as a backend implemented in Go. Type safety is ensured through definition of Pydantic classes and I used SQLModel as an ORM. Another aspect was that after the complete paradigm shift in Next JS recently it seemed worth the effort to me to shift as much functionality out of the ever changing JavaScript/TypeScript world into something more stable.
- Auth0 for authentication Read all about that here
- Fly.io for deployment This was my first time using fly.io as an deployment option. It is basically a super easy to use edge-ready kubernetes cluster. You can deploy anything as long as it can be put into a container. FastAPI comes with uvicorn as a production ready server. For my React frontend I use a nginx to serve the static build. I found the deployment on fly very intuitive - their CLI makes deploying changes as easy typing “fly deploy”. This project makes use of their postgres offerings as well
Gutachten Generator is still work in progress. I am unsure of the card based text snippet UI and am still figuring out lexical features.