With such a specific app in mind - is what you're looking for to learn the skills to make it or just the app itself. Cause I could alternatively point you to an app that already exists that can be made to do this for you; Stats (Free and open source).
If you want to learn how to make apps like that with some level of generality - what's your existing programming experience level? The best kind of resources are going to depend on how much/what you already know.
Does it have to be SwiftUI? To my knowledge it's still not possible to make menu bar items exclusively with SwiftUI; You'd need to wrap the SwiftUI View in an AppKit NSView or something like that, so it might be easier to stick with just AppKit/storyboard - You can check out how I did HexHelper on my GitHub for the general approach on making an app that lives in the menu bar - the code isn't the cleanest or greatest but for seeing how to make a menu bar app it should be fine. It's available on my GitHub: GitHub.com/casperes1996/HexHelper
The AppDelegate, Info.plist, storyboard and ViewController contain the most relevant parts to setting up a menu bar app. This is AppKit though not SwiftUI - but as mentioned pretty sure you can't do it only in SwiftUI
As for reading the sensor, one approach at least is to use SMCKit
Apple SMC library & tool. Contribute to beltex/SMCKit development by creating an account on GitHub.
github.com
Alternatively inspect the code used in Stats; I know they have two mechanisms, one being SMCKit but they also have some other sensor reading system they use, maybe just through sysctl or something, not sure if it can dump battery sensor readings