Kais DevBlog

More or less structred thoughts

Integrating a Telegram Bot with Structr (Part 2 - WebHooks)

Posted in Structr by Kai on Apr 09, 2021

In part 1 of this article, we got the basic Telegram integration going. As it often goes, in the initial version the easiest approach was used and now that we know a bit more, we want to implement a better approach. We would like to use the WebHooks feature of the Telegram API. This reduces load on our server and we also don't spam their servers with requests. Luckily with Structr and our previous code this is pretty easy. We are basically 90% there. In this article we will enable WebHooks in our project and figure out the remaining 10%.

Read more
Server-sent Events in Structr Applications

Posted in Structr by Kai on Apr 02, 2021

One of my previous posts about communcation via a Telegram Bot reminded me that Structr also has support server-sent events using the EventSource interface. This enables us to push live updates to users with a few lines of JavaScript. In this post we will extend the example application from the previous post and create a small example with an auto-updating progress-bar using this pattern. With a little imagination we can adapt this basic example to more advanced scenarios. Let's get started...

Read more
Reusable TailwindCSS Components in Structr

Posted in Structr by Kai on Mar 16, 2021

This post serves as kind of a "Part 2" of the previous post. Using TailwindCSS is nice but creating reusable components (regardless of the framework) seems to be a common problem when learning how to develop with structr. In this article I'll explain my (currently) favorite method of creating and working with components.

Since explanations are often only half as good without examples, I'll also add an example project which can be imported and explored locally. It contains a simple dataset and schema and a couple of pages to illustrate how I would build and use components in structr. Because I currently really like to work with TailwindCSS the example will be using it as well as a UI Kit for it. This will be LoFiUI because it can be redistributed (even though I like TailwindUI better).

Read more
Using TailwindCSS in a Structr Project

Posted in Structr by Kai on Feb 24, 2021

Maybe Tailwind is the best thing since sliced bread, maybe it's just the newest hype. But one thing I can say for sure is that even a design-illiterate like me can create things that look (kind of) good. So naturally I'm interested to integrate it into my workflow with Structr.

The basics are explained quite well in the basic installation guide but it took me quite a while to get it production-ready which is why I'm writing this short tutorial.

Read more
Integrating a Telegram Bot with Structr (Part 1)

Posted in Structr by Kai on Feb 16, 2021

Push notifications are (kind of) awesome! But unless you want to go the extra mile and create a native mobile application for you web application, you are often stuck with emails. That is not necessarily a bad thing though, emails are robust, everyone has an email address and it is unintrusive most of the time. But sometimes you really want (or even need push notifications). Using a messenger app with an API is a simple solution - in this post I'll take a quick look at how to integrate a Telegram Bot with Structr.

Read more