Pintask - programmable task tracker

    Salute, Habr!

    According to statistics, a new task tracker appears every 2 weeks. “But mine knows how to brew a cappuccino!” - the developer will tell you. “And other trackers make tea of ​​the same quality as the conductor of the Moscow-Gelendzhik train, or only Kopi Luvak is brewed.” So, if you could cut the faucet so that cappuccino would pour from it, would you not write a new task tracker? "Well, of course! Just a cappuccino is my favorite drink ”...

    About the common thing between coffee makers and Optimus Prime, why do we need a programmable task tracker and how to cut a faucet - read under the cut.

    imageBack in 1969, the situation with microcircuits looked about the same as the current situation with trackers. Want to release a calculator? Print your chip. Want to release a calculator with the function of multiplying by 1000 (for Brazilian accountants)? Print another chip. It was this logic that guided the Japanese, who ordered Intel as many as 12 chips for their calculators. A full-time rock star of the company, Ted Hoff, took an expert look at the blueprints and suggested refactoring. Then, as befits a rock star, he skipped the process itself, entrusting the implementation of the idea to Federico Faggin. Management safely scored on the project, since at that moment a completely different direction was developing frantically furiously, and it was possible to earn money on Bentley there. This greatly accelerated the development, and already in 1971 programmerselectrical engineers completed the tests and rolled out to production launched into series. Intel with fanfare completed the order of the Japanese and quietly opened a new line of business. A few years later, the microprocessor market suddenly became so profitable that they already made money on Bentley.

    Fast forward to our time, where the world is ruled by a passion for coffee and every day new task trackers come out. The situation itself begs for refactoring . It seems logical to write such a tracker in which you can “cut any faucet”, unscrew or, conversely, tighten each nut more strongly, replace the thermostat and set the steam regulator in order to finally brew your favorite drink. Just such - programmable task-tracker - is Pintask .

    A little plumbing

    IF HONESTLY, the appearance of a microprocessor was theoretically possible in the early 1960s, when integrated circuits began to be mass-produced. However, any young electrical engineer along the way was lied by technological obstacles of the 80th level. Federico Faggin knew about them firsthand. But he did not get a doctorate in physics not in the passage of the Moscow metro, but at the University of Padua. Therefore, in 1968, Federico created the first silicon-based field effect transistor, which worked faster than others, bipolar, and even took up less space, was cheaper, and saved electricity. Now it was possible not to turn off the lights in the toiletDo not worry about the optimality of microcircuits: microprocessor calculators added and multiplied faster than their predecessors simply because they worked on field-effect transistors. Well, the price tag for them was lower, which is very, very noticeable when purchasing devices for all Brazilian accounting.

    For an assessment of the situation, we will turn to a global expert on innovations:
    - Mr. Ford, in your opinion, will microprocessor technology continue to develop, or will manufacturers of bipolar transistors find a way to turn back the clock?
    - I am convinced that innovation at a lower level can change the existing industry. In my opinion, this is exactly what this is about.
    - Thank you very much for the comment. And now to the news from the world of science. Astronomers report an unusual cosmic background ...

    Pintask is written in Meteor. This framework is already one of the most popular repositories on Github in the weight category of JavaScript - and this is before the official release (current version: 0.8). The announcement alone at Hacker News gathered 1362 votes. Excerpts from comments: “It's like the industrial revolution”, “I can't upvote this enough” - well, you get the point. Even after eating half a pack of skepticin, we can safely say that Meteor opens a new page in web development. Moreover, the HTML code on this page is "live": receiving new data from the server automatically updates the template, you do not need to follow this. Oh yes, and forget about Ajax requests: the data is changed through the full MongoDB API to JavaScript, available directly in the browser. As a result, 90% of the calculations are performed on the client. Meteor code takes up less spaceit has less volume, it costs less , it is written faster, it saves energy reduces the amount of data transmitted. Marty, did you play with plutonium again?

    Let's see what happens. Access to the database is right in the browser, this time. Templates are also in the browser, these are two. Everything works on JS + HTML, these are three. But what if you give the user the opportunity to connect their scripts ? After all, with their help, you can hang the listeners, redefine the templates, and write down the data ... and cut the faucet. And tighten the nuts. And put the thermostat.

    All cappuccino

    Pintask is the first task tracker written in Meteor. And the first task tracker, capable of downloading your extensions directly in the browser, giving them full access to the database API and templates.

    Here is an example of one such extension:

    if !Cards
      throw "Hey, where are my Cards?"
    if !Comments
      throw "Look, I need those Comments, too!"
    Comments.after.insert (userId, comment) ->
      cardId = comment.cardId
      card = Cards.findOne(cardId)
      if userId not in card.memberIds
        Cards.update(cardId, {$addToSet: {memberIds: userId}})

    Lately I've been addicted to CoffeeScript ... not the mainstream, of course, but it speeds up development.

    This simple automation can be assembled, disassembled blindfolded. In the beginning, a couple of checks for a nuclear war are noticeable (if our script is called to another site). Then comes the installation of a time bomb, which works when you insert a comment. If the offender is not a member of the card, he is thrown there by a shock wave.

    Want to look at working with templates? I have them . Here jQuery is involved, at first glance the code resembles an Italian dish. But if we start to absorb it from the bottom edge, then the taste will open more harmoniously, and then ... "Waiter, repeat!"

    Separately, it is worth mentioning the connection of external data sources. White Magic lets you create tasks from Google Spreadsheet strings. And black magic with the help of the otherworldly API makes it possible to call Github Issues directly in Pintask and arrange a bidirectional communication session between comments of the internal and external tracker. All this happens through the MongoDB collections. In fact, this extension is a separate application that loads data into Pintask using a special script.

    Behind the bar

    By the way, you can connect your own extension through the same Github. In the simplest case, just publish the repository on Github Pages, take a direct link to the js file and paste it into Pintask. It turns out to be dry and comfortable (and updated when a commit is received).
    And if you need to connect the whole application with your blackjack, you can put it on a free hosting from the same Meteor, and insert a link to it.

    For the user, everything looks even easier. It is enough to go to the Expansion Store , select what you want, press the magic button - and with a flick of the wrist of the hand, the coffee maker turns into Optimus Prime.

    Since programmers are generous people, we can say with confidence: most applications will be free. But if the toad strangles it, or if more wood is needed (volume file storage, SMS gateway), then you can make the user an application that he can’t refuse. We earn it ourselves.

    Check the clock

    ABOUT! Here it is, a paid application: Time tracking on autopilot . Everyone knows how difficult it is for programmers to give time tracking. After wandering through the convolutions of our mind, you can meet a similar internal dialogue:

    - Hey, consciousness! Let's think about integration with Yandex.Market.
    - Wait, wait ... Didn’t you forget to press the "start" button?
    - Ah, for sure. Here, clicked.
    - Well done. So what did you talk about Bitcoin there?
    - What is Bitcoin? I talked about Yandex.Market.
    “Ah, yes ... wait a minute, did you press the start button for the previous task?”
    - Seems to be yes. Or not. I'll check it now.
    - Let's check. I’ll lay out solitaire here.

    In order not to go to a psychoanalyst, we decided to change the usual mechanism for recording time and abandoned the "Start" button. Instead, we put the “Enable time tracking” icon in the header of each list. Time tracking starts automatically when you log into the system and starts tracking the first task in the marked list. When a task is archived or transferred to another list, time tracking switches to the next task according to the clip principle. As a result, the programmer does not even think about time tracking. It just does its job, and the system automatically captures time intervals.

    The technical implementation uses standard Meteor mechanisms and a user-status package to monitor activity. Familiar listeners at MongoDB collections let you define a tracked task. The code does not use setTimeout (holy, holy), only events. As a result, even restarting the server is not able to disrupt the course of history.

    Want to get accurate reports? Come in, don't be shy .

    For dessert

    How much does the base platform cost? Pintask is completely free. We have no functional limitations, no ads, no monthly fees. But there is an open wiki , honest support and lambs in the background.

    Well and the last: Pintask strives to become a complete replacement for Trello (eng. "Drop-in replacement"). All the basic functions of an overseas service are already implemented. There is instant import from Trello . We are also going to do bi-directional synchronization in order to provide access to Pintask via Trello mobile applications (before we make our own).

    In future articles, we plan to talk about the product development process and the nuances of using the internal API. Now there will be a curtain, but whether you need to go out for an encore is up to you.

    Final link: Pintask , programmable task tracker.

    The article was published by me at the request of Denis Gorbachev ( starfall ), the entire text is completely authorial.

    Also popular now: