Django and Realtime: Using Django with Tornado and RethinkDB

Over the last couple of months, I’ve been writing a lot of Node.js code using RethinkDB. After writing so much JavaScript, I started missing Python and Django, which I’ve used extensively over the years. Because of this, I decided to port on of my original Node.js RethinkDB chat apps to Django as way to compare the Django and Node.js.

»
Author's profile picture Jorge Silva

Tutorial: Using Passport OAuth with RethinkDB

I’ve run into many people who have problems setting up authentication on their Node.js applications. Even with a library as great as passport, it’s can be tough to setup authentication in your app. Yet, while it’s tempting avoid it, authentication is essential for many types of applications.

»
Author's profile picture Jorge Silva

Video: Building a realtime photo sharing whiteboard with RethinkDB

Last week, I spoke at RethinkDB’s monthly meetup. I gave a short talk on how to build a realtime photo sharing app with RethinkDB changefeeds and binary data. The talk is based on a post I wrote earlier in March.

»
Author's profile picture Jorge Silva

Is it possible to implement an `if` method? A look at the ReQL `branch` method

One of the things that makes RethinkDB different from other databases is that its query language is embedded into the programming language. Unlike SQL, you use ReQL by installing a client driver for your programming langauge and building queries with this driver. The driver builds a query and then sends that query to the server to be executed and returned. An example of a ReQL query looks like this:

»
Author's profile picture Jorge Silva

Tutorial: Building a realtime image sharing app

Recently, I built a simple realtime image sharing app. In this app, images can be uploaded, deleted, and moved around, all in realtime. The app uses RethinkDB changefeeds and binary objects stored in the database to push changes to a Node.js server which then publishes changes to all clients through a socket connection. Inspired by this app, I decided to write a short tutorial on how to make a similar app.

»
Author's profile picture Jorge Silva

The Life Of A ReQL Query: Going Through All of RethinkDB's Data Types

So you’ve been writing a lot of ReQL or have started messing around with it. You (obviously) love writing queries in it, but sometimes you get weird errors like Expected type SELECTION but found SEQUENCE. What does that mean? What’s a selection? What’s a sequence? And why am I getting this error?

»
Author's profile picture Jorge Silva

Learning ReQL (RethinkDB's Query Language): 5 Common Pitfalls And Rookie Mistakes

Over the last couple of days, I’ve been writing a lot of ReQL (RethinkDB’s query language). I got over the basic examples and started writing more complex queries. As I’ve being doing this, I noticed a couple of things that didn’t work as I expected and things that took me a while to figure out. Fortunately, most of these made all the sense in the world once I started understanding the underlying principle. In this post, I want to share five issues I ran into during this process. Hopefully, this will be helpful to everyone out there starting out with RethinkDB.

»
Author's profile picture Jorge Silva

My First Time Using RethinkDB: Building a Simple Chat App

Tomorrow, I’ll be starting as RethinkDB’s newest developer evangelist. While I had read a lot on RethinkDB and played around with it quite a bit, I had never actually built anything with it. For that reason, I decided to build a simple chat app (GitHub Repo) using Node.js, RethinkDB, Socket.io, and React.js. In this blog post, I’ll show how my chat app handles incoming messages in realtime and some of the things I liked about RethinkDB specifically.

»
Author's profile picture Jorge Silva

Testing in CodeFriends: Integration Testing vs Unit Testing

For my recent project CodeFriends, me and my teammates wrote an integration testing suite for our API. In the last couple of days, I’ve thought a lot about the pros and cons of this approach and thought I’d share them here. This is not a definitive guide on the subject, but rather a real world case study for people who might not be using any testing right now or want have only done unit testing.

»
Author's profile picture Jorge Silva

Angular.js Authentication with UI-Router

When authenticating users in single page applications, there are two basic ways of going about it: token-based authentication and server-side authentication. For our angular.js app, CodeFriends, we decided to use sever-side authentication.

»
Author's profile picture Jorge Silva

Adding WebSockets in Nginx

For my thesis Hack Reactor thesis project, I’m currently working on an application that uses websockets. In my server setup, I have an HTTP server for most operations and a websockets server running shareJS. My HTTP server is a node/express server listening in port 8005 and my websocket server is listening on port 8007. Before setting up websocktes, I redirect all traffic to port 8005. Here’s how my nginix virutal host looks when handling only HTTP requests:

»
Author's profile picture Jorge Silva

Deleting Files From Your GIT history FOREVER!

We all make mistakes. That’s life.

»
Author's profile picture Jorge Silva

Storing Persistent Data in Docker: Docker `volumes` FTW!

Over the years, I’ve been teaching myself deployment and DevOps. A couple of months ago, I started learning Docker. Docker is a great way to keep your application environments consistent… but you’re reading this blog post, so you probably already knew that already!

»
Author's profile picture Jorge Silva

JavaScript Promises In Action: Saving An Image

Recently, I wrote an article laying out what are JavaScript promises and how they work. Shortly after that, I wrote a controller saving images for kbitzr that really exemplified how awesome promises are.

»
Author's profile picture Jorge Silva

jSass: My Very Own JavaScript SASS Compiler

A couple of days ago, as part of a two day hackathon at Hack Reactor, I build my very own Sass compiler. For those of you unfamiliar with it, Sass is a CSS pre-processor and probably the best one out there. There’s a lot of Sass compilers out there, but mine is the only one written purely in (and not ported to) JavaScript.

»
Author's profile picture Jorge Silva