While testing my backend service for my main project BasedChat I often ran into the problem, that I needed to en- and decode data to test e.g. my websocket api. Since I wanted to do a small side project anyway and it is more convenient for me to have a direct, clear history for testing than having to use the console or base64encode.org/base64decode.org in the browser, I decided to build a tool/test suite.
Planning
I knew instantaniously, that I didn't want to just embed 2 TextFields and a Button into a View and call it a day.
Since I often use Postman for REST-API testing, i figured it'd be handy to safe recent operations for later access, just like Postman.
So what I needed to build that tool, was:
- SwiftUI
- SwiftData
- Libraries for en- and decoding other than base64
Sketching the User-Interface
- List of saved conversions
- Button to create new one
- Button to delete saved ones
- 2 TextFields to input the desired strings
- Button for encoding
- Button for decoding
- Multiple Choice list to select the format
- Splitted View to separate input-view and List of saved Items
Planning Features
- En- and Decoding
- Saving and retrieving last 100 operations
- creating new
- caching operation to be able to look smth up in a saved one and the return and go on
- emptying TextField
- reversing a string thats inside (because its fun and I needed it once)
Upcoming Features
- Encryption Algorithms like AES, RSA
- Key Establishment like ECDH, pq-crystals/kyber
- Support for Files
- Automated WebSocket Test
Process
I searched for Libraries that support base32, base16 and base8. I didn't find one, so I 'quickly' did it myself (actually I had a lot of padding issues, but nobody needs to know that, right?)
Also I spent a lot of time experimenting with Material in the background, since I discovered it and figured I liked it. In my opinion it makes the GUI a little lighter.
Finished?
The time I thought I was finished with the product, it occured to me, that I'd need a way to bring updates to users, cause while creating Coder, I didn't have a paid Apple Developer Account yet, to rely on AppStore. I had a lot of fun with Sparkle (I didn't) and I had to disable Sanboxing, which wasn't optimal. But for now it worked, so I was happy.
Finished!
Funny Sidenote
A few days later I removed Sparkle, because the AppStore requieres that an app is sandboxed