Background Dating — looking for people with whom interesting to talk

so I've been wanting to write a Dating site, but did not want to he was the same as hundreds of others. In the end, it became clear that it must be not really a Dating site but rather a place where you can find interesting people. On the other hand, did not want to limit ourselves to any specific category of people, so the option of creating a thematic website was not considered. The result was what you can see the link. Once you can draw attention to the fact that you are not prompted to fill in any personal data. Not because they need to fill in after registering, but because of profiles on the site.

Questionnaires not because they have too much restrictions. Usually you are prompted to define a standardized set of parameters with the same standardized response options. But as soon as I want to specify something else or answer any differently, faced with the fact that such a possibility is not provided (or it works not as I would like).

Under jabracada I will talk about what is on this website instead of questionnaires, as well as, of course, I will write about some of the technical details (where without it).

And by the way, the description in the "advertising" style:

You've been wanting to find a girl who knows how to program in Brainfuck? Or is it important for you that she was a supporter of the adaptive and semantic markup? Maybe you want to meet the woman who can easily speak about distinguishing micronuclei from monolithic, but also is a dancer?

Now you have the opportunity — unless, of course, she already have a Background Dating. :)

Instead of profiles on the site is the key phrase. Each key phrase is a short statement from the first person.

Here are some examples:

the
    the
  • Programming in Lisp
  • the
  • Play Dungeons and Dragons
  • the
  • Go to the club Place
  • the
  • to Write.
  • the
  • are Involved in network security

Each user can have as many key phrases, and any key phrase you can use when searching. Also, users have the ability to search on several of interest key phrases — in this case, the results are given only those people who have added all the specified key phrases (accordingly, if the search result is empty, so you can try to remove the part of the given key phrases from the query).

When you enter a key phrase autocompletion works, so if something like someone is added, then is prompted to select one of the key phrases in the list.

Because key phrases can be about anything, you can find accordingly many different people. If suddenly an interesting person who clearly knows what a decanter is used, it is possible to try to find and such.

Therefore, when a sufficient number of people each user the opportunity to get acquainted with those who represent for him the greatest interest, and whose background he is most like.

The site works, by the way, Django (Python). For transmitting personal messages are used Web Sockets (RFC 6455). When folded tabs (with the exception of chat) the server connection is temporarily closed, so as not to overload the Internet channel is implemented using the HTML5 Visibility API, namely Visibility.js notorious iskin.

Server side support for websockets is implemented using non-blocking asynchronous server Tornado. If someone wants, is willing to share the source and information about how to deplot — there is, in principle, nothing complicated. In order to pass messages between Django and Tornado (and store some data) use Redis, which has excellent support pub/sub. Django uses the standard client redis-py, Tornado and asynchronous client brükva.
For validation of the file (picture) on the client side using File API. The resolution, however, is not verified to do, but I have decided not to complicate things, especially since on the server is checked. But the checked type and file size, which is also good. However, I was surprised by one interesting fact — the fact that the File API specification the type attribute of the object representing the file that should contain the MIME type of the file, under the RFC 2046, but the browsers they use, not the actual file type, and generate it on the basis of the available extensions.

In other words, take an MP3 file, say, file.mp3. View the MIME using the file command:

the
$ file --mime-type file.mp3
file.mp3: audio/mpeg

Now remove the extension and try again:

the
$ file --mime-type file
file: audio/mpeg

The same. Let's try a different extension.

the
$ file --mime-type file.jpg
file.jpg: audio/mpeg

Similarly.

But web browsers a different opinion — in the first case, files[0].type contains the string audio/mpeg (as expected) in the second blank line, and the third case is image/jpeg. Again, this is not critical, because cross-checked on the server, but still a bit surprising. By the way, if you really want to do to the file type tested "really" it mono to do this manually, using FileReader. Perhaps then more will do.

Another great technology I decided to use here is Web Storage. First, the technology of Web Storage was part of the HTML5 spec, but then was described in a separate specification. It is storing the data in the registration form in the local storage of the browser (localStorage) — when filling out the user. That is, if the user, for example, has pointed out some key phrases, and was going to register, and then suddenly I accidentally closed the tab (or browser, or he generally turns off the computer), then when he comes in, he won't have to re-add these key phrases — they will be automatically uploaded from the local store and appear in the form.

The site also uses a responsive layout, so it can be used with mobile phones, tablets, and netbooks — the main thing that there was a modern browser (the default browser in Android 4.2, unfortunately, not yet supported, but on the other hand, under Android, there is Firefox, Opera Mobile and Chrome, where everything is fine).

If someone will be interested in any more technical details (for example, server validation and crop photos, or want to discuss the authorization by email in Django and changes in version 1.5), I can tell you about them, for example, in personal correspondence.

And, of course, if you have any ideas about how you can make use of the site better/easier/more convenient, I will be very glad to hear them in the comments. I, by the way, there are some ideas that will likely be quite interesting to add, and if someone wants they can about them in advance to tell. Again, if someone has the desire to join the development (at the moment on this website, I only work) — write.

Have a nice day and interesting acquaintances. :)
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Monitoring PostgreSQL + php-fpm + nginx + disk using Zabbix

Templates ESKD and GOST 7.32 for Lyx 1.6.x

Customize your Google