This shouldn't be too hard. We use Kong which has rate-limiting plugins
> Analytics. Don't need anything too complex
I've never used Firebase's analytics, but it seems like we could do something fairly simple if there is enough demand for it. There are already some very feature-rich self-hosted tools in this space (like PostHog) though. Any reason why you wouldn't want to use those tools?