Use Wufoo integrations and get your data to your favorite apps.

Category: programmers

There are 7 posts published under programmers.

Urchin: Building a better API for Drupal

As web developers, we have numerous tools at our disposal to build a platform.

 

Drupal is one such tool that we keep returning to, due to its flexibility, great community support and quick deployment. In the past year alone, Ashe Avenue has launched Drupal sites for everything from high volume magazines to grassroots music organizations, all with very aggressive launch schedules.

 

That being said, I actually want to discuss what Drupal does not do very well: present data in a consistent manner. As Ashe Avenue’s Lead Front-end Developer I have noticed that whether it’s a custom module, theme or whatnot, retrieving and displaying entity data is anything but uniform. Often, it ends up being a mess of node object references, scattered views, and render arrays peppered with various core function calls. These inconsistencies create code that is difficult to read, maintain and makes you want to sweep it under a rug.

 

In order to overcome these issues Tim Boisvert, Ashe Avenue Lead Developer, collaborated with me to create Urchin. Our goal was to achieve the following:

 

• Create a chainable set of functions for querying the database for entities and their field data
• Create a function for retrieving a specific field’s data given an entity, no matter the field type
• Ensure that Urchin would be portable to any Drupal site

 

With these goals in mind, we created what became the core of Urchin, the Article and Node classes.

 

One of the great things that Drupal 7 introduced is the EntityFieldQuery (EFQ) class, which helps developers build database queries without having to write a number of joins and conditions. What’s not so great about EFQ is that it’s still pretty verbose. Let’s take a look at some sample EFQ code that’s written to load the ten most recent nodes of type ‘article’.

 

$query = new EntityFieldQuery();
$query->entityCondition(‘entity_type’, ‘node’)
           ->entityCondition(‘bundle’, array(‘article’))
           ->propertyCondition(‘status’, ‘1’)
           ->range(0, 10)
           ->propertyOrderBy(‘created’, ‘DESC’);
$result = $query->execute();

 

I should also mention that the above code only returns a result array of node IDs, which in turn must be loaded and looped through in order to finally display the relevant data. Contrast that code with the following Urchin statement, which returns a nice and clean associative array of node data after executing the query (no entity_load() calls necessary!):

 

Article::get()->limit(10)->sort(‘recent’)->execute();

 

So…what’s going on here? The get() function creates a new EFQ instance with a few predetermined settings and returns that instance for other chainable functions to manipulate. Each chainable function is essentially a shortcut for EFQ with a little added pizazz to make your life easier. The beauty lies in the simplicity of the execute() function, which does two very important things: 1) executes the EFQ instance and 2) loads the resulting node data using Node::getNodeData(). Without getting into too much detail, getNodeData() essentially loads all of the fields for each node using the getField() function, which is the magical function I described earlier that helps us retrieve any field type’s data.

 

The getField() function may seem simple, and it is, but we believe that it really streamlines the way a node’s field data is referenced. For example, you’re on a node template and you need to access a field named byline and you don’t want to use render arrays. You might write something like the following:

 

$node->field_byline[$node->language][0][‘value’]

 

Yikes! The above technique can get unwieldy with complicated data types — such as fields that support multiple values — and can throw errors if you aren’t careful due to a reference to an unset object property. Contrast the above with Urchin’s getField() below:

 

Node::getField($node, ‘field_byline’)

 

Easy peasy. getField() performs all the necessary isset() checks to avoid errors, supports multiple value fields, and even automatically loads and retrieves the data for node reference fields.

 

In addition the above examples Urchin contains many other functions that ease development. We feel that Urchin has exceeded our expectations in terms of making a Drupal site easier to use, maintain and scale. After installing it on a few sites, we open-sourced the tool to allow for community input.

 

While we feel that most Drupal sites will benefit from an Urchin installation, there is still more work to be done. Urchin is great at retrieving data, but currently it can’t manipulate or save data to the database. Furthermore, the Taxonomy functions are useful, but not as powerful as we would like them to be. These are features we plan to release in the near future and we gladly welcome any collaborators that would like to share in the development of Urchin.

 

Let me know: What features would you like to see in Urchin?

867

TechCrunch Disrupts Battlefield Winner Announced!

