
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
generator-frontify
Advanced tools
Framework for your simple, maintainable & super-fast front-end application.
Notice: This is a generator for Yeoman.
Install
$ npm install -g yo grunt-cli
$ npm install generator-frontify
Initialize
$ yo frontify
Generate Module
$ yo frontify:module Example
Framework for your simple, maintainable & super-fast front-end application
The following requirements are only needed for development.
This application uses grunt to build it's components and run itself. If you haven't used grunt before, be sure to check out the Getting Started guide. Once you're familiar with that process, run the application with the command:
grunt app
This command generates all resources needed by the front-end and runs it within a node server. You don't have to install an additional webserver. The script opens up your default browser on
http://localhost:3000/
Notice: You are not limited to a node server. You can run the application on every webserver.
To prepare your application for deployment, run the following command to create a zip package dist/application.zip with all resources and assets needed for deployment on a webserver.
grunt dist
Normally, the following tasks do not need to be run manually, because of the watch tasks.
Compiles all *.less files as combined css.
grunt less
Concatenate all javascript files and build combined files with the concat task.
grunt concat
Minify all javascript files using the uglify task.
grunt uglify
Minify all css files using the cssmin task.
grunt cssmin
Each component or block of the UI is called module. Examples are Logo or Navigation. These modules are located in the src/modules directory and they contain all their relevant *.html, *.css/*.less and *.js files. This separates the code in a maintainable way, even for very large applications.
All .html files are handled as doT templates (open-source javascript template engine). Read more about the syntax in the documentation.
<div class="mod mod-example"></div>
Here's an example of such a module css snippet. Placed as src/modules/Example/css/example.less. You can use LESS syntax to make use of mixins, variables & other pre-compilation features. Read the documentation for more information on the syntax.
Be sure to use prefix .mod-modulename for every rule. Scoping is important for maintainable code.
@import "variables.less";
.mod-example { }
You can write vanilla javascript or you can create modules (recommended), a concept introduced by the open-source library Terrific.js. Read more about the usage and features in the documentation. Modules are great for writing small pieces of maintainable javascript code scoped on the actual module, rather than on the whole application.
Here's an example of such a module javascript snippet. Placed as src/modules/Example/js/example.js
(function($) {
Tc.Module.Example = Tc.Module.extend({
on: function(callback) {
// your bindings here (e.g. onclick, etc.)
callback();
},
after: function() {
// your module code here (e.g. AJAX calls, etc.)
}
});
})(Tc.$);
The application views are configured within src/api/app/views.json.
Here's an example of a view configuration.
{
"id": 1,
"route": "/example",
"title": "Example",
"layout": "default",
"modules": {
"content": [ "article-home"]
}
}
All layouts are located in src/modules/Layout. Each layout defines regions with data-region attributes. They are filled with the modules configured in the corresponding view, as seen above.
Here's an example of the default layout markup (src/modules/Layout/layout-default.html).
<header data-region="header"></header>
<div data-region="content"></div>
<footer data-region="footer"></footer>
and here is the definition of the default state (default modules, etc.), which will be extended through the specific view configuration.
{
"id": "default",
"modules": {
"header": [ "logo", "navigation" ]
}
}
All compilations needed for run-time are done automatically on file changes. Sometimes it's needed to run grunt app to get freshly compiled files.
The JavaScript build generates two concatenated `*.js files.
dist/assets/js/application-core.min.js Minified version of javascript librariesdist/assets/js/application.min.js Minified version of application-specific javascriptIn addition, there are some language specific javascript files generated.
dist/assets/css/application.min.css Minified version of application-specific cssThe framework is intended to be compatible with all major browsers, including IE7+.
Built by Roger Dudler @ Frontify & Frank Vollenweider @ Pixabytes
FAQs
Modular front-end boilerplate including declarative views
We found that generator-frontify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.