Join the DZone community and get the full member experience.Join For Free
written by cody lindley for telerik.
in this article, i am going to describe 16 steps that front-end developers should go through when planning a front-end web application. these steps aim to cover the entire life-cycle of a front-end application. however, before diving in, i need to clarify a few front-end terms that remain unsettled in the industry.
third, crafting a web application with just the right parts is a skill likened to building a race car. a professional race car is not bought off the lot at the local car dealer and neither should an entire front-end application solution. thus, the developer i’m speaking about is, more than likely not, a fan of all-in-one integrated development environments, full-stack development tools, or heavy handed frameworks in general.
i also need to clarify that the front-end developer i’m speaking about works on a large team of developers and would rarely be responsible for developing the entire app front-to-back, the data api, or any back-end services consumed by the front-end team. thus, tools that offer integrated full stack features are avoided by this type of front-end developer.
the last clarification i need to make is that i don’t presuppose that building an enterprise grade app requires a monolithic integrated framework from a single vendor and that it’s completeness alone makes it an enterprise-worthy solution. this, i believe, is a dying concept from the early years of software development. modern, front-end engineers favor loosely coupled systems that avoid vendor lock-in (i.e. hard to change systems) and lock down (systems that don’t play well with others). these modern systems are not only viable for the enterprise, they can elevate a lot of the downfalls associated with enterprise software. in my opinion, these styles of tools which were once considered helpful to developers, are now considered harmful.
an example of a more modern stack of loosely coupled tools for building enterprise applications is kendo ui . it provides enterprise grade tools, but it won’t lock you in or lock you out of being able to change, evolve, or use it with other third party solutions.
with that all said, let’s begin.
step 1. verify you have a working & stable data api.
in a nutshell, api first development means you document, build, and test your api first. this means you have a relatively stable api before you write any application code.
note that during api construction, front-end developers should be prototyping minimal viable features using the api and providing feedback to the api engineers.
the main reason to follow api first development is to reduce the possible deficiencies in the api from being amplified in the data layer and causing ten-fold pain and misery. i’ve found the following quote, from @julio_ody in the pragmatic guide to backbone.js apps book to be painfully true:
“data layer will absorb your api’s ugliness and amplify it by one hundred” – @julio_ody
you want to do everything in your power up front to avoid having to make up for your api’s deficiencies in your application logic. not having a documented and mostly solidified data api before a line of application code is written, is asking for pain and misery in the future. build your api first. document it, test it, and then be ready to evolve it as you build out the applications that use it.
it’s worth noting that it may be assumed that security and authentication details will accompany the api. it is also assumed that the api developers will provide a development api to be used for development. using the same data api for both development and production should never be an option.
step 2. select software management tools
to manage the development of the front-end application, you’ll minimally need to select the following software management tools to manage code, assets, and team members’ tasks:
|software management tools||examples|
|ticketing system (i.e. bugs)||github|
|version control system||github|
|document/asset storage||slack & conceptboard|
|team communication||slack & conceptboard|
pick these up front and make everyone use them. if you have a team member who won’t get on board with the tools, then you have an enemy within. please don’t take my last statement and use it as a tool to force development tools on developers. development tools and development management tools are not the same thing. developers should never be forced into something like an ide, text editor, or command like text editor.
step 3. create a foundational specification
each project is going to be different and will, of course, have its own specification relevant to the problem being solved. however, a foundational specification can be created before you spec out the actual application. these specifications are important to establish upfront and should remain unchanged during development. all decisions made after the foundation spec will depend on the decisions made in the foundational specification.
make sure you carefully consider each specification mentioned below.
|devices & min. resolutions||laptop/desktop & 1024×768|
|os/browsers||os x & win 8 on ie9+, ff, safari & chrome, latest|
|languages (i.e. localization)||english & bulgarian language|
|cultures (i.e. globalization)||english & bulgarian culture|
|accessibility||section 508 & wai-aria 1.0|
|seo||none (done on product site)|
note: what i’m about to say is contentious. you might just skip this part if you are easily offend by a differing opinion.
i do not mention responsive design or mobile first when creating a foundational specification for front-end applications . i did this because i assume no one who builds user-centered web application interfaces would do this for an application . in general, you should build applications (user heavy data interactions) specifically to the needs of the user and the device they are using. constructing a single code base that can meet the needs of users on multiple devices is simply too problematic on too many fronts. mission critical interactions are too diverse across devices and thus the code is extremely diverse. this much diversity in the code is unnecessary complexity. a rwd web app is a concept that seeds complexity. i’d avoid it. with that said, and before you send me textual hate, i do believe responsive design has its place among websites. my main point is that it loses its value and purpose quickly when you shove its patterns and practices into application development. for example, facebook would never build an application from a single code base that runs on all platforms/devices. they build platform/device specific applications because that is what is best for the user.
step 4. select a software development process
in my experience, picking a process and making sure everyone follows it is more important than the actual type of process one chooses. i’ve tried several software development methodologies. most have left me feeling like that moment when you recognize the gap between what you are sold and what you actually get.
the more recent agile-minded software development processes feel like the sweet spot for building applications. i’ve tried very strict agile processes and very loose agile processes. the processes i’ve found to be ideal are the custom, loosely enforced, agile-like processes that can be wrapped around the uniqueness of the project and team members. roughly, the process i’d choose to start with looks something like this:
- meet monday morning, prioritize development tasks then pick tasks that you can accomplish by the week’s end so that you avoid the dreaded two day context switch (i.e. the weekend);
- meet at the start of each day (tues – fri) and discuss what you are doing and what you need in order to get things done;
- communicate with whomever you need to, however you can;
- iterate until it’s right (for the users), then release per your release plan;
step 5. select a development platform & a host platform (i.e. staging & production platforms)
|development||node.js running locally|
|staging & production host||node.js running on modulus.io|
step 6. select package managers
managing third party code and their dependencies should not be a manual task performed by a human. package managers should perform this duty. as of today, i believe it still makes good sense to select a separate package manager for your application code and your code that is parsed by a browser engine. below are some choices for front-end developers.
|node.js package manager||npm|
|browser package manager||bower|
step 7. select site & user analytic tools
a lot of developers wait until the end of a project to integrate analytics, but one should not wait for development to end to select, plan, and integrate analytic tools. the reason not to wait is that these tools often have tentacles (especially user analytic tools) into the application code and its organization. select analytic tools up front, plan accordingly, and consider their usage during development. it’s fairly common to have a separate tool for site analytics and one to help facilitate the type of user analytics you require.
step 8. select error, quality, and style code enforcement tools
when working on a team, the goal should be that each file is written as if it were coded from a single developer’s mind in regards to error prevention, formating, and style. three main types of tools (i.e. code linters/hinters, code style checker, and a code editor config file) aid this process and should be properly implement and configured before coding begins.
|error, quality, and style enforcement code tools||example|
|linters/hinters||csslint , htmlhint , jshint|
|code editor configuration file||.editorconfig|
it’s fairly common that these tools will run every time a developer saves a file in their code editor and/or commits code to a revision system like git. i’ve even implemented a git hook that would double check the enforcements and reject a code push if any of the code failed to pass. however, the most common implementation of these tools is found in a the application building process.
step 9. select an automated task running tool
whatever you do, just don’t assume humans will manually perform tasks or that you can afford the expense of human-driven processes.
step 10. select application architecture/structure (and corresponding tools/solutions)
this step is where the majority of those doing front-end application development give their time and attention. i believe this is a mistake. if you are still with me by this point, you see that i believe that this is only one step of many in planning a front-end application.
in this step, you have to pick a set of tools that will fit your team and the organization when architecting and structuring application code. the solutions might not always be what you personally think is best, but instead what is pragmatically best for the problem you are trying to solve and the types of developers who are solving it.
a possible stack of solutions you might consider which is rather popular today could be:
|templates||mvvm from angularjs|
|module communication||angularjs $rootscope.$broadcast and $scope.$on for a pubsub communication.|
|data abstraction||kendo ui datasource|
|app structure||ng seed|
|dependency management||angularjs dependency injection|
|widgets/components||kendo ui (using built-in directives )|
|css ui frameworks||material design for angular|
i hope after you examine the stack above you will concern yourself less with the actual examples given, and more with the how i labeled the parts. what i want you to realize is that your application needs:
- mv* (something to organize models, views, and app logic/controller)
- templates (e.g. strings templates or mvvm)
- module communication (i.e. global event bus or sub/pub)
- data abstraction (i.e. abstraction that deals with data api & models)
- app structure (i.e. folder structure and how you break up the parts of the app)
- routing system (i.e. call x function when url changes)
- dependency management (i.e. how are module dependencies loaded/required)
- widgets/components (e.g. grid widget, make sure these fit into your globalization and localization specifications)
- css ui frameworks (e.g bootstrap, foundation, pure, topcoat etc..)
the specific solutions chosen to architect and structure an application is less important than making sure you understand the role and purpose of each part, and that you make the proper use of each when your application requires it. if what am saying is cryptic, simply take the bulleted list above and make sure you completely grok each list item and its role in application development.
the last thing i want to say about this step is that while most solutions will get the job done, ideally you want to use the simplest solution available given the context of the problem you are solving. don’t use a sledgehammer (e.g. angularjs) when a regular hammer (e.g. vue.js) will do.
step 11. select testing methodologies & tools
how you test and what you test is less important than the fact that you test something. it’s likely the case that you’ll want to test each module or unit of code by writing unit tests. when all of the units of code unite to form a running application, you’ll want to do functional testing. below i detail the tools required (tasking tool facilitate all this) to do cross-browser unit and functional testing.
|test runner (for unit testing)||karma|
|unit testing framework||mocha|
|unit testing assertions||chai|
|unit testing mocking||sinon.js|
|unit testing coverage||blanketjs|
|browser testing platform (for unit & functional testing)||browserstack|
|browser automation framework (for functional testing)||nightwatch.js|
step 12. select code quality/complexity tools
if code analysis tools are a new concept for you, make sure you check out the analysis of the jquery library . plato’s visual analysis makes it fairly obvious as to the value of analyzing code and how you might work it into an application life cycle.
step 13. define deployment strategy
you need a plan to get your local code to staging and production (i.e. deploy local code to public servers). after all, not everyone can always see your locally running application, even if you use some magic to make it happen. a continuous integration server is an ideal solution for crafting deployments regardless of whether you intend to deploy to production on every code push.
let me step back for a moment from ci concepts and talk about local development. ideally, anything you do during ci, you should be able to do locally. that means, building and testing your application should be crafted first to run locally. in fact, i will often run a second server locally that serves staging code on my local machine (i.e. what gets outputted during ci process). it’s this local testing and build process that becomes automated once you set up your ci integration. i’ve loosely mapped out below what this might look like.
|continuous integration||use codeship to deploy to modulus hosted staging and production|
step 14. select package monitoring solution
package managers alleviate manually managing dependencies but don’t offer automated insight into upgrade paths for each package. package monitoring tools can alleviate manually having to monitor packages for updates by notifying you about available updates or a potential security vulnerability. it can even auto-magically update packages for you based on semver configurations. at the very least, a package monitoring solution can help you speed up the process of updating dependencies by simply keeping you informed.
a tool like gemnasium can monitor both your npm package.json file as well as your bower.json file. below is an example gemnasium dashboard for the package.json file used on the kendo-ui-core github project .
step 16. select a performance monitoring solution
lastly, the monitoring and measurement of the uptime and performance of your application should consistently be on your mind. use something like pingdom to capture uptime and performance stats. i particularly like the alerting and reporting capabilities of these types of tools. it’s like having a team of robots monitoring your uptime and performance every second of the day, then providing detailed reports as often as you’d like.
in conclusion, i want to ask and answer the question, “why follow any of these steps when planning a front-end application?”.
the entire goal of writing software should be to create something that can last. we plan out applications so that they are properly documented, tested, scalable, and monitored. this leads to software systems that are resistant to the effects of overwhelming code debt, spaghetti code, and consistently having to be burned down and built back up.
by providing these steps i am not suggesting that you should dogmatically follow each step or use each tool/solution/example i showcased in the step. the tools/solutions/examples (e.g. angularjs) found in each step are given so that you can get the general context of the decision made in the step. if you take away anything from this article, it should be the category of decisions made in the step, not a specific tool/solution/example present in the step.
if you think i’ve missed anything major (like maybe code reviews), let me know in the comments.
building js apps:
Published at DZone with permission of , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.