On the final day of TechCrunch Disrupts, the final six startups duked it out in the Startup Battlefield—they were: Regalii, Ossia, Fates Forever, SoilIQ, Dryft, and Layer. Each of these teams took part in the Startup Battlefield earlier on against 23 other finalists and came out on top.

To determine the winner, the startups’ impact on the world are reviewed by a panel of judges consisting of: Michael Arrington (Founder of TechCrunch), Roelof Botha (partner at Sequoia Capital), Chris Dixon (Andreesen Horowitz), David Lee (founder of SV Angel), Marissa Mayer (CEO of Yahoo!), and Keith Rabois (Khosla Ventures). The startup that wins the Startup Battlefield will bring home the Disrupt Cup along with a $50,000 stipend.

 

Regalii’s goal is to maximize the efficiency of remittance. Their product functions through SMS; essentially, the sender can send an SMS to somebody and the recipient will get a pin number that works like a gift card. This is an improvement to current forms of remittance such as Western Union in that the recipient gets the money immediately—this means that, along with speedy money delivery, both parties minimize the deductions made by a third party. Thus far, the startup has experienced a growth of 67% per week, showing signs of success in the market. Regalii claimed that this product “is the future of global remittance.”

 

Ossia created a product named COTA. This device is the first of its kind as it is able to remotely send power anywhere within a 30 feet radius to devices and charge them. COTA will detect the device location via a secondary attachment and send power to and only to that location. A demonstration was shown in which a light bulb lit up when held near a prototype, but went out the moment it was moved—the consumer model is expected to be able to charge a moving device as well. Imagine a world where wires are no longer needed—everything will be charged wirelessly. That is the future that Ossia offers with COTA.

 

Fates Forever is a gaming startup. What makes it so special is that it proposes to bring a MOBA (multiplayer online battle arena) to the growing tablet market—this has never been done before. The touchscreen will add even more to the gaming experience. While some of the judges questioned the novelty (and, thus, the ability to get a large enough market) of reintroducing a popularized genre to the tablet, founder, Jason Citron, countered by stating that many successful games are essentially a reintroduction of previous games with a different spin. In this case, the use of a touchscreen and an under-saturated tablet gaming market will bring Fates Forever far.

 

SoilIQ aims to revolutionize the farming industry. They created a device that can be stuck into the ground where it will measure various aspects of the soil: pH, temperature, humidity, sunlight, etc. The device is solar powered and sends the data to the cloud, where it will be analyzed. The software will make crop suggestions based on the state of the soil. Additionally, when the parameters of the soil changes such that the crop will die, a message will be sent to the user’s phones. The company measured a 15% - 20% increase in crop yield, showing proof of concept. With this, crops can be grown in larger bulk, sold more cheaply, and, most importantly, can feed more mouths.

 

Dryft was the runner up of the TechCrunch Disrupts Battlefield. Their plan is to optimize texting efficiency for the tablet. The product is essentially a tablet keyboard. The on screen keyboard will take advantage of the accelerometer and touch screen to detect typing based on the vibrations made from tapping the screen. As a byproduct of easier typing, the front end (e.g. autocorrect) won’t be as messy, either. While there is a transition from notebook to tablet, this product can possibly push the rate of this shift even faster!

 

This leaves the winner of the TechCrunch Disrupts Battlefield, Layer. This startup offers a product to all app developers; a code that can allow them to easily and seamlessly integrate SMS, voice, and video communication to any app. Not only that, there is no phone to phone restriction—multiple devices can take part. While many other companies have tried this, they’ve only been able to succeed at the beginning stages, because of the underestimated difficulty of this undertaking, resulting in scaling problems. Layer could potentially maximize the efficiency of communications between all mobile devices.

 

All of these startups had amazing ideas with proof of concept—unfortunately, only one could win. This doesn’t mean the end of any of the other companies. A backstage chat said that, “as long as these startups don’t [mess] up, they will be very successful.” While Layer won, not everybody is in agreement with that decision. Who do you think should have won?

379

Is Open Source A Good Business Model For Your Company?

While terms like “cloud,” “big data,” and “devops” may be over-used and over-hyped, it should be clear to anyone in the industry that we are undergoing a fundamental shift in the way IT is delivered, consumed, and even conceived. What is also clear is that this new era in computing is being both driven and dominated by open source.

