Weekly Dev Update 8
RTSP Server | Serverless | Microservices | Go Web Dev
More of an update on how the year has gone nearly 3 months in, where projects are at, where they’ve progressed from, and some skills picked up along the way.
Project Pact
This is a web development project, fairly simple http server, using Go’s standard library for as much as possible in order to learn as much as I can about http servers with Go. There’s a UI for un-signed in guests, with features locked for signed-in users, as well as paying members having all the features. Users have either a ‘manager’ or ‘worker’ role, and managers assign tasks to workers with requirements. Workers complete those tasks, and submit for review. Some nice automation features along with that baseline theme.
Last year, I got the base db schema working with sqlite, sqlc for type generation and function snippets set up, while still giving me full control of the SQL, unlike an ORM that removes you from the SQL, oft leading, in my experience, to a horrific time with debugging complex SQl queries, and extremely slow queries due to unnecessary JOINS made.
This project stalled out late last year partly because it’s main competitor actually did some things I had hoped I was being unique for adding. However, I ended up doing more research, only to realize that my app had a major advantage because I am doing file storage for media files, which is a major feature I’m actually excited to implement. In the meantime, I give users a kind of ‘role’, and originally, I bound this to the account. So you sign up as either a ‘worker’ or ‘manager’, however, I realized, this is very limiting. I could instead use an existing ‘relationships’ table, that acted as a series of connections, like friend requests, and set the role there. So the user can pick an active relationship, and the UI changes to the ‘worker’ or ‘manager’ role accordingly! Eliminating the need for multiple accounts.
This year, I finished giving users the ability to make new connections, and select the correct corresponding role based on that connection. Some refactoring still going on, on that front. Drastically improved the UI for the sections of creating / accepting the connection requests as well.
Project Muse
This is a project that I have been using to learn about gRPC, microservice architecture, and cloud services. The project requirements go as follows: multiple cameras stream their videos to an RTSP (real-time streaming protocol) server. This server processes the videos, and uses AI to summarize everything said in the streams, sending me alerts for manual review if anything needs reviewed by a human.
My vision for this, was more of a fantasy-hacker kind of project idea. What if I could leave a tiny raspberry pi in a location, and it acts like an automated ‘spy’, giving me information on things that an AI could determine are worth me knowing? It’s the sort of thing that’s completely normal in a spy movie, but terribly impractical, probably expensive on the hardware to even get working. Nonetheless, I’m a developer with a dream, and I’d get to work with cloud technologies, AI, serverless storage and Lambda, as well as, I’d soon discover, give me the opportunity to work with some technologies I’d come to really enjoy working with, like FFMPEG.
In reality, this project needed some adjustments. While for development purposes, I decided to move from microphones to video as the base layer, because I’d eventually want to process video as well, lets get it working with video first! I’d also come to realize, for developments purposes, I’d need to learn how to fake a video camera streaming. To solve this, I created a service that just subscribes to the feed of an RTSP server I made, and streams an mp4 file on a loop. Effectively, acting just like a security camera! All well and good on that front. It’s happily up and running.
The RTSP server stumped me for a while, however, I did get it running, processing videos, and then using FFMPEG, cutting out the audio, and saving it to mp3 files. Then, send the mp3 files to an AWS S3 bucket. Then I learned enough Lambda to use AWS Transcribe, a service that takes in mp3 files, and converts them into JSON that has a string of a transcription, thing of it like a useful tool to make automated subtitles. At this point, if my camera overhears you talking, the server will use AWS to get a log of everything you said. Kinda scary right? Then lambda dumps the resulting JSON into a second bucket.
The next steps are to get the next service to collect the JSON from the S3 Bucket, and process the information, log it, then, once enough data is collected, use AI to categorize, and summarize this information.
I recently spent some time diving back into Docker, and using it, rather than learning about it. Each service, simulator, RTSP server, and transcription-reader that will send & recieve the info to the AI API, all have been given their own Dockerfile, and a layer above those, I’m nearly done with Docker Composer, which will let me start up all the services in one command, simplifying running tests in development, instead of running each service manually, which I have been getting away with until this point.
I think for the MVP, the major tasks that are still fairly challenging will be to get multiple videos to stream to the server at once. That would allow me to have many different video cameras & microphones collecting information from anywhere.
As for the morality of this kind of project, I’m not the type to abuse this kind of creation. I’m using a fun/scary idea as a motivator to push me to learn some new technologies. As for things I could imagine doing, I genuinely want to get the hardware working using Raspberry Pi’s, test a few running in parralel, and then consider using this software for all future drone-projects. I think the next stage of my side projects involves using a lot of funky automation on drone technology, especially if I can get a fairly silent drone, it could make the listening/monitoring software on it rather interesting.
Summary:
Pact & Muse are the main projects I declared that I would focus on this year, and, a man of my word, so far I’ve managed that much. While it isn’t a mind-blowing amount of progress, because I’ve been terribly busing with work, and vacationing with my family, I am seeing real tangible progress, and truly believe I’ll see both of these projects reach their MVP by the end of this year, something I’d be incredibly proud of. Hopefully I can get a little better at weekly updates, but for now, that’s all I’ve got! Thanks for the read.