Show HN: Kardius – find people like you, near you – made with Rust and Rocket
Hi Hacker News,<p>I was looking for a project to learn Rust with and improve my webdev skills, so I came up with the idea of Kardius. After reading The Rust Programming Language I began work on it. I posted it on reddit some months ago and tried to iterate on their feedback, so now hopefully it&#x27;s ready for the big stage of Hacker News! (still very nervous though)<p>Basically, I had remembered Paul Graham&#x27;s advice of &quot;make something that you yourself would want&quot;, and I had always wanted a way of finding like-minded people around me. I had the idea for a website &#x2F; app that let you swipe on concepts instead of people. For example, cards like &quot;Hunting, Vaccines, Cities, Podcasts&quot; would appear, and swiping right on them would mean you liked the idea or identified with the concept, with swiping left indicating the converse.<p>So, I made just that. It then uses the Manhattan distance formula to compute your similarity to others. You can also view statistics like the average swipe value for a card and how that card correlates with other ones (e.g. Hunting and Guns are highly correlated with each other).<p>You can then also view clusters of cards on profile pages. These are groups of cards with votes highly correlated with one another (initially found via SciKit&#x27;s Agglomerative Hierarchical Clustering Function). You can then see how users align to these clusters. Another reason for clusters is because I am using the Postgres CUBE data structure to compute similarity between users, and CUBE caps out at 100 elements (and there&#x27;s currently 250 cards). So to resolve that votes for cards are clustered into, well, clusters, and then the distance between CUBEs can be calculated, and this can all then be indexed for high performance similarity searching.<p>There is also the Interests page that lets you enter your individual interests. This is because not every interest can be a card as there can only be so many and the ones that do exist should be well-known and relatively controversial to give better predictive power. So, once the base similarity is established via swiping on popular topics, this page lets you tag yourself with whatever you&#x27;d like and then also search users and posts for these tags as well. There&#x27;s also an interface on the Conversations page to easily keeping track of the latest posts for your interests.<p>In addition, you can privately message users and publicly create posts and tag them with whatever you&#x27;d like (examples: Rust, Hiking, etc.). You can also filter users and posts by date, similarity, age, and distance.<p>My backend dependencies are currently rand, bcrypt, serde, rusoto (for uploading avatars to s3), oauth2, reqwest, time, rocket, tokio, futures, deadpool (database connection pool), web-push, deunicode, async-stream, and pin-project-lite.<p>For Rocket I am using the async branch (recently merged to master, hooray!) and thus far it&#x27;s been great. I&#x27;m extremely happy with it, both due to its technical merit but also because of the tremendous help the creators provide in terms of technical support. It was my first Rust project so I had a ton of beginner questions along the way and they were always extremely patient and insightful. The rocket server is currently hosted on a free-tier AWS EC2 instance.<p>For real-time messaging, I ended up creating a Server Sent Events library. It&#x27;s basically just a channel that the multi-threaded Rocket server sends commands to (join this user to this room, send this message to this user or room, etc.). The library has a bunch of hash tables that keep track of all the rooms, users, and subscriptions. I also recently added support for an event log so users can temporarily disconnect and then receive all the messages they missed upon their return without having to refresh. If there is any demand for this I&#x27;d be happy to polish it up a bit and throw it on GitHub, as I&#x27;m sure my implementation is far from ideal.<p>On the frontend I am using React and... that&#x27;s it actually. It&#x27;s probably not the wisest decision (although I am kind of afraid of npm) but I ended up just creating minimal libraries for everything I normally would use a dependency for. My simplistic Markdown parser is around 150 lines, my Axios &quot;clone&quot; is just a small 100 line wrapper for fetch, my routing library is just matching the URL against my small list of path regexes and returning the corresponding component to render, etc.<p>Returning to the website&#x27;s features themselves, I tried to make as many available as possible without logging in, as I generally dislike logging into sites, so no pressure to create an account at all! What I&#x27;d like more than anything is any suggestions or feedback that you might have, because I&#x27;m perpetually full of doubt and indecision on the proper course of action to take. Another thing I&#x27;m struggling with is marketing and actually getting it out there, as I know nothing of that world, and I always feel kind of weird about self-promotion. Anyways, thanks so much for reading!