Ask almost anyone what the most significant and exciting technologies are, almost anywhere in the stack, and you are likely to hear the name of an open source project. Ask about Big Data, and you will most likely hear Hadoop or Cassandra. Databases? MongoDB , CouchDB, and Riak. Storage? Gluster and Ceph, come to mind. Networking? OpenFlow and now Open Daylight. Cloud as a whole? OpenStack seems an unstoppable force. Mobile? It’s hard to ignore the tidal wave that is Android.  Application delivery and devops? Take your pick of Chef, Puppet, Salt, Jenkins, or Docker.

 

As Eric Knorr recently wrote, “We’ve come a very long way from the old saw that ‘open source doesn’t innovate.’ Instead, you might ask: Is innovation in enterprise software happening anywhere else other than in open source land?”

 

Of course, any discussion of open source inevitably comes around to someone asking, “While this may be great for innovation, can open source be a sustainable business model?” As someone starting his second stint as CEO of an open source startup, I can answer with an unequivocal, “It Depends.”

 

Open Source makes sense for an increasing number of situations, especially when a company is trying to disrupt proprietary incumbents or when (as is true almost everywhere) there is a limited window to become prominent in a rapidly changing ecosystem. Indeed, I would argue that, in many situations, trying to make it as a small open source company is far less risky than trying to gain acceptance as a small, proprietary company.  Open source brings its own unique challenges, however, and certainly isn’t appropriate for everyone.

 

With that in mind, here are some questions to ask if you are considering becoming an open source company. The more that you answer “yes” to, the more likely that open source is the right strategy for your company.

 

 

Am I trying to sell into a market with entrenched, proprietary competitors?

If so, being open source can get you into accounts that would never speak to a proprietary startup. Additionally, it gives you the opportunity to compete on battlegrounds that favor you over competitors with larger sales forces, marketing budgets, etc.

 

Am I trying to enable an ecosystem and are there important open source projects around me in the stack? 

If so, being open makes it much easier to form and integrate into an ecosystem.

 

Do I have a clear idea of how to add value on top of the open source version, while making the open source version robust and valuable?

There are many interesting variations on the open source model, but they all depend on having both a big “top” of the funnel (lots of people using, trying, or loving the open source product), as well as a clear reason for a meaningful percentage of those people to pay (e.g. a managed service offering, support). If the only way to get people to pay is to make the open source version substandard, you won’t likely succeed.

 

Will being open source make me radically better than the alternative or will it just make me a cheaper alternative to an already good solution?

The best open source companies use being open to make themselves radically better, at least for certain markets or applications. For example, MySQL wasn’t just cheaper than the proprietary RDBMs, it was better for PHP and helped enable an entire stack (LAMP).

 

Is the nature of my project such that “many eyes” and “many contributors” will make it better? 

In my experience, this is more likely to be true of fundamental technologies, and less likely to be true for things dependent on an elegant user interface.

 

Is my project such that being tested at very large scale is key to success?

While you may never get paid by large universities or national labs, there are few places better to prove your product out at massive scale.

 

Do I understand the implications of being open source on development, QA, sales, marketing, financing, etc.? 

Being open was key to Gluster’s success, and has been key to how Docker is approaching the market. The decision has had significant implications for all aspects of the company. You can’t be “half open” any more than you can be half pregnant. Make the decision wisely.

370

Top Startup & Tech News Today: 7 Things You Missed

CitizenTekk brings you the top startup & tech news today - August 18th, 2013

1. Ubuntu sets crowdfund pledge record for Edge smartphone.

Ubuntu Edge’s crowdfunding smartphone campaign has raised more money in pledges than any other similar venture. The London-based developer, Canonical, has raised $10,288,472 in pledge money. But, this is still far from their funding goal of $32 million. As per policy of Indiegogo, the fundraiser’s host, Ubuntu would have to return the $10 million if they do not meet their $32 million goal. If the goal is met, Ubuntu would like to deliver 40,000 phones to qualifying backers by next May.

The smartphone has received a lot of press and acclamation though, from companies and individuals alike. Last week, Bloomberg announced that it had made an $80,000 contribution, saying that the open-source initiative could benefit its clients and change the future of mobile computing. But, Mr. Shuttleworth did admit that the product might be too much of an outlier relative to current smartphones; many major telecom companies, then, would not consider backing it.

