As a programmer has come to the site about fashion

imageI'm a girl-programmer. So my thing is to cook soup and to write articles on Habr about their own projects. Recently epic_noob launched two website. One more or less interesting (dress4weather.ru), and the second about fashion (fashionhearts.ru). Will tell you how we did them and how to fly.

where everything began


About a year ago we decided after work, drank on the knee of some simple website. We had a lot of ideas from games to cooking applications. But the two of us, a guy and a girl, so I chose neither fish nor fowl – a website about the weather.
The idea of the website was to show the weather and things in this weather you should wear.
Since we both worked full time developers of interfaces in the company and tie this thing wasn't going to, specific plans for the future and monetization of the project we were doing just fo fun.
Serge dug in the Internet the free API weather (wunderground.com) and away we go.

The server side was written in Node.js + MongoDB + nginx. As they say, many developer interfaces do not feed, all the JavaScript is looking.

Design sketched on the knee in photoshop and made the engine. Content engaged the stoned resistant (I). The first base with things done ahead – I just took pictures of things from my favorite store, processed them in photoshop and all weather conditions made sets of clothes, writing them in a json file.
The first version of the design dress4weather.ru:

image


Unexpectedly, the website started coming people. I will tell you honestly – now website low attendance. But it is, it is not zero (150 uniques a day), stable and most importantly ... we do, well, nothing at all was done to our site to spin.
The idea probably seemed funny to the online community about us no-no, and write any resource. In one memorable day we even had the first warning from the weather API about exceeding the traffic limit – already gone two thousand people from 500 different cities. It turned out, we wrote about a fashion blogger and all ran to go look, there shines in Murmansk the sun.
Once we wrote some funny friend from Israel and tried to buy a franchise on the website. We have come in such a stupor that the rest of the evening, watching the carpet and so he did not reply.

weather and clothes


As time went on, people came and the money did not come.
At some point, Seryozha, who had to change several places of work, has decided that he wants creativity. A young man without children and a mortgage can afford a few months of creativity without human sacrifice, so he dug in the apartment with a laptop and set to work.
My first thought was to upgrade the website about the weather. Needed
1. to make admin panel for making kits
2. to figure out where to take data for a site (not all hands to copy-paste)
3. to do some socialization – the ability to like, can make combinations of clothes and you dy and you PY

Second thought was:
1. OMG. This "additional functionality" will be enough for the whole site!

First, we looked at the competition. Found a few popular sites with a similar idea in the basis, but among them there was almost no where the outfits you can make from the real thing. Almost all Russian sites offer a be sets of symbols. And monetized somehow along the road, through banners or your shop, who not only is involved in compiling sets of users. The only competitor to complete this idea is the website polyvore.com but they, luckily, are not localized, so I could easily go into battle.
A particularly insidious part of the plan was one in which popular kits, made by users of the site, proposalis on the website about the weather. That is, from the process eliminates the manual work of the programmer and is replaced by the Internet application the creativity of the users.

We started to learn where you can take quickly and easily to a large database of things. Long studied the options, looking in the direction of API Yandex.Market. But at some point stumbled on affiliate program sites admitad.ru and gdeslon.ru who can upload the data in xml format and provide them with affiliate links (if you buy something by going with the profit).
Greed made up eyes and we stayed on the second option.

Uninteresting facts about the workflow


The server part is the same, the characters are the same. Needed a server with plenty of RAM to give them at the mercy of indexes in Mongo. In the end, turns all on a server somewhere in Germany. For 2800r per month get unlimited network traffic, 48 gigs operatives and 4 TB of disk space.

Editor things took ready (Fabric.js) and slightly modified with a file.



In the editor there was a problem with the resize of images – if the picture is reduced, convenie filters gave too rough smoothing. So before you save the collage we make, the smoothing of the images included in the collage (algorithm research has no value – I took the first option).

