https://github.com/cooljith91112/inappjstemplate
https://github.com/cooljith91112/inappjstemplate
easy-to-use javascript jquery nunjucks requirejs spa
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cooljith91112/inappjstemplate
- Owner: cooljith91112
- Created: 2017-01-17T10:10:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-17T12:01:58.000Z (almost 8 years ago)
- Last Synced: 2025-01-11T00:28:33.446Z (4 months ago)
- Topics: easy-to-use, javascript, jquery, nunjucks, requirejs, spa
- Language: JavaScript
- Size: 1.74 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# InApp JS Boilerplate
### Feature list:
* Easy to start a project from scratch
* Build on top of RequireJS
* Templating (based on Mozilla's Nunjucks)
* State based routing
* Integrated Optimizer/Minifier ([r.js](http://requirejs.org/docs/optimization.html))### Requirements
**NodeJS** - For final buildingNo other dependencies
### Installation:
```sh
$ npm install -g requirejs
```### Build:
```sh
$ node r.js -o build.js
```
output/production code will be copied to **dist** folder.### Directory Structure
```sh
Project
├───css
│ └───lib --> Third party libraries
├───fonts
├───images
├───partials --> module wiser partial views should be stored here
│ ├───common
│ ├───dashboard
│ ├───login
│ └───test
└───src
├───common
├───dashboard --> module folder
├───libs -> put all third party dependencies here
│ └───jquery-ui-1.12.1.custom
│ ├───external
│ │ └───jquery
│ └───images
└───login --> module folder
```### File Descriptions
| File | Description |
| ------ | ------ |
| build.js | This file contains final build configurations, customizable |
| src/config.js |This files holds module definition, render area declaration, template path etc |
| src/config.require.js | Holds third party library/module definitions |
| src/constants.js | Used to store Application constants like API url, end points etc |
| src/global.js | Global application variable storage (acts like $rootScope of angularJS) |
| src/router.js | This file is important, stores the application routing, module permissions, module loading etc |
| src/main.js | Entry point/ boostraper of the Application. This will initiate the router config |
| src/moduleLoader.js | Utility library used to load module, utilizing config.js |
| src/services.js | services is a wrapper library around standard JQuery Ajax |
| src/templateRenderer.js | Used to load template using nunjucks |