The proposed smartphone’s apps would look like standard mobile apps when the Ubuntu smartphone was used as a standalone device. But, the apps would change their user interfaces to that of a desktop application when the phone was docked with a monitor. The OS itself could support apps written in the HTML5 web language.

The crowfunding campaign ends August 21st. But, But Mr. Green says that Ubuntu’s current pricing is an “absolute bargain”. “The product was sound. I would not say it is expensive.”

2. After Jimmy Wales makes a stand against China, Wikipedia’s Chinese editor banned from leaving country

Wikipedia China editor Huang Zhisong has told Radio Free Asia (RFA) that he has been banned by authorities from leaving China until 2016. He believes this is to put pressure on him, and is a result of his frequent trips to Hong Kong, Macau, and Taiwan on Wikpedia editorial issues. When Huang Zhisong asked a local bureau agent why he could not leave mainland China, his response was that he should know the reason. This comes a week after Wikipedia founder Jimmy Wales said he would not comply with any form of censorship on Wikipedia’s Chinese site.

 

3. Cisco announced Wednesday that it will cut 4,000 jobs, citing a difficult economic climate.

These layoffs make up 5% of Cisco’s workforce. Cisco’s shares plunged 10% in after-hours trading after initially slipping 4% when Cisco released its fourth quarter fiscal results.

CEO John Chambers says that he’s “real pleased” but Cisco is “just not growing as fast as we need.” He isn’t worried at all about Cisco’s performance against competitors though. Overall, Cisco made $2.8 billion on sales of $12.4 billion for its fourth quarter. Cisco’s focus on Internet trends (such as video, wireless, and big data) has helped propel the company. Shares have risen up by 34% so far this year. The company has also stockpiled $50.6 billion in cash, which is $3 billion more than its previous quarter.

Since Cisco touches all part of the networking process, a large part of the company’s success is tied to the world’s economy. “A lot of [sales and growth] depends on GDP and global markets growth,” Chambers said. “We’re just not seeing it.”

4. The Only Startups That Matter To Job Creation

The idea that small business runs U.S. job creation is a common one. It is also an incorrect one. The Census Bureau shows that small businesses destroys jobs at nearly the same rate as it creates them.

The Kauffman Foundation has an insightful report showing that not all small businesses are equal-opportunity job destroyers. High-tech startups, unlike small businesses in general, create net new jobs.

In 2011, high-tech companies between one and five years of age created 16,700 jobs. Other similarly aged-businesses in the private sector overall lost 513,700 jobs. What’s more, the foundation concludes that startups aren’t located just in the Silicon Valley. Some most dynamic cities for high-startups include Missoula, Montana, and Cheyenne, Wyoming. But Colorado outshines them all, with Boulder, Fort Collins-Loveland, the greater-Denver area and Colorado Springs in the top 10 metropolitan areas marked by a density of high-tech startups.

This is all good news for the U.S. economy. There is more geographic and economic diversity among high-tech formations than the private sector in general. Results of other studies show that one high-tech job results in four others. Studies also show that the process of innovation and entrepreneurship, which is generally costly in the short term, leads to productivity growth. All in all, high-tech startups are good for the U.S. economy.

 

5. Bridging The Gap Between Tech Startups And The Fortune 500

How can a tech startup and a Fortune 500 company team up for mutual benefits? The most common ways are through corporate venture capital arms, contests, package of benefits geared to startups, and accelerator programs.

The main advantage of taking capital from corporate venture capitalists is that they become your internal allies at the firm. However, caution must be taken, as some of these investors may restrict your ability to exit to a competitor, as well as the possibility that the corporation may create something competitive with your product. It is for these reasons that some traditional venture capitalists are highly averse to working with corporate venture capitalists.

Fortune 500 companies also use contests to attract startups to work on problems the company cannot solve in-house. They also employ freebies to build relationships with startups. This not only promotes the company’s core services to new customers, but also hopefully locks the Fortune 500 company new and permanent customers.

The accelerator model has been around for a while and has produced some prominent companies; now, some Fortune 500 companies also want to get into the game. Nike, GE, and IBM are famous examples of companies that are trying to do so.