Also, the editor was the tool to cut the white background from the picture.
It is a necessary instrument, but it had to finish.
First, it only works with white background, and secondly often the picture is often almost indistinguishable from the background (white shirt on white background our curse).
So we wrote a search algorithm for background images. It's pretty simple – take top-left pixel of the picture and consider it as the background color. The pixels belonging to the background, make transparent. The pixels that lie on the threshold of good and evil, do proportionally semi-transparent.
To solve the white on white we honestly stole the idea from competitors. We did just such a thing for circumcision with the help of Raphael.



Even with pictures I had to work, when they began to see that we give partnerskie shops. Often things take pictures with people wearing these things. We did avtodetekt of human faces using OpenCV to take pictures without people. All inappropriate photos to sift out failed, but still some profit was.

Uploading and processing the pictures took 2 days of continuous operation of the computer (80 000 things for 4 pictures the average).

Incoming XML files with data about the things we were pushing in JSON using xml2js. There was little surprise with strongly nonlinear increase of the time of parsing the file. A 200MB file could not be cached for several hours. But otherwise the export data from the partners took place without incident.

Authorization of users decided to make through social networks and the first approach to the projectile used uLogin. But quickly realized that uLogin provides a very limited feature set and will have to write your own wrapper over the API of social networks. In the category "the most nyashny API" won the Facebook API. And the interfaces are nice, and the guide to UX everywhere in the documentation set. In short, beauty. Pleasantly surprised by the documentation of My World (here too it would seem). The most strange IPAS were my classmates. Some need things you can learn only from correspondence with technical support.

You can endlessly tell you about the process, so I'll wrap it up.

General list of technologies we use (in General, all pop):
1. Node.js
2. MongoDB
3. nginx
4. Jade
5. RequireJS
6. The data warehouse in memory — Redis
7. Raphael for debugging the editor
9. LESS for css
10. ImageMagick for postprocessing mashup server
11. OpenCV for face detect
12. xml2js to parse data from partners

+ in the future we plan to upload images to the CDN using rsync.

What we have now


Now we finally launched the site in public and did a redesign dress4weather.ru.

image
Freshly baked fashionhearts.ru

image
New maple dress4weather.ru

According to the results of a social experiment on a human programmer, will tell you – working at home very hard. Sometimes Sergei watched with a blissful smile out the window and repeated: "how good, How good, how good I'm doing your project!". Sometimes he would draw a face on a baseball, called it Wilson and complained about the villain-destiny. In short, heavy and homely life of the ordinary programmer.

The main supplier of user content on our website I now. We have thrown a call and asked friends to come up. But as compassionate friends we are mainly developers, the results could only laugh and delete.
That's how programmers see fashion and style:

image


We are in the stage of promotion. Automatically receive some traffic from our website about the weather.
Just recently I decided to try to advertise Vkontakte and Odnoklassniki.
We also filed two different ads in the game. One ad accepted almost immediately, and the other no luck. Me two days mocked the murky answers, I broke down and wrote to tech support.
Replied, "sorry, made a mistake with the deflection point," and eventually banned to advertise our raschudesnye sites because the links go through the affiliate sites, and this redirect virus. And sites with redirecting the contact does not endorse.
It's a pity that I foolishly placed it on top of advertising money, and now can only withdraw it when I need to send them a scan of the application, copy of passport, fingerprints and a sample of blood. And if I do, I forever banned advertising network contact. Here wondering what to do, 30 bucks would come in handy...
With is classmates, everything was much easier and now our superbanner rotates, the luring of victims.
We slowly come to the realization that it is necessary to look in the direction of advertising in thematic communities.

We are finalizing the website, I write for his articles and figachit content. Serguei is involved in small things of type of coding and design.
We have fun, and scary!
PS And soup I really know how to cook. Proof:
image
Article based on information from habrahabr.ru

Комментарии

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

Integration of PostgreSQL with MS SQL Server for those who want faster and deeper

Custom database queries in MODx Revolution

Parse URL in Zend Framework 2