Skip to main content

Decorators and Functional programming

· 10 min read
raceychan
author of lihil, a developer.

lego

I often see people ask how to "do functional programming in Python"—as if it requires special tools or libraries.

But the truth is, many Python developers are already using functional programming techniques without realizing it. One of the clearest examples is the use of decorators.

Decorators are not only a staple of modern Python codebases but also a practical bridge between traditional imperative programming and the functional programming paradigm.

Set Up User Authentication in Minutes — With or Without a Standalone Database Using lihil-auth

· 5 min read
raceychan
author of lihil, a developer.

security

As someone who has worked on multiple web projects, I’ve found user authentication to be a recurring pain point. Whether I was integrating a third-party auth provider like Supabase, or worse — rolling my own auth system — I often found myself rewriting the same boilerplate:

  • Configuring JWTs

  • Decoding tokens from headers

  • Serializing them back

  • Hashing passwords

  • Validating login credentials

And that’s not even touching error handling, route wiring, or OpenAPI documentation.

So I built lihil-auth, a plugin system that makes user authentication a breeze. It supports both third-party platforms like Supabase and self-hosted solutions using JWT — with minimal effort.