Startups should look into these opportunities and take advantages of the resources of larger companies, if it is possible for them and to their advantage.

6. Taxi-hailing apps offer unexpected benefit to minority riders

Taxi-hailing apps have become extremely popular in cities with infamously poor taxi services. However, minorities have found unexpected success using these apps to hail cabs that would otherwise have driven past them out of fear, xenophobia, and discrimination.

These apps “remove the uncertainty that you face that a cab driver will pass you by because they’re profiling you based on how you look expecting that you will maybe want to go to the outer boroughs like Brooklyn or Queens or sort of more nefariously potentially be a criminal,” says Stacy-Marie Ishmael. Ishmael said it is common for minorities to get passed over for travelers who look relatively “less brown” than them.

 

7. Wearable Computing Startup InteraXon gets $6 Million To Read Your Mind.

InteraXon is making a thought-controlled headband called Muse. They have managed to raise $6 milllion in Series A funding. They expect to release Muse in early 2014.

 

238

Top Tech and Startup News: 7 Things You Missed Today

1. John Carmack joins the Oculus team to work on the software for The Rift

John Carmack is a co-founder to the id software, and is most known for his programming work in the quake series. He has recently joined Oculus as Chief Tech Officer, where they have been focused on virtual reality technology. The goal for Oculus over the past year has been to develop a new type of hardware, where the user would be engulfed in a virtual reality while playing their game.
According to Carmack in an interview at QuakeCon in 2012 the prototype they are selling at the moment, is not meant for consumers. The project is still very much in the developmental stage and those at Oculus are hoping to get developers to look at their work and give feedback. In time after they work out all of the kinks, such as developing better software to support it and having more than one game to play on it, then it will be consumer ready. However, they recommend to those who want to support their project, wait until it would be worth the cost when it is software supported.
http://www.oculusvr.com/blog/john-carmack-joins-oculus-as-cto/

2. LiveScript, Julia and Elixir: Three Languages To Watch

 

Livescript is a JavaScript and CoffeeScript compatible language that is meant to be more user friendly. Livescript 1.2 was recently released, and is meant to be used at any point a person would use Java.

Julia is another language, more specifically meant for science, since it is more expressive with a larger library than most other languages that focuses on scientific computing tasks. Julia is not only a higher performance language, but is also faster than other languages.
Elixir is a modern version of Erlang VM, taking out what did not work in Erlang and keeping what did is a step forward to say the least. Some of Elixirs features are: list comprehensions, Metaprogramming via macros, and Protocol-based inheritance.
All of these more unheard of languages have massive potential, and have the purpose of making life easier for those who want to or need a language, but are unsure as to which is best for you. There are more than just the well-known and popularized languages such as JavaScript and Coffeescript.
http://adambard.com/blog/3-languages-to-watch/

3. A New Form of Terrorism: Hacker Terrorists

With the increasing dependency on the internet, a new form of terrorism is being achieved through hacking.
Michael Hayden, former NSA chief, calls these transparency groups “terrorists.”

 

But there are two sides to the story. Some see releasing sensitive information, as Edward Snowden did, as dangerous to the US government. Others see the transparency groups as “hacktivists” trying to bring light to unknown government activity.
Hayden jumps to the conclusion that hackers will target The World Trade Centers. “So if they can’t create great harm to dot-mil, who are they going after? Who for them are the World Trade Centers? The World Trade Centers, as they were for al-Qaida.” Said Michael Hayden during his Washington speech given on Tuesday, assuming that hackers want to target the US government for malicious reasons.
Although the conclusion given is from assumption, there is real fear with the dependency on technology today. When it comes to banking and personal information being out there, it is a real threat that personal and government information could be used for harm. Real terrorists, not just transparency groups, could use hacking to access private information from the government and use it to cause harm.
http://www.salon.com/2013/08/06/cyberscare_ex_nsa_chief_calls_transparency_groups_hackers_next_terrorists/singleton/

4. Google glasses are potentially disruptive and could violate privacy, but do the risks out way the potential benefits?

