Hacker News new | ask | show | jobs
by pitherandd 2147 days ago
Hi Hacker News,

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's ready for the big stage of Hacker News! (still very nervous though)

Basically, I had remembered Paul Graham's advice of "make something that you yourself would want", and I had always wanted a way of finding like-minded people around me. I had the idea for a website / app that let you swipe on concepts instead of people. For example, cards like "Hunting, Vaccines, Cities, Podcasts" would appear, and swiping right on them would mean you liked the idea or identified with the concept, with swiping left indicating the converse.

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).

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'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'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.

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'd like and then also search users and posts for these tags as well. There's also an interface on the Conversations page to easily keeping track of the latest posts for your interests.

In addition, you can privately message users and publicly create posts and tag them with whatever you'd like (examples: Rust, Hiking, etc.). You can also filter users and posts by date, similarity, age, and distance.

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.

For Rocket I am using the async branch (recently merged to master, hooray!) and thus far it's been great. I'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.

For real-time messaging, I ended up creating a Server Sent Events library. It'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'd be happy to polish it up a bit and throw it on GitHub, as I'm sure my implementation is far from ideal.

On the frontend I am using React and... that's it actually. It'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 "clone" 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.

Returning to the website'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'd like more than anything is any suggestions or feedback that you might have, because I'm perpetually full of doubt and indecision on the proper course of action to take. Another thing I'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!

4 comments

First of all, thank you for detailing all of that and for sharing here. And for all the work you've put in to this! And secondly I wanted to say that this

> 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 "clone" 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.

is really cool to read as a frontend engineer.

I'm glad you're a fan too! Yeah, vanilla Javascript seems pretty powerful these days. If you don't care too much about backwards compatibility or supporting really old browsers then you can get a lot done with really thin wrappers tailored to your use case. I suppose time will tell whether or not it was the right decision, but in the meantime I really like the peace of mind from not having to rely on npm.
Congratulations for your release!

The Kardius logo on the top left is very pixelated both on my phone and on my browser. Considering that the icons on the right are not pixelated I think this was not a conscious design choice.

Sorry for kibitzing, but I think this will impact people's first impression about your product.

I just uploaded a new logo with twice the resolution. Did that help?
It looks good!
Good on you for launching.

I find the percentage-based swipe input distracting. I kept thinking how the exact number is going to affect recommendations and how that is measured relative to my previous inputs.

Consider showing two concepts next to each other so that swiping chooses one or the other, and swiping up chooses both.

Thanks!

Hmm, yeah, the swiping UX seems to be pretty tricky to get right. Initially I didn't have the percentage but some early testers highly recommended I add it for two reasons:

1) They couldn't see well and found the addition of the percentage was helpful in clarifying their swipe value.

2) It made it more obvious that the magnitude of swiping mattered, as opposed to swiping just being a binary yes/no option.

The two concepts idea is interesting. I'll have to think more on that. I think it might be tricky to implement though, because not every topic has a natural converse.

> Hmm, yeah, the swiping UX seems to be pretty tricky to get right.

In case you're interested, I created a quite long time ago a small example of a library doing this.

https://github.com/dgellow/react-tinderable/blob/master/src/...

The code is really old and out of date, and was just a quick experiment, but that may give you some direction if at some point you want to try out that kind of user experience.

Unfortunately the demo link doesn't work anymore, but it should be quite easy to run locally.

Ah cool thanks for the link I'll check it out!
Congratulations to the release! It's so refreshing, it's blazing fast, it doesn't load some stupid web fonts or other unnecessary things, I'd say it was worth the effort and would hope more websites do this. It just works :)