xing-framework 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/default_configuration/base_app/backend/config/initializers/session_store.rb +1 -1
- data/default_configuration/base_app/backend/static-app.ru +1 -1
- data/default_configuration/base_app/frontend/npm-shrinkwrap.json +2042 -885
- data/default_configuration/base_app/frontend/package.json +1 -1
- data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-request.tpl.html +2 -2
- data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-update.tpl.html +3 -3
- data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations.tpl.html +6 -6
- data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions.tpl.html +4 -4
- data/default_configuration/base_app/frontend/src/app/inner.tpl.html +8 -8
- data/default_configuration/base_app/frontend/src/app/root.tpl.html +1 -1
- data/default_configuration/base_app/frontend/src/common/components/sessionLinks/session-links.tpl.html +3 -3
- data/default_configuration/base_app/frontend/src/common/components/sessionLinks/sessionLinks.js +1 -1
- data/default_configuration/base_app/frontend/src/common/components/signOut/signOut.js +1 -1
- data/default_configuration/base_app/frontend/src/common/config.js +2 -2
- data/default_configuration/base_app/frontend/src/index.html +1 -1
- data/default_configuration/base_app/frontend/src/styles/partials/_forms.sass +1 -1
- data/default_configuration/base_app/frontend/src/styles/partials/_navbar.sass +1 -1
- data/default_configuration/base_app/frontend/test/auth/passwords/passwordsControllers.js +2 -2
- data/default_configuration/base_app/frontend/test/auth/registrations/registrationsControllers.js +1 -1
- data/default_configuration/base_app/frontend/test/auth/sessions/sessionsControllers.js +1 -1
- data/default_configuration/base_app/static-app.ru +1 -1
- metadata +2 -47
- data/default_configuration/base_app/API_DOC/README +0 -23
- data/default_configuration/base_app/API_DOC/admin-menus +0 -167
- data/default_configuration/base_app/API_DOC/admin-pages +0 -173
- data/default_configuration/base_app/API_DOC/content-block +0 -10
- data/default_configuration/base_app/API_DOC/navigation +0 -54
- data/default_configuration/base_app/API_DOC/page +0 -38
- data/default_configuration/base_app/backend/README +0 -12
- data/default_configuration/base_app/backend/public/index.html +0 -0
- data/default_configuration/base_app/dummy-api/admin/menu_items/10.json +0 -15
- data/default_configuration/base_app/dummy-api/admin/menu_items/11.json +0 -15
- data/default_configuration/base_app/dummy-api/admin/menu_items/12.json +0 -15
- data/default_configuration/base_app/dummy-api/admin/menu_items/13.json +0 -15
- data/default_configuration/base_app/dummy-api/admin/menu_items/14.json +0 -15
- data/default_configuration/base_app/dummy-api/admin/menu_items/15.json +0 -15
- data/default_configuration/base_app/dummy-api/admin/menu_items/16.json +0 -15
- data/default_configuration/base_app/dummy-api/admin/menus.json +0 -23
- data/default_configuration/base_app/dummy-api/admin/menus/1.json +0 -118
- data/default_configuration/base_app/dummy-api/admin/menus/2.json +0 -8
- data/default_configuration/base_app/dummy-api/admin/pages.json +0 -105
- data/default_configuration/base_app/dummy-api/admin/pages/about_us.json +0 -45
- data/default_configuration/base_app/dummy-api/admin/pages/contact_us.json +0 -36
- data/default_configuration/base_app/dummy-api/admin/pages/gallery.json +0 -36
- data/default_configuration/base_app/dummy-api/admin/pages/home.json +0 -36
- data/default_configuration/base_app/dummy-api/admin/pages/homepage.json +0 -18
- data/default_configuration/base_app/dummy-api/admin/pages/links.json +0 -36
- data/default_configuration/base_app/dummy-api/admin/pages/newsletter.json +0 -54
- data/default_configuration/base_app/dummy-api/homepage.json +0 -14
- data/default_configuration/base_app/dummy-api/navigation/main.json +0 -119
- data/default_configuration/base_app/dummy-api/pages/about_us.json +0 -41
- data/default_configuration/base_app/dummy-api/pages/contact_us.json +0 -32
- data/default_configuration/base_app/dummy-api/pages/gallery.json +0 -32
- data/default_configuration/base_app/dummy-api/pages/home.json +0 -32
- data/default_configuration/base_app/dummy-api/pages/homepage.json +0 -14
- data/default_configuration/base_app/dummy-api/pages/links.json +0 -32
- data/default_configuration/base_app/dummy-api/pages/newsletter.json +0 -50
- data/default_configuration/base_app/frontend/CHANGELOG.md +0 -125
- data/default_configuration/base_app/frontend/LICENSE +0 -19
- data/default_configuration/base_app/frontend/README.md +0 -5
- data/default_configuration/base_app/frontend/bin/index.html +0 -0
- data/default_configuration/base_app/frontend/changelog.tpl +0 -23
- data/default_configuration/base_app/frontend/src/README.md +0 -48
- data/default_configuration/base_app/frontend/src/app/README.md +0 -68
- data/default_configuration/base_app/frontend/src/assets/README.md +0 -4
- data/default_configuration/base_app/frontend/src/common/README.md +0 -19
- data/default_configuration/base_app/frontend/tools.md +0 -223
@@ -1,68 +0,0 @@
|
|
1
|
-
# The `src/app` Directory
|
2
|
-
|
3
|
-
## Overview
|
4
|
-
|
5
|
-
```
|
6
|
-
src/
|
7
|
-
|- app/
|
8
|
-
| |- auth/
|
9
|
-
| |- pages/
|
10
|
-
| |- homepage/
|
11
|
-
| |- app.js
|
12
|
-
| |- appConfig.js
|
13
|
-
| |- rootController.js
|
14
|
-
```
|
15
|
-
|
16
|
-
The `src/app` directory contains all code specific to this application. Apart
|
17
|
-
from `app.js` , this directory is
|
18
|
-
filled with subdirectories corresponding to high-level sections of the
|
19
|
-
application, often corresponding to top-level routes. Each directory can have as
|
20
|
-
many subdirectories as it needs, and the build system will understand what to
|
21
|
-
do. For example, a top-level route might be "products", which would be a folder
|
22
|
-
within the `src/app` directory that conceptually corresponds to the top-level
|
23
|
-
route `/products`, though this is in no way enforced. Products may then have
|
24
|
-
subdirectories for "create", "view", "search", etc. The "view" submodule may
|
25
|
-
then define a route of `/products/:id`, ad infinitum.
|
26
|
-
|
27
|
-
## `app.js`
|
28
|
-
|
29
|
-
This is our main app configuration file. It kickstarts the whole process by
|
30
|
-
requiring all the modules from `src/app` that we need. We must load these now to
|
31
|
-
ensure the routes are loaded. If as in our "products" example there are
|
32
|
-
subroutes, we only require the top-level module, and allow the submodules to
|
33
|
-
require their own submodules.
|
34
|
-
|
35
|
-
As a matter of course, we also require the template modules that are generated
|
36
|
-
during the build.
|
37
|
-
|
38
|
-
However, the modules from `src/common` should be required by the app
|
39
|
-
submodules that need them to ensure proper dependency handling. These are
|
40
|
-
app-wide dependencies that are required to assemble your app.
|
41
|
-
|
42
|
-
```js
|
43
|
-
var app = new Module(appName, [
|
44
|
-
'templates-app', 'templates-common', 'ui.router',
|
45
|
-
'picardy.fontawesome',
|
46
|
-
StateAttrs,
|
47
|
-
UIRouteLogger,
|
48
|
-
Menus,
|
49
|
-
Homepage,
|
50
|
-
Auth,
|
51
|
-
Admin,
|
52
|
-
ResponsiveMenu,
|
53
|
-
Metadata,
|
54
|
-
ExampleForm,
|
55
|
-
SessionLinks,
|
56
|
-
Toast,
|
57
|
-
Pages,
|
58
|
-
Backend,
|
59
|
-
NavigationBar,
|
60
|
-
appConfig,
|
61
|
-
RootCtrl
|
62
|
-
]);
|
63
|
-
```
|
64
|
-
|
65
|
-
With app modules broken down in this way, all routing is performed by the
|
66
|
-
submodules we include, as that is where our app's functionality is really
|
67
|
-
defined. So all we need to do in `app.js` is specify a default route to follow,
|
68
|
-
which route of course is defined in a submodule.
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# The `src/common/` Directory
|
2
|
-
|
3
|
-
The `src/common/` directory is reusable components that serve as the business logic of the application. They may be specific to this application, but should be organized so that they can be easily copied and reused in another application. In general user visible components like directives, controllers, states, and templates should not live here.
|
4
|
-
|
5
|
-
```
|
6
|
-
src/
|
7
|
-
|- common/
|
8
|
-
| |- resources
|
9
|
-
| |- components
|
10
|
-
| |- config.js
|
11
|
-
| |- environment.js
|
12
|
-
| |- AppBackend.js
|
13
|
-
```
|
14
|
-
|
15
|
-
- `resources` - this houses sub-classes of BackendResource which provide an object oriented interface to backend data
|
16
|
-
- `components` - reusuable UI components, usually directives, that do not make up an entire new view on the page that would change the URL
|
17
|
-
- config.js - contains important configuration variables used throughout the app
|
18
|
-
- environment.js - DON'T EDIT THIS FILE. it gets regenerated. instead, edit the individual environment files in frontend/config
|
19
|
-
- AppBackend.js provides app specific endpoints to the backend
|
@@ -1,223 +0,0 @@
|
|
1
|
-
# The Tools Used in `ngBoilerplate`
|
2
|
-
|
3
|
-
## Introduction
|
4
|
-
|
5
|
-
`ngBoilerplate` is standards-based, so it uses all the usual tools to manage
|
6
|
-
and develop client-side code. If you've developed modern, highly-organized
|
7
|
-
JavaScript projects before, you are probably already familiar with at least most
|
8
|
-
of these tools. What follows is a simple description of the tools of which this
|
9
|
-
project makes use and how they fit in to the `ngBoilerplate` picture.
|
10
|
-
|
11
|
-
## Git
|
12
|
-
|
13
|
-
[Git](http://git-scm.com/) is a distributed version control system.
|
14
|
-
`ngBoilerplate` uses git to manage its codebase. While in theory you don't have
|
15
|
-
to use Git once you download `ngBoilerplate`, this project makes the assumption
|
16
|
-
that you do. If you're on GitHub, I assume you already have a basic
|
17
|
-
understanding of Git, which is all you need to make effective use of this
|
18
|
-
project. You just need to be able to commit and push and junk - nothing funky.
|
19
|
-
If you're not familiar with it, check out the documentation linked to above.
|
20
|
-
GitHub also has a great [help section](https://help.github.com/).
|
21
|
-
|
22
|
-
## Node.js & NPM
|
23
|
-
|
24
|
-
[Node.js](http://nodejs.org) is a platform based on Chrome's JavaScript runtime,
|
25
|
-
called [V8](http://code.google.com/p/v8/). It allows you to develop all kinds of
|
26
|
-
software using the JavaScript you already know and love.
|
27
|
-
|
28
|
-
A great feature of Node.js is its wide variety of existing libraries and tools.
|
29
|
-
As the developer community is absolutely massive and incredibly active, Node.js
|
30
|
-
has a basic package manager called NPM that you can use to install Node.js-based
|
31
|
-
software and libraries from the command line.
|
32
|
-
|
33
|
-
While `ngBoilerplate` makes heavy use of Node.js behind the scenes, you as the
|
34
|
-
application developer don't need to really think about it much. Most of the
|
35
|
-
interaction with Node.js will occur through Grunt (see next section), so you
|
36
|
-
really only need to know how get the initial setup working.
|
37
|
-
|
38
|
-
`package.json` is an NPM package description file written in JSON. It contains
|
39
|
-
basic metadata about your application, like its name, version, and dependencies.
|
40
|
-
By default, several packages are required for the build process to work; so when
|
41
|
-
you first start with `ngBoilerplate` you have to tell NPM to install the
|
42
|
-
packages; this is covered in detail in the [main README](README.md). Some of
|
43
|
-
the required packages are Grunt build tasks (see below), while others are
|
44
|
-
command-line tools either we (or the build system) need, like Karma, Grunt, and
|
45
|
-
Bower.
|
46
|
-
|
47
|
-
Don't worry about knowing Node.js in order to use `ngBoilerplate`; Grunt is
|
48
|
-
where the magic happens.
|
49
|
-
|
50
|
-
## Grunt.js
|
51
|
-
|
52
|
-
[Grunt](http://gruntjs.com) is a JavaScript task runner that runs on top of
|
53
|
-
Node.js. Most importantly, Grunt brings us automation. There are lots of steps
|
54
|
-
that go into taking our manageable codebase and making it into a
|
55
|
-
production-ready website; we must gather, lint, test, annotate, and copy files
|
56
|
-
about. Instead of doing all of that manually, we write (and use others') Grunt
|
57
|
-
tasks to do things for us.
|
58
|
-
|
59
|
-
When we want to build our site, we can just type:
|
60
|
-
|
61
|
-
```sh
|
62
|
-
$ grunt
|
63
|
-
```
|
64
|
-
|
65
|
-
This will do everything needed and place our built code inside a folder called
|
66
|
-
`bin/`. Even more magical, we can tell Grunt to watch for file changes we make
|
67
|
-
so it can re-build our site on-the-fly:
|
68
|
-
|
69
|
-
```sh
|
70
|
-
$ grunt watch
|
71
|
-
```
|
72
|
-
|
73
|
-
The built files will be in `build/`. See the main [README](README.md) for more
|
74
|
-
info.
|
75
|
-
|
76
|
-
The next time we change a source file, Grunt will re-build the changed parts of
|
77
|
-
the site. If you have a Live Reload plugin installed in your browser, it will
|
78
|
-
even auto-refresh your browser for you. You lazy bum.
|
79
|
-
|
80
|
-
Grunt is controlled through `Gruntfile.js`. This file is heavily documented in
|
81
|
-
the source, so I will only provide a high-altitude overview here. Also note that
|
82
|
-
unless you need to modify the build process, you don't need to know anything
|
83
|
-
else from this section. The two commands above really are all you need to know
|
84
|
-
to get started with `ngBoilerplate`. But for those curious or looking to go a
|
85
|
-
little more advanced, here's what you'll find.
|
86
|
-
|
87
|
-
First, we tell Grunt which tasks we might want to use:
|
88
|
-
|
89
|
-
```js
|
90
|
-
// ...
|
91
|
-
grunt.loadNpmTasks('grunt-recess');
|
92
|
-
grunt.loadNpmTasks('grunt-contrib-clean');
|
93
|
-
grunt.loadNpmTasks('grunt-contrib-copy');
|
94
|
-
grunt.loadNpmTasks('grunt-contrib-jshint');
|
95
|
-
// ...
|
96
|
-
```
|
97
|
-
|
98
|
-
Each of these tasks must already be installed. Remember the dependencies from
|
99
|
-
`package.json` that NPM installed for us? Well, this is where they get used!
|
100
|
-
|
101
|
-
Then we get the opportunity to tell the tasks to behave like we want by
|
102
|
-
defining a configuration object. While we can (and do) define all sorts of
|
103
|
-
custom configuration values that we reference later on, tasks look for
|
104
|
-
configuration properties of their own name. For example, the `clean` task just
|
105
|
-
takes an array of files to delete when the task runs:
|
106
|
-
|
107
|
-
```js
|
108
|
-
clean: [ '<%= build_dir %>', '<%= compile_dir %>' ],
|
109
|
-
```
|
110
|
-
|
111
|
-
In Grunt, the `<%= varName %>` is a way of re-using configuration variables.
|
112
|
-
In the `build.config.js`, we defined what `build_dir` meant:
|
113
|
-
|
114
|
-
```js
|
115
|
-
build_dir: 'build',
|
116
|
-
```
|
117
|
-
|
118
|
-
When the clean task runs, it will delete the `build/` folder entirely so that
|
119
|
-
when our new build runs, we don't encounter any problems with stale or old
|
120
|
-
files. Most tasks, however, have considerably more complicated configuration
|
121
|
-
requirements, but I've tried to document what each one is doing and what the
|
122
|
-
configuration properties mean. If I was vague or ambiguous or just plain
|
123
|
-
unclear, please file an issue and I'll get it fixed. Boom - problem solved.
|
124
|
-
|
125
|
-
After our configuration is complete, we can define some of our own tasks. For
|
126
|
-
example, we could do the build by running all of the separate tasks that we
|
127
|
-
installed from NPM and configured as above:
|
128
|
-
|
129
|
-
```sh
|
130
|
-
$ grunt clean
|
131
|
-
$ grunt html2js
|
132
|
-
$ grunt jshint
|
133
|
-
$ grunt karma:continuous
|
134
|
-
$ grunt concat
|
135
|
-
$ grunt ngmin:dist
|
136
|
-
$ grunt uglify
|
137
|
-
$ grunt recess
|
138
|
-
$ grunt index
|
139
|
-
$ grunt copy
|
140
|
-
```
|
141
|
-
|
142
|
-
But how automated is that? So instead we define a composite task that executes
|
143
|
-
all that for us. The commands above make up the `default` tasks, which can be
|
144
|
-
run by typing *either* of these commands:
|
145
|
-
|
146
|
-
```js
|
147
|
-
$ grunt
|
148
|
-
$ grunt default
|
149
|
-
```
|
150
|
-
|
151
|
-
We also define the `watch` task discussed earlier. This is covered in more
|
152
|
-
detail in the main (README)[README.md].
|
153
|
-
|
154
|
-
Grunt is the engine behind `ngBoilerplate`. It's the magic that makes it move.
|
155
|
-
Just getting started, you won't need to alter `Gruntfile.js` at all, but
|
156
|
-
as you get into more advanced application development, you will probably need to
|
157
|
-
add more tasks and change some steps around to make this build your own.
|
158
|
-
Hopefully, this readme and the documentation within `Gruntfile.js` (as well as
|
159
|
-
of course the documentation at gruntjs.com) will set you on the right path.
|
160
|
-
|
161
|
-
## Bower
|
162
|
-
|
163
|
-
[Bower](bower.io) is a package manager for the web. It's similar in many
|
164
|
-
respects to NPM, though it is significantly simpler and only contains code for
|
165
|
-
web projects, like Twitter Bootstrap and its AngularJS counterpart Angular
|
166
|
-
Bootstrap. Bower allows us to say that our app depends in some way on these
|
167
|
-
other libraries so that we can manage all of them in one simple place.
|
168
|
-
|
169
|
-
`ngBoilerplate` comes with a `bower.json` file that looks something like this:
|
170
|
-
|
171
|
-
```js
|
172
|
-
{
|
173
|
-
"name": "ng-boilerplate",
|
174
|
-
"version": "0.2.0-SNAPSHOT",
|
175
|
-
"devDependencies": {
|
176
|
-
"angular": "~1.0.7",
|
177
|
-
"angular-mocks": "~1.0.7",
|
178
|
-
"bootstrap": "~2.3.2",
|
179
|
-
"angular-bootstrap": "~0.3.0",
|
180
|
-
"angular-ui-router": "~0.0.1",
|
181
|
-
"angular-ui-utils": "~0.0.3"
|
182
|
-
},
|
183
|
-
"dependencies": {}
|
184
|
-
}
|
185
|
-
```
|
186
|
-
|
187
|
-
This file is fairly self-explanatory; it gives the package name and version
|
188
|
-
(duplicated from `package.json`, but this is unavoidable) as well as a list of
|
189
|
-
dependencies our application needs in order to work. If we simply call
|
190
|
-
|
191
|
-
```sh
|
192
|
-
$ bower install
|
193
|
-
```
|
194
|
-
|
195
|
-
it will read these three dependencies and install them into the `vendor/` folder
|
196
|
-
(along with any dependencies they have) so that we can use them in our app. If
|
197
|
-
we want to add a new package like AngularUI's
|
198
|
-
[ngGrid](http://angular-ui.github.io/ng-grid/), then we can tell Bower to
|
199
|
-
install that from the web, place it into the `vendor/` folder for us to use, and
|
200
|
-
then add it as a dependency to `bower.json`:
|
201
|
-
|
202
|
-
```js
|
203
|
-
$ bower install angular-grid --save-dev
|
204
|
-
```
|
205
|
-
|
206
|
-
Bower can also update all of our packages for us at a later date, though that
|
207
|
-
and its many other awesome features are beyond the scope of this simple
|
208
|
-
overview.
|
209
|
-
|
210
|
-
One last thing to note is that packages installed with Bower are not
|
211
|
-
standardized, so we cannot automatically add them to the build process; anything
|
212
|
-
installed with Bower (or placed in the `vendor/` directory manually) *must* be
|
213
|
-
added to your `build.config.js` file manually; look for the Bower libs included
|
214
|
-
in `ngBoilerplate` by default in there to see what I mean.
|
215
|
-
|
216
|
-
## Where to Go From Here
|
217
|
-
|
218
|
-
That's it! Now that you have a basic understanding of the tools involved, read
|
219
|
-
through the [main README](README.md) to dive another level deeper and apply what
|
220
|
-
you've learned for great good. I promise it will all make sense it short order.
|
221
|
-
|
222
|
-
Happy programming!
|
223
|
-
|