Some of the many points brought up against Google glasses, are the safety concerns when driving. It was said by “Henry Jasny, Advocates for Highway and Auto Safety’s general counsel. ‘It will be just like cellphones, which became too ubiquitous and popular while driving.”’ (Jessica Meyers) Also thought to be a privacy issue when it comes to doctor patient confidentiality, yet it is also believed google glasses could help determine a diagnosis.
Another point brought up by police, is that although it could help with evidence, the video could be turned off and on leaving out context, leading to more troublesome than beneficial proof. There is also potential use for piracy when it comes to movies in the theaters. Many places are already beginning to ban Google glass from being used, even though there is not even a release date for the product.
Senate Commerce Committee Chairman Jay Rockefeller believes that no matter what is thought of now, it will take time before any policy can be made. This is probably for the best, since the only way to know the full scale of issues and benefits brought by Google glass will be known once the product is out and used by large number of the populace and not just the few who got a hold of the prototypes from Google.
http://www.politico.com/story/2013/08/google-glass-to-see-fill-of-policy-questions-95194.html

 

5. Starting-Up your own business? Here are some tips

 

Good management is not the most important thing, companies who are just starting out often do not have the resources for it, and many big companies today started out very small with none at all. Although recently The Wall Street journal reported that cyber security was not going to be very big, Defense.net reported 9.5 million in funding. One thing to keep in mind is that most entrepreneurs often did not get in much legal trouble as teens, according to Arizona State University study.

 

However, if you are not looking to start a business, but instead invest in one, looking at the JOBS act and becoming an angel investor might just be the route for you. It is an easier way to get involved with much less risk than starting a business of your own.
http://online.wsj.com/article/SB10001424127887323477604578653960989851832.html

6. New OS based on Bluetooth could revolutionize the way we live

Estimote is a company looking to promote their new product that brings the physical world reality into smart phones. If you were to walk around a museum, all you would have to do is look at your phone and the nearest art to you would be instantly described. If inside a store all that you were looking at would be in your phone, no need to keep track of what you want to get in the future, because your phone would do it for you.
Right now the technology is going to work using “motes” simple waterproof Bluetooth devices that would connect to smartphones, not just to track where you are, but with enough motes around the world or in a shop. A smartphone could map out the store that customer is in, also keeping track of products looked at and what part of the store the person is in.
With this technology, there is some privacy issues, since the ability to keep track of where a person is at all times is a little scary. Who exactly would be able to get a hold of this information would be important. However, it could revolutionize the way people shop, by eliminating buying at a store, it could just be a floor room and order over the phone while letting someone else handle the delivery, such as amazon. Possibly finding cheaper companies with the exact same product that is in front of you. Right now a package of 3 “motes” is available to developers for $99.
http://www.wired.com/design/2013/08/how-a-startups-cheap-sensors-could-bring-shopping-and-mobile-computing-into-the-future/

506

How I Built Scaleable Web Apps on the M.E.A.N. Stack

“M.E.A.N.” is one of the coolest stacks to develop on .

 

In my opinion, M.E.A.N captures the essence of modern day web development. It neatly ties in the concept of a NoSQL database with a modern javascript framework and gets them to communicate via Node.js.

 

Getting started with the MEAN stack might seem very daunting at first. You might think that there is too much new technology to learn.  The truth is that you really only need to know “Javascript.” That’s right, MEAN is simply a javascript web development stack.

 

So, how do you actually get started developing on the MEAN stack?

 

The first step is to set up a project structure. I’ve found the following structure to make the most sense:

 

controllers/ db/ package.json server.js public/

 

This structure lets you keep the entire stack in a single project. Your AngularJS front end can go into the public folder while all your Express API logic goes into controller and your MongoDB collections and logic go into the db folder.

 

Now that you’ve set up a general project structure, you need to initialize your public folder as  an Angular project. It is best to do this using a tool called Yeoman.

 

Yeoman is a toolkit that makes it easy for you to get started with a variety of Javascript frameworks and other web frameworks like Bootstrap and foundation. You can learn more about Yeoman at Yeoman.io.

 

Installing Yeoman is pretty straightforward.

 

npm install -g yo

 

Yeoman is built around the concept of generators. Think of them as a set of rules that Yeoman needs to generate the project structure and files for your project. In this case, we will be installing AngularJS. First, you have to get the generator for AngularJS by installing:

npm install -g generator-angular

This code  will install the scripts and templates needed for you to bootstrap your Angular app.  Next, cd into your public directory we created and generate the project into this folder by running:

