From: David S. <st...@pr...> - 2019-08-21 10:28:14
|
Dear Gramps devs, I've been a Gramps user since about 2008 and am very grateful for this great piece of software helping me in my genealogical research. In the last few months, I've developed a web app to share my results with my family. Although I'm aware that I partly reinvented the wheel, I am quite happy with the result so far so I wanted to share it with the wider community. If you are interested in the details, please read on. Basically, I wanted to have a dynamic web app that I can run directly off my Gramps database and have an interface in the browser that is not too dissimilar from Gramps' own UI. This is kind of in the spirit of GEPS 013 (Gramps Connect), which is no longer developed AFAIK, even though what I have so far is read-only, i.e. does not have collaborative editing (and thus perhaps does not provide much added value compared to the nice Dynamic Web Report, or also compared to the interesting app that was shared by Steve on this mailing list yesterday). The basic idea is to realize a (authenticated) Python REST API to a Gramps family tree database using Flask. This Python app directly uses the gramps Python module (specifically, gramps.cli and gramps.gen) for database access and everything that has to do with genealogy, which allows it to be very lightweight, more or less just serving dictionaries returned by Gramps functions as JSON. In my view, the great advantage over the original Gramps Connect is that the Pythonic part is much easier to maintain and does not require any changes to Gramps itself. The frontend of the web app is then completely written in Javascript, based on Google's "PWA Starter Kit" that provides a modern single-page progressive web app. It fetches most of the database information on loading the app and caches it, such that database queries are only necessary when fetching additional information, e.g. media details. Image thumbnails are generated automatically (using Pillow) and are cached as well. While all of this is of course more tricky to deploy to a server than a static web site, what I like about it is that in principle one can leverage all the power of Gramps, e.g. for generating reports, export/import, or also, at some point, collaborative editing. For instance, I even use the localization functions of Gramps to automatically translate the entire UI into any language supported by Gramps. If you'd like to try it out, please have a look at the Github repo https://github.com/DavidMStraub/gramps-webapp (the frontend source is here: https://github.com/DavidMStraub/gramps-webapp-frontend). There is also a demo running on Heroku (it might take a couple of seconds to start up): https://agile-bayou-66821.herokuapp.com/ The password is "test". I'd be very happy about feedback and suggestions. Maybe there is also a way to combine this with what other people have been working on. If anyone is interested in collaborating on this (e.g. adding editing capabilities), please reach out via Github or e-mail. Cheers, David PS: All of this is only possible thanks to the new DBAPI introduced in Gramps 5.0. It will refuse to open a BSDDB database (I did get corruption when trying) and currently only works with SQLite. Needless to say, please back up your database before using this! Sent with [ProtonMail](https://protonmail.com) Secure Email. |