I would suggest using DAVxāµ for it, although you will need some service providing a CalDAV server then. This could be a Nextcloud or some dedicated server like Radicale v3 Documentation
If you donāt want to rely on an external service, DecSync CC is an option that piggybacks off of Syncthing. Although I think it may have issues where technically any app with storage access could read the directory.
The enabled contacts/calendars/tasks are stored in the corresponding Android content providers, which makes them available for other apps with the appropriate permissions. Furthermore, the enabled contacts/calendars/tasks are also synchronized with the selected DecSync directory, which makes them also available for other apps with access to this directory.
There is also EteSync, but I think development on it has slowed?