yo angular

It  will prompt you with a series of questions that will then tailor the generated files to your needs. Once this is done, you will notice that the structure seems like another node app and you’re right to think that!

Yeoman and the tools that Yeoman uses (like bower and grunt) are all using npm to get the modules they need to build your app.

To run your yeoman app, simply go into the public folder and run grunt server. Grunt is essentially made  for web apps. It has a set of rules you can find in Gruntfile.js that outlines what needs to happen for different options.

Running grunt server will run a small server that will serve your website. Grunt build will go through all your source code, minify HTML, JS, SCSS and images, and spit the result out in the dist folder.

You can learn all about yeoman and grunt at Yeoman.io.

Your basic development workflow would be as follows:

In one terminal window, you will have grunt server running. This will run your AngularJS app. In another terminal window, you can have your node app running, providing the API for your AngularJS app.

The reason I personally love doing this is because grunt server will refresh your browser on the fly when you make SCSS changes and this is very useful when you’re developing.

When it comes time to deploy to production, running grunt build will output an “optimized and minified” version of the website to the dist folder. This is the folder you can setup in your server.js Express.static and use when someone hits your node server.

app.use(express.static(__dirname + ‘/public/dist’));

As a developer building a scalable web app, MEAN has profound implications. You can leave all your templating to render on the client side, lessening the load on your Node server. Your Node.js code is exposed via an API that your AngularJS app can connect to. This  ensures that in the future if you want to build a mobile app or open up your API to third parties, it’s very simple since the API’s are already created.

Lastly, one of the more interesting things about the MEAN stack is that because it is so loosely decoupled, if you wanted to replace any of the technologies with another technology, you could easily do so without changing the other platform. For example you could replace AngularJS with Ember, or Node.js with Python.

2189

Ruby on Rails and Beyond: Scaling a Company

 

If you’ve spent time at a start-up, you know life moves pretty fast and technology moves even faster. Over the last several years, my experience with Ruby on Rails® has provided me insight not only into scaling a team with this popular web application framework, but also into broader lessons all start-ups should consider. Growth, business needs and the development process are often tangled, but they are exciting challenges that make our work so rewarding when it succeeds.

 

When I started at BillFloat in late 2009, the Ruby on Rails framework had a dedicated community and well-deserved reputation for ease of use and speed to market. A number of other venture-backed companies, including those in the financial sector, had trusted running their business on Rails. As an active Rails developer since early 2006, choosing Rails as our web application development framework was a natural choice.

 

Move forward several years and our needs in 2012 were broad, but not unique. We needed to scale our engineering organization. We needed to deliver multiple products. We needed to consolidate complicated business logic. We needed to accomplish all these tasks without disrupting existing business. While daunting, these needs in themselves reflected a positive and exciting truth. We were scaling because we were successful.

 

In the beginning, companies should just focus on a single Rails application and getting their product to market. If possible, think about horizontal scaling and partitioning off functionality as much as you can from the beginning. However, prove there is interest in your product before you invest heavily in adding complexity.

 

In the Rails community best practices change rapidly. Today’s hot gem or technique will be outdated within months. BillFloat’s experiences with processing long running jobs are a good example. We have changed our approach several times since starting.

 

In some ways, technology is the easier part of scaling. Adding servers, optimizing code, and refactoring are all well worn best practices within our industry. In addition, teams must manage dependencies between application tiers, other engineers and product management. Teams must practice agile development to scale effectively, including test-driven development, pair programming, feature-based branching with pull requests as well as continuous integration.

 

Scaling is also about people and organization. As you grow, you discover you need new people and new ideas. Even when you have the people and skills you need, communication among all the teams can be challenging. It is easy – and common – to slip into a mindset of just worrying about your own projects rather than the whole direction of the company.

 

New and growing companies often attract passionate individuals who are willing to put the time, energy and brain-power into pushing an idea to its full potential. Ruby on Rails can be a great tool to help get you started, and scale with you to the next level. To reach the greatest heights, however, you’ll need to remember the pieces that aren’t tied strictly to the technology.

 

Doug Reed (@dougereed) is CTO and Vice President of Engineering at BillFloat, Inc., a leading innovator in consumer credit delivery. 

348