Skip to content

Commit c212ef3

Browse files
author
eviratec.software
authored
Merge pull request #2 from data-studio/develop
Develop
2 parents a65974c + 4dcbf98 commit c212ef3

File tree

14 files changed

+257
-18
lines changed

14 files changed

+257
-18
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@
66

77
## Getting started
88

9-
1. Install [Vagrant](https://www.vagrantup.com/) by [HashiCorp](https://www.hashicorp.com/)
10-
2. Clone/checkout/download this repository: `$ git clone https://github.com/data-studio/angular-app.git && cd angular-app`
11-
3. Start the development VM using [Vagrant](https://www.vagrantup.com/): `$ vagrant up`
12-
4. Add an entry for `ng.data-studio.localhost` in your `hosts` file: `$ echo "192.168.110.30 ng.data-studio.localhost" >> /etc/hosts`
13-
5. Direct your browser to `http://ng.data-studio.localhost`
9+
1. Clone this repository
10+
```shell
11+
$ git clone https://github.com/data-studio/angular-app.git && cd angular-app
12+
```
13+
2. Install [Vagrant](https://www.vagrantup.com/) by [HashiCorp](https://www.hashicorp.com/)
14+
3. Start the Vagrant development VM
15+
```shell
16+
$ vagrant up
17+
```
18+
4. Add an entry for `ng.data-studio.localhost` to your `hosts` file
19+
```shell
20+
$ echo "192.168.110.30 ng.data-studio.localhost" >> /etc/hosts
21+
```
22+
5. Direct your browser to [http://ng.data-studio.localhost](http://ng.data-studio.localhost)
1423

1524
## License
1625

26+
By [Eviratec Software](https://www.eviratec.com.au)
27+
1728
```
1829
Copyright (c) 2017 Callan Peter Milne
1930

Vagrantfile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,32 @@ Vagrant.configure("2") do |config|
7171
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
7272
# documentation for more information about their specific syntax and use.
7373
config.vm.provision "shell", inline: <<-SHELL
74+
75+
echo "=== INSTALLING NODE/NPM ==="
76+
wget https://nodejs.org/dist/v7.10.0/node-v7.10.0-linux-x64.tar.xz -o wget.txt
77+
tar -xf node-v7.10.0-linux-x64.tar.xz
78+
mv node-v7.10.0-linux-x64 /usr/local/lib/node && cd $_
79+
chmod 777 bin/*
80+
ln -s /usr/local/lib/node/bin/* /usr/local/bin/
81+
82+
echo "=== INSTALLING UPDATES ==="
7483
apt-get update
7584
apt-get install --assume-yes nginx curl
85+
86+
echo "====== NGINX SET-UP ======"
7687
cp /vagrant/etc/nginx/dev-server /etc/nginx/sites-available/angular-app
7788
ln -s /etc/nginx/sites-available/angular-app /etc/nginx/sites-enabled/angular-app
7889
rm /etc/nginx/sites-enabled/default
7990
service nginx restart
80-
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | NVM_DIR=/usr/local/nvm bash
81-
export NVM_DIR="$HOME/.nvm"
82-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
83-
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
84-
nvm install v7.8.0
91+
92+
echo "=== RESOLVING NPM DEPS ==="
8593
cd /vagrant
8694
npm install
8795
npm ln -s
88-
ds-build-app
96+
97+
echo "== STARTING DEV SERVER =="
98+
nohup /usr/local/lib/node/bin/ds-dev-server &
99+
100+
cd ~
89101
SHELL
90102
end

bin/start-dev-server

100644100755
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Data Studio
4+
* Copyright (c) 2017 Callan Peter Milne
5+
*
6+
* Permission to use, copy, modify, and/or distribute this software for any
7+
* purpose with or without fee is hereby granted, provided that the above
8+
* copyright notice and this permission notice appear in all copies.
9+
*
10+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15+
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
* PERFORMANCE OF THIS SOFTWARE.
17+
*/
18+
'use strict';
19+
20+
require('../src/ops/process.js')('build');
21+
require('../src/ops/process.js')('watch-dev');

etc/nginx/dev-server

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
server {
22

3-
listen localhost:8080;
4-
listen 0.0.0.0:80;
3+
listen 80;
4+
server_name ng.data-studio.localhost;
55

66
root /vagrant/build;
77
index app.html;
88

9+
sendfile off;
10+
server_tokens off;
11+
12+
location app.js {
13+
sendfile on;
14+
try_files $uri /app.js;
15+
}
16+
17+
location app.css {
18+
sendfile on;
19+
try_files $uri /app.css;
20+
}
21+
922
location / {
10-
try_files $uri /app.html;
23+
try_files $uri /app.html$uri /app.html;
1124
}
1225

1326
}

gulpfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const TASKS = [
2727
'unit',
2828
'csscompile',
2929
'jscompile',
30+
'watch-dev',
3031
];
3132

3233
/**

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"description": "Data Studio Angular App",
55
"main": "index.js",
66
"scripts": {
7-
"test": "./bin/unit"
7+
"test": "./bin/unit",
8+
"prestart": "./bin/build",
9+
"start": "./bin/start-dev-server"
810
},
911
"bin": {
1012
"ds-build-app": "./bin/build",
11-
"ds-prepare-dist": "./bin/dist"
13+
"ds-prepare-dist": "./bin/dist",
14+
"ds-dev-server": "./bin/start-dev-server"
1215
},
1316
"author": "Callan Peter Milne <[email protected]>",
1417
"license": "ISC",
@@ -18,12 +21,15 @@
1821
"angular-animate": "1.6.4",
1922
"angular-aria": "1.6.4",
2023
"angular-cookies": "1.6.4",
24+
"angular-environment-config": "1.0.0",
2125
"angular-material": "1.1.4",
26+
"angular-messages": "1.6.4",
2227
"angular-mocks": "1.6.4",
2328
"babel": "6.23.0",
2429
"babel-polyfill": "6.23.0",
2530
"babel-preset-env": "1.5.1",
2631
"gulp": "3.9.1",
32+
"gulp-angular-templatecache": "2.0.0",
2733
"gulp-babel": "6.1.2",
2834
"gulp-concat": "2.6.1",
2935
"gulp-sass": "3.1.0",

src/app/modules/app/appController.es

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
angular.module('angularApp')
3+
.controller('AppController', AppController);
4+
5+
AppController.$inject = ['$scope'];
6+
function AppController ( $scope) {
7+
8+
this.test = 'Meow';
9+
10+
};

src/app/modules/app/html/app.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>{{ $app.test }}</h1>
2+
<p>A fewmany fabric</p>

src/app/modules/app/module.es

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
angular.module('angularApp', [
3+
'ngAnimate',
4+
'ngAria',
5+
'ngCookies',
6+
'ngMaterial',
7+
'ngMessages',
8+
'ui.router',
9+
'luminous.environment',
10+
]);

src/app/modules/app/routes.es

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
angular.module('angularApp')
3+
.config(['$stateProvider', function ($stateProvider) {
4+
5+
$stateProvider
6+
7+
.state('app', {
8+
url: '^',
9+
templateUrl: 'modules/app/html/app.html',
10+
controller: 'AppController',
11+
controllerAs: '$app',
12+
});
13+
14+
}]);

0 commit comments

Comments
 (0)