7 ms·
StackOverflow clone, created entirely with Redis and jQuery
- wildster 16y agoI think you would need to be very good a C to replicated something like that.
- VMG 16y agoBack button doesn't work
- mythz 16y agoOk due to popular demand I've just added it using HTML5 pushstate/popstate - should work in modern browsers :)
- rimantas 16y agoGive it some CSS3 love too: get rid of that body background image and use box-shadow, also, download button is trivial to implement in CSS and will degrade gracefully.
- mythz 16y agoI would be happy to take any pull requests that prettifies it :)
- melling 16y agoCan't we come up with a nice way to get people to move to modern browsers? IE6 and IE7 should both fall below 10% this year. With a little prodding IE9 could become the least supported browser within a year, and IE9 is going to be a pretty good browser.
- antirez 16y agotrivia: the real stackoverflow uses Redis as well for caching and to implement specific functions. I'm very proud of this since I consider stackoverflow one of the best sites of the whole internet, together with wikipedia and a few others.
- kmontrose 16y agoExpanding on antirez... An overview of how we use Redis for caching at Stack Overflow can be found at: http://meta.stackoverflow.com/questions/69164/does-stackoverflow-use-caching-and-if-so-how/69172#69172 http://meta.stackoverflow.com/questions/69164/does-stackover... Our "global inbox" and "frequented tags" features are built on Redis as well. There's a bit of traditional SQL behind global inboxes (mostly for persistence and backup purposes), however.
- w1ntermute 16y ago> I consider stackoverflow one of the best sites of the whole internet, together with wikipedia and a few others. Though that has more to do with their community & content than their structure. Of course, SO's structure is part of the reason for its community/content (though I personally believe Atwood & Spolsky's star status was more important), but just copying that isn't going to get a similar site a lot of users or quality content.
- antirez 16y agoSure, when I say stackoverflow I don't just refer to the technology, but the community, how the site is handled by the founders, the original aims that resulted in the site, and so forth.
- k33l0r 16y agoPretty cool, but not being able to directly link to questions is a pretty big downside.
- mythz 16y agoWell I just made it as a demo app, not meant to be a competing replacement, deep-linking would be fairly trivial to implement.
- ck2 16y agoWhy not just manipulate the url hash to allow bookmarking and re-generation of a specific page?
- scorpion032 16y agoLike like new twitter, you mean #!
- mkrecny 16y agoNice - it's very responsive : )
- watt 16y agoDid they clone the community too? zing
- antirez 16y agoI think the goal of the author was not to compete with stack overflow, but to show a programming example.
- watt 16y agoPerhaps I am reading the post title incorrectly. What DID they really clone? Oh, title like "created a Q&A site engine using Redis and jQuery, and styled it to look a bit like StackOverflow, whoop-de-doo" is not catchy. Q&A sites are not about the code, they are about the people, asking and answering the questions. It's nothing without the community.
- rhizome 16y agoQ&A sites are certainly partially about the code. UXwise, I'd much rather use SO than Yahoo Answers.
- serichsen 16y agoMain difference: it does not degrade gracefully. It just doesn't work without JavaScript activated.
- jules 16y agoBut it is a lot more responsive. Is there a way to make it degrade gracefully? The problem I see is that you can't have the JS and non-JS parts have the same URLs. The JS part will have urls like thesite.com/#question123, whereas the non-JS site will have urls like thesite.com/question123. So now you have two urls for each page, giving problems with search engines (and I think search engines will consider thesite.com/#x the same url as thesite.com/#y, and only load one of them).
- mythz 16y agoYeah if it were a real app I would definitely go through the effort of having it degrade gracefully and crawlable. Although for those interested Google has a proposal for crawling Ajax sites: http://googlewebmastercentral.blogspot.com/2009/10/proposal-for-making-ajax-crawlable.html http://googlewebmastercentral.blogspot.com/2009/10/proposal-...
- numix 16y agoYou could use the new pushState() to change the url (https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history https://developer.mozilla.org/en/DOM/Manipulating_the_browse...). A good example is Github's repo browser.
- mythz 16y agopushState() / twitter-like Ajax REST-ful Url's now added!
- mythz 16y agoDo you know many other jQuery only websites that do?
- euroclydon 16y ago
- deleted 16y ago[deleted]
- jdub 16y agoInteresting point from the author (after I asked on the site!)... it was developed on Windows/.NET and deployed on Linux/Mono. :-)
- aaronblohowiak 16y agoHeres the source: https://github.com/mythz/ServiceStack.Examples/blob/master/src/RedisStackOverflow/RedisStackOverflow.ServiceInterface/IRepository.cs https://github.com/mythz/ServiceStack.Examples/blob/master/s...
- mattlong 16y agoMaybe I'm missing something, but what about this is interesting? Is it that Redis is the backend? I'm not trying to bash it; I'm genuinely curious.
- antirez 16y agoThe interesting things are in my opinion that Redis is the sole backend, the code is simple, and no Redis operation was "forced" to do something that was not the natural goal. In practice this example shows how the Redis data model is a natural way to model complex needs without a line of SQL and without any need to setup indexes or things like that. I think this is a pretty important point. Another interesting technical detail is that the whole site uses only an HTML template and everything else is done via javascript using jquery.
- gaiusparx 16y agoAgreed. It also highlights that you don't need an mvc frameworks for web app. Due to the popularity of framework such as Rails, many assume a framework is the only way to go. Powerful client JavaScript library is changing how people develop web apps.
- fredoliveira 16y agoEven though you are right and it is certainly not necessary to use an MVC framework to build a web-app such as this, you'll have to agree that the thoughts behind using such a framework are important (data/code/interface separation). But that doesn't mean MVC is a hammer for any nail.
- blasdel 16y agoExcept that this webapp is absolutely built with an MVC framework — it's just that the M, V, and C are in different places than they are in the dogmatic arrangement. MVC is not a fixed design, it's a legitimate universal Design Pattern (unlike most of the GoF book). It's a shared nomenclature for describing the arrangement of concerns, not a prescriptive blueprint.
- ithkuil 16y agobtw, a similar SO clone: http://shapado.com/ http://shapado.com/
- jganetsk 16y agoIs this meant as a proof-of-concept, or a production system? What is stopping me from using Firebug to change the client and issue a 'rm -rf /'-esque command to Redis? Does Redis have some kind of permission checks? Is there some interesting solution that would provide a thin ACL layer in between the client and Redis?
- mythz 16y agoIt's a proof of concept, but at the same time all redis calls for this service is shielded by strongly-typed web services api (not a free command redis) so the only commands that are executed is what's allowed - the web services api would not be any different than if it was backed by an RDBMS.
- Charuru 16y agoI developed something similar here: http://hipchan.com http://hipchan.com And why redis? It's definitely the wrong database for the job. couchdb is indubitably a better choice here.
- Charuru 16y agoPlease someone explain the downvote. redis is a k/v store that will force you to write a lot of code to get the results you want out of it, people use it for purposes like caching, not storing your main content which you'll want to query in complex ways. meanwhile couchdb is just more complex enough to make things easier, and it features database side authentication which will allow you to write full client side apps, which seems like what this author was going for here. anyway it just seems to me like couchdb fits the use case here perfectly. when i wrote hipchan i used mongodb because I had server side code to auth, no bias here...
- mythz 16y agoCan you explain where in the sample code would be beter served by a different data storage solution with equivalent sample code? IMHO Redis comp-sci data structures provide elegant and fast solutions to the requirements of a StackOverflow Q&A site.
- dlsspy 16y agoWhile I didn't make the suggestion initially, I can see where it may have come from and might be able to expand on it some. couchdb has a concept called couchapp (think rails for webapps written in javascript) which allows the entire application from data storage on the filesystem to presentation in the browser to only require the couchdb process and the web browser. The data is automatically ready for bidirectional (or multidirectional) replication anywhere from offline apps to cloud hosting providers -- all active. It purports to do for your web application what git did for your application development -- you can clone just the app from one DB to another, or clone the entire DB for backups, offline work, or even peer-to-peer production hosting or web. I haven't done web apps very much myself in a couple of years, but that's one area that's a bit tempting for me since the ones I have been interested in have peer-to-peer data accumulation and offline work + synchronization needs.
- LiveTheDream 16y agoThis demo also has a C# middle layer that implements a REST web service and an ORM; it's not just datastore + client-side javascript app (like CouchApp).
- mythz 16y agoIts funny when people use the term 'ORM' when there is no ORM in sight (I know I do it to :). BTW there is no 'Relational' and no 'Mapping' in the C# Redis client, For max speed POCO objects are just serialized as JSON or have their primitive values stored in Redis's Sets/SortedSets.
- LiveTheDream 16y agoI said ORM because the github project description says "...built with ServiceStack, C# RedisClient, OrmLite...". Just realized now that the SO clone is just one of several sub-projects within that repository, sorry.
- jschuur 16y agoIf you're going to pay homage, at least don't take the name too.
- jschuur 16y agoOn the other hand... It's open source and if it helps people figure out what it is, then its OK.