Learning Rust by building a Velvet Room in my terminal
· rust, ratatui, side projects, tui

Most of my work is JavaScript and TypeScript. Web apps, auth flows, payments, the usual. I wanted to learn something that would make me think about the things JS quietly handles for me, and Rust kept coming up. The problem was I've never been able to learn a language from toy examples. I need a thing I actually want to exist.
So I'm building persona-tui, a terminal dashboard styled after the Velvet Room from the Persona games. This post is about how that's going: what's been hard, what's clicked, and what I'd change. It's not a tutorial. I'm still very much in the middle of it.
Why a terminal app, and why Rust
The idea was a hub that stays open all day on my desktop and laptop. Tasks, deadlines, a calendar, whatever's playing. Something I glance at, not something I open.
That "always on" part ended up deciding the stack. I looked at Ink, which is basically React for the terminal and would have let me stay in TypeScript. I ruled it out because a Node process sitting there all day felt wrong on memory, and startup time matters for something you want to pop open instantly. Rust with Ratatui gives me a single small binary, no garbage collector, and fast startup.
I did give myself an escape hatch. If the borrow checker turned the whole thing into misery, I'd switch to Go with Bubble Tea. I haven't needed it yet.
Why Persona
[CHECK: a couple of sentences on your own connection to Persona. Which game, and why the Velvet Room aesthetic in particular.]
Persona has always been about juggling time and deadlines, so a productivity dashboard themed around it felt less like a gimmick than it sounds.
What it does (or will do)
The hub screen is split into panels:
- Tasks, grouped by urgency: Today, This week, Later, Completed
- Calendar
- Moon phase, which changes as deadlines get closer, so the moon fills up as things get urgent
- Now playing, showing whatever music is on
For v1, everything is stored as local JSON. I'm putting a storage layer in early so I can swap in sync later without rewriting everything.
Where it is right now: the crate is scaffolded, the terminal setup and teardown works, the core App state and main loop are in, and there's a static five-panel layout rendering. Next up are the moon phase logic, real task data, keyboard controls and persistence. [CHECK: update this paragraph with current progress before publishing.]
How I'm learning
I started out reading the Rust Book front to back. By chapter 8 (hash maps) I had to admit I found it boring read in order. Things stuck much better once I flipped it round: build the next feature, hit a wall, then look up the chapter that explains the wall.
Two other things helped. I keep handbook-style notes per chapter in Obsidian, so I've got a reference written in my own words. And I map every new concept to something I already know from TypeScript:
- a
structis closest to a TypeScript interface - Rust
enums are much more like discriminated unions than TS enums HashMapisnew Map(), or an object used as a lookup table
The HashMap one sounds obvious written down, but I genuinely couldn't picture it until I made that link.
I've also been using Claude as a better search engine rather than a code generator. It points me at the right docs and explains concepts, but I write the code. I relaxed that rule twice when I was properly stuck (once on event handling, once on the first layout skeleton). I'd rather be upfront about that than pretend I did it all from the Book.
What was hard
So far, honestly, not the borrow checker. [CHECK: if you've had a real borrow checker fight since, swap it in here, it's what people will expect.] What got me was the module system.
Moment one: modules inside modules. In JS, a file is a module and that's the end of it. In Rust, you declare the module from the crate root with mod app;, and the file app.rs is that module. I didn't get that, so I also wrapped the contents of the file in a module:
// main.rs
mod app;
// app.rs
pub mod app {
pub struct App { /* ... */ }
}
That gives you crate::app::app::App, and then nothing can find anything. The fix was deleting the wrapper. What finally made mod, pub and use make sense wasn't the Book's prose. It was drawing out the file tree and reading the paths off it.
Moment two: the compiler sent me the wrong way. I'd created an empty src/event.rs while scaffolding, because I'd planned to have an event module. Later, in app.rs, I wrote event::read()? meaning Crossterm's event reader, and got this:
error[E0433]: cannot find module or crate `event` in this scope
help: to make use of source file src\event.rs, use `mod event` in this file
Rust's compiler messages are brilliant, so my instinct was to do what it said. But it had matched on the name and found my empty file. Following it would have pulled in the wrong module entirely. The real problem was my import. I'd brought in the items from crossterm::event but not the module itself:
use crossterm::event::{self, Event, KeyCode, KeyEvent};
That self is what makes event::read() resolve to Crossterm. Small fix, big lesson: the compiler's suggestions are very good guesses, not gospel.
There was a smaller one before either of those, while I was still on the Book chapters. I had a function filtering completed tasks out of a Vec<Task>, called it inside a loop by mistake, and got duplicated output. Not a Rust problem, just a me problem, but debugging it is where iterators started to feel normal.
What clicked
Enums and match. Having match refuse to compile until I've handled every variant is the thing I'd most like to take back to TypeScript. Same with if let for pulling out just the case I care about. That's how the main loop only reacts to key events and ignores everything else.
Ratatui layouts. Once I realised a Layout just splits a rectangle into smaller rectangles, and you can split those again, the five-panel screen was straightforward. If you've nested flexbox containers, you already understand it.
Doing logic before looks. I deliberately parked Ratatui's styling system (Style, Span, Line and friends) until the state and persistence are solid. Right now the Velvet Room is mostly boxes with titles. That's fine. A pretty dashboard with fake data teaches me less than an ugly one with real data.
What I'd do differently
[CHECK: make sure these match how you actually feel.]
- Don't scaffold empty files ahead of time. That empty
event.rsexisted only because I'd planned for it, and it caused the most confusing error I've had. I'd create files when there's code to put in them. - Start build-first from day one. I spent too long reading the Book in order before I had any project code to hang it on.
- Draw the module tree before writing any
modlines. Both of my worst module bugs would have been obvious on paper.
Next
Next on the list is the MoonPhase enum and the function that turns "how close is this deadline" into a phase. It's the first piece of real logic that's specific to this app rather than terminal plumbing, which makes it a good test of whether any of this has stuck. I'll write that one up when it's done.