Skip to main content
personal

Why I Built RiteLoop: The Tech

The tech itch behind RiteLoop. C#, SignalR, React, AI, habit tracker from scratch.

RiteLoop exists partly because I needed a tech project to test out new technologies. After six years writing a mid-sized fintech system in Node.js and plain JavaScript, I was itching for something different. Here’s the tech side of the story.

The Itch for Something New

I’d spent years in JavaScript land. Minimal TypeScript. As always with bigger systems, it became a race for features, with little time to obsess over writing things exactly the way I wanted. I wanted to build something where I could choose the stack from scratch and do it right.

My son had been learning Unity and C# since the summer, so I figured I’d try C# too. Maybe I could help him out when he gets stuck. That nudged me toward the .NET ecosystem.

I’d also wanted to build a real-time system. In the fintech app we built, my colleague wrote 90% of the frontend. For RiteLoop, I wanted to dig into that myself. So I went with WebSockets over SignalR for real-time updates. No polling. When you complete a rite, it shows up instantly.

The Stack

I chose a stack I could stand behind:

  • Backend: ASP.NET Core with SignalR, PostgreSQL on neon.tech, OAuth2 (Google) + JWT
  • Frontend: TypeScript, Vite 7, React 19, Tailwind v4, DaisyUI v5, Zustand, React Hook Form, Zod
  • Monorepo: Moonrepo, pnpm, shared packages

The architecture is straightforward: all core rite operations go through SignalR hub methods. No REST for the main flows. Authentication and admin endpoints use REST. The backend computes daily rite instances from schedules, merges them with existing records, and pushes updates in real time.

If you want the nitty-gritty, see About RiteLoop for the high-level story, or How It Works for the Identity → Rite → Practice → Evidence cycle.

Why This Matters for the Product

The tech choices weren’t arbitrary. Real-time matters for habits. When you complete a rite, you want to see it reflected immediately. No refresh. No “did it save?” SignalR gives that. The scheduling engine supports fixed times, intervals, weekdays, monthdays, and combinations. That flexibility lets you model real-life habits, not just “every day at 8am.”

PostgreSQL and Entity Framework Core keep the data model clean. FluentValidation at the boundary. DTOs for all API surfaces. It’s the kind of structure that scales when you add features.

Building with AI

I also did this to try out what AI can do. Where does it work? Where does it create slop and spaghetti?

I first vibe-coded the frontend without looking at the code. As one could expect, it was crap. After that I started over from scratch. I wrote prompts and did manual code review after each change. Discarded some, kept some, rewrote some by hand.

My experience: it takes about the same time to write with AI as without. But you get better quality. The draft code goes really fast. Then you have to review lots of code and create prompts that fix whatever you find that’s bad. In the end I think it’s a win.

And yeah, I didn’t actually have to learn and remember all C# syntax. I feel it’s enough to almost understand stuff. I understand the code when I see it, but I could probably not come up with it and write it myself without more learning. That part was actually a lot faster.

I admit that some of the text on this site has been rewritten by AI. I first did lots of writing in a brain-dump manner, some in Swedish, some in English. Then I let the LLM fix it up. I read and review to see if the text still feels like me when I make an effort to write ok. I remove things that aren’t actually true, or feel bloated or repetitive.

The prompt to write this section was:

Add a part about AI.

I also did this to try out what can be done with AI. Where does it work, where does it create AI slop and spaghetti. I first vibe coded the frontend without lookin at the code. But as one could expect, it was crap. After that I did start over from scratch. Writing prompts and did manual code review after each change. Discarded some, keept some and rewrote some byhand.

My experience is that that it takes about the same time to write with AI as without. But you get better quality. The draft code goes really fast, then you have to review lots of code and then create prompts that fixes whatever you find that is bad. So in the end I think it’s a win.

And yeah, I didn’t actually have to learn and remember all C# syntaxes. I feel that it’s enough to almost understand stuff. What I mean with that is that I understand the code when I see it, but I could probably not come up with it and write it myself without more learning. So that part was actaully a lot faster.

And i admit that some/all of the texts has been rewriten by AI. I have first done lots of writing in a brain dump manner, some in swedish some in english. And then I let the LLM fix it up for me. Read/review to see if the text still feels like me, when I make an effort to write ok. Remove things that i not actually true, of feels bloated or repetative.


For the habit and identity side of the story, see Why I Built RiteLoop: The Habit Journey.