diff --git a/web/.bowerrc b/web/.bowerrc new file mode 100644 index 00000000..8c58c8ef --- /dev/null +++ b/web/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "app/bower_components" +} \ No newline at end of file diff --git a/web/.gitignore b/web/.gitignore new file mode 100644 index 00000000..b702acc6 --- /dev/null +++ b/web/.gitignore @@ -0,0 +1,7 @@ +logs/* +!.gitkeep +node_modules/ +bower_components/ +tmp +.DS_Store +.idea \ No newline at end of file diff --git a/web/.jshintrc b/web/.jshintrc new file mode 100644 index 00000000..60f49fd3 --- /dev/null +++ b/web/.jshintrc @@ -0,0 +1,24 @@ +{ + "strict": "global", + "globals": { + // Angular + "angular": false, + + // Angular mocks + "module": false, + "inject": false, + + // Jasmine + "jasmine": false, + "describe": false, + "beforeEach": false, + "afterEach": false, + "it": false, + "expect": false, + + // Protractor + "browser": false, + "element": false, + "by": false + } +} diff --git a/web/.travis.yml b/web/.travis.yml new file mode 100644 index 00000000..a549d113 --- /dev/null +++ b/web/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +node_js: + - '4.4' + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - npm start > /dev/null & + - npm run update-webdriver + - sleep 1 # give server time to start + +script: + - node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox + - node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox diff --git a/web/LICENSE b/web/LICENSE new file mode 100644 index 00000000..b8de5aae --- /dev/null +++ b/web/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2010-2016 Google, Inc. http://angularjs.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/web/README.md b/web/README.md new file mode 100644 index 00000000..aa5ae109 --- /dev/null +++ b/web/README.md @@ -0,0 +1,24 @@ +### Prerequisites + +You need git to clone the angular-seed repository. You can get git from +[http://git-scm.com/](http://git-scm.com/). + +We also use a number of node.js tools to initialize and test angular-seed. You must have node.js and +its package manager (npm) installed. You can get them from [http://nodejs.org/](http://nodejs.org/). +### Install Dependencies + +``` +npm install +``` + + +### Run the Application + +The simplest way to start this server is: + +``` +npm start +``` + +Now browse to the app at `http://localhost/`. + diff --git a/web/app/app.css b/web/app/app.css new file mode 100644 index 00000000..c9252407 --- /dev/null +++ b/web/app/app.css @@ -0,0 +1,30 @@ +/* app css stylesheet */ + +.menu { + list-style: none; + border-bottom: 0.1em solid black; + margin-bottom: 2em; + padding: 0 0 0.5em; +} + +.menu:before { + content: "["; +} + +.menu:after { + content: "]"; +} + +.menu > li { + display: inline; +} + +.menu > li:before { + content: "|"; + padding-right: 0.3em; +} + +.menu > li:nth-child(1):before { + content: ""; + padding: 0; +} diff --git a/web/glorious-web/app.js b/web/app/app.js similarity index 65% rename from web/glorious-web/app.js rename to web/app/app.js index 55c994ec..fcbf7640 100644 --- a/web/glorious-web/app.js +++ b/web/app/app.js @@ -1,12 +1,14 @@ 'use strict'; // Declare app level module which depends on views, and components -angular.module('gocryptoweb', [ +angular.module('myApp', [ 'ngRoute', - 'gocryptoweb.controllers' + 'myApp.home', + 'myApp.about', + 'myApp.version' ]). config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { $locationProvider.hashPrefix('!'); - $routeProvider.otherwise({redirectTo: '/view1'}); + $routeProvider.otherwise({redirectTo: '/'}); }]); diff --git a/web/app/components/version/interpolate-filter.js b/web/app/components/version/interpolate-filter.js new file mode 100644 index 00000000..03bb1987 --- /dev/null +++ b/web/app/components/version/interpolate-filter.js @@ -0,0 +1,9 @@ +'use strict'; + +angular.module('myApp.version.interpolate-filter', []) + +.filter('interpolate', ['version', function(version) { + return function(text) { + return String(text).replace(/\%VERSION\%/mg, version); + }; +}]); diff --git a/web/app/components/version/interpolate-filter_test.js b/web/app/components/version/interpolate-filter_test.js new file mode 100644 index 00000000..ff56c529 --- /dev/null +++ b/web/app/components/version/interpolate-filter_test.js @@ -0,0 +1,15 @@ +'use strict'; + +describe('myApp.version module', function() { + beforeEach(module('myApp.version')); + + describe('interpolate filter', function() { + beforeEach(module(function($provide) { + $provide.value('version', 'TEST_VER'); + })); + + it('should replace VERSION', inject(function(interpolateFilter) { + expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after'); + })); + }); +}); diff --git a/web/app/components/version/version-directive.js b/web/app/components/version/version-directive.js new file mode 100644 index 00000000..74088f8a --- /dev/null +++ b/web/app/components/version/version-directive.js @@ -0,0 +1,9 @@ +'use strict'; + +angular.module('myApp.version.version-directive', []) + +.directive('appVersion', ['version', function(version) { + return function(scope, elm, attrs) { + elm.text(version); + }; +}]); diff --git a/web/app/components/version/version-directive_test.js b/web/app/components/version/version-directive_test.js new file mode 100644 index 00000000..4a59e119 --- /dev/null +++ b/web/app/components/version/version-directive_test.js @@ -0,0 +1,17 @@ +'use strict'; + +describe('myApp.version module', function() { + beforeEach(module('myApp.version')); + + describe('app-version directive', function() { + it('should print current version', function() { + module(function($provide) { + $provide.value('version', 'TEST_VER'); + }); + inject(function($compile, $rootScope) { + var element = $compile('')($rootScope); + expect(element.text()).toEqual('TEST_VER'); + }); + }); + }); +}); diff --git a/web/app/components/version/version.js b/web/app/components/version/version.js new file mode 100644 index 00000000..cb7a10f9 --- /dev/null +++ b/web/app/components/version/version.js @@ -0,0 +1,8 @@ +'use strict'; + +angular.module('myApp.version', [ + 'myApp.version.interpolate-filter', + 'myApp.version.version-directive' +]) + +.value('version', '0.1'); diff --git a/web/app/components/version/version_test.js b/web/app/components/version/version_test.js new file mode 100644 index 00000000..4ca6880d --- /dev/null +++ b/web/app/components/version/version_test.js @@ -0,0 +1,11 @@ +'use strict'; + +describe('myApp.version module', function() { + beforeEach(module('myApp.version')); + + describe('version service', function() { + it('should return current version', inject(function(version) { + expect(version).toEqual('0.1'); + })); + }); +}); diff --git a/web/app/index-async.html b/web/app/index-async.html new file mode 100644 index 00000000..39a592fb --- /dev/null +++ b/web/app/index-async.html @@ -0,0 +1,58 @@ + + + + + + + + + + My AngularJS App + + + + + +
+ +
Angular seed app: v
+ + + diff --git a/web/app/index.html b/web/app/index.html new file mode 100644 index 00000000..66d52107 --- /dev/null +++ b/web/app/index.html @@ -0,0 +1,63 @@ + + + + + + + + + GoCrpto Trader + + + + + + + + + + + + + + + + + +
+ + +

Copyright 2016 GoCrypto Trader

+ + + + + + + + + + + diff --git a/web/glorious-web/views/pages/about.ejs b/web/app/views/about/about.html similarity index 95% rename from web/glorious-web/views/pages/about.ejs rename to web/app/views/about/about.html index 9a156802..d5c01f4c 100644 --- a/web/glorious-web/views/pages/about.ejs +++ b/web/app/views/about/about.html @@ -1,18 +1,4 @@ - - - - - - <% include ../partials/head %> - - - -
- <% include ../partials/header %> -
- -
-
+
@@ -190,11 +176,4 @@ Run the application!

-
- - - - - \ No newline at end of file + \ No newline at end of file diff --git a/web/app/views/about/about.js b/web/app/views/about/about.js new file mode 100644 index 00000000..88de9479 --- /dev/null +++ b/web/app/views/about/about.js @@ -0,0 +1,14 @@ +'use strict'; + +angular.module('myApp.about', ['ngRoute']) + +.config(['$routeProvider', function($routeProvider) { + $routeProvider.when('/about', { + templateUrl: '/views/about/about.html', + controller: 'AboutController' + }); +}]) + +.controller('AboutController', [function() { + +}]); \ No newline at end of file diff --git a/web/app/views/about/about_test.js b/web/app/views/about/about_test.js new file mode 100644 index 00000000..07b34d6b --- /dev/null +++ b/web/app/views/about/about_test.js @@ -0,0 +1,16 @@ +'use strict'; + +describe('myApp.view2 module', function() { + + beforeEach(module('myApp.view2')); + + describe('view2 controller', function(){ + + it('should ....', inject(function($controller) { + //spec body + var view2Ctrl = $controller('View2Ctrl'); + expect(view2Ctrl).toBeDefined(); + })); + + }); +}); \ No newline at end of file diff --git a/web/app/views/home/home.html b/web/app/views/home/home.html new file mode 100644 index 00000000..0eddc317 --- /dev/null +++ b/web/app/views/home/home.html @@ -0,0 +1,28 @@ +

Dashboard

+

All enabled currencies

+
+

{{exchange.exchangeName}}

+ + + + + + + + + + + + + + + + + + + +
CurrencyLastHighLowVolumeBidAsk
{{value.CryptoCurrency}}{{value.Last}}{{value.High}}{{value.Low}}{{value.Volume}}{{value.Bid}}{{value.Ask}}
+
+ +
+
\ No newline at end of file diff --git a/web/app/views/home/home.js b/web/app/views/home/home.js new file mode 100644 index 00000000..d2412903 --- /dev/null +++ b/web/app/views/home/home.js @@ -0,0 +1,28 @@ +'use strict'; + +angular.module('myApp.home', ['ngRoute']) + +.config(['$routeProvider', function($routeProvider) { + $routeProvider.when('/', { + templateUrl: '/views/home/home.html', + controller: 'HomeController' + }); +}]) + +.controller('HomeController', function ($scope, $http) { + $scope.getDashboardData = function() { + $http({ + method: 'GET', + url: '/data/all-enabled-currencies' + }). + success(function (data, status, headers, config) { + $scope.exchanges = data.data; + }). + error(function (data, status, headers, config) { + console.log('error'); + }); + }; + + $scope.getDashboardData(); + +}); \ No newline at end of file diff --git a/web/app/views/home/home_test.js b/web/app/views/home/home_test.js new file mode 100644 index 00000000..14ba79b4 --- /dev/null +++ b/web/app/views/home/home_test.js @@ -0,0 +1,16 @@ +'use strict'; + +describe('myApp.view1 module', function() { + + beforeEach(module('myApp.view1')); + + describe('view1 controller', function(){ + + it('should ....', inject(function($controller) { + //spec body + var view1Ctrl = $controller('View1Ctrl'); + expect(view1Ctrl).toBeDefined(); + })); + + }); +}); \ No newline at end of file diff --git a/web/bower.json b/web/bower.json new file mode 100644 index 00000000..66d9d74e --- /dev/null +++ b/web/bower.json @@ -0,0 +1,15 @@ +{ + "name": "angular-seed", + "description": "A starter project for AngularJS", + "version": "0.0.0", + "homepage": "https://github.com/angular/angular-seed", + "license": "MIT", + "private": true, + "dependencies": { + "angular": "~1.5.0", + "angular-route": "~1.5.0", + "angular-loader": "~1.5.0", + "angular-mocks": "~1.5.0", + "html5-boilerplate": "^5.3.0" + } +} diff --git a/web/dashboard-contact.html b/web/dashboard-contact.html deleted file mode 100644 index c66f754a..00000000 --- a/web/dashboard-contact.html +++ /dev/null @@ -1,49 +0,0 @@ -{{template "header" .}} - - -
-
- -
-

Contact Us

- -

Contact us @ https://github.com/thrasher-/gocryptotrader

-
-

- -

-
-
-
-
-{{template "footer" .}} diff --git a/web/dashboard-marketdepth.html b/web/dashboard-marketdepth.html deleted file mode 100644 index 9171689b..00000000 --- a/web/dashboard-marketdepth.html +++ /dev/null @@ -1,89 +0,0 @@ -{{template "header" .}} - - -
-
- -
-

Current Market Depth & Analysis

- -
-
- Generic placeholder thumbnail -

Asset Allocation Pie Graph

- Currencies owned and tracked. -
-
- Generic placeholder thumbnail -

Profit/Loss/Initial Pie Graph

- Current portfolio health. -
-
- Generic placeholder thumbnail -

Exchanges Pie Graph

- Based on current daily volume and analysis. -
-
- Generic placeholder thumbnail -

Market Capitalisation Pie Graph

- In USD terms per deemed weighted currencies. -
-
- -

Tickers table

-
- - - - - - - - - - - - - - - - - - - -
ExchangeLAST - BTC/USDLAST - LTC/USDLAST - BTC/LTC
SOMETHING HERESOMETHING HERESOMETHING HERESOMETHING HERESOMETHING HERE
-
-
-
-
-{{template "footer" .}} diff --git a/web/dashboard-ordermanagement.html b/web/dashboard-ordermanagement.html deleted file mode 100644 index 66113ce1..00000000 --- a/web/dashboard-ordermanagement.html +++ /dev/null @@ -1,70 +0,0 @@ -{{template "header" .}} - - -
-
- -
-

Order Management

- -

-

Order Management Tools Go Here.

-

- -

Prior Trades

-
- - - - - - - - - - - - - - - - - - - -
DATE/TIMEEXCHANGECURRENCIES USEDPROFIT LOSS
SOMETHING HERESOMETHING HERESOMETHING HERESOMETHING HERESOMETHING HERE
-
-
-
-
-{{template "footer" .}} diff --git a/web/dashboard-reports.html b/web/dashboard-reports.html deleted file mode 100644 index ff1fe934..00000000 --- a/web/dashboard-reports.html +++ /dev/null @@ -1,89 +0,0 @@ -{{template "header" .}} - - -
-
- -
-

Reports

- -
-
- Generic placeholder thumbnail -

Asset Allocation Pie Graph

- Currencies owned and tracked. -
-
- Generic placeholder thumbnail -

Profit/Loss/Initial Pie Graph

- Current portfolio health. -
-
- Generic placeholder thumbnail -

Exchanges Pie Graph

- Based on current daily volume and analysis. -
-
- Generic placeholder thumbnail -

Market Capitalisation Pie Graph

- In USD terms per deemed weighted currencies. -
-
- -

Running Report. Subdivided in monthly/yearly/quarter

-
- - - - - - - - - - - - - - - - - - - -
Trade Execution dateTrade ExchangeTrade TypeInitial InvestmentPROFIT/LOSS
SOMETHING HERESOMETHING HERESOMETHING HERESOMETHING HERESOMETHING HERE
-
-
-
-
-{{template "footer" .}} diff --git a/web/dashboard-settings.html b/web/dashboard-settings.html deleted file mode 100644 index e0d8b562..00000000 --- a/web/dashboard-settings.html +++ /dev/null @@ -1,44 +0,0 @@ -{{template "header" .}} - - -
-
- -
-

Settings

- -

Settings Table

-
-
-
-{{template "footer" .}} diff --git a/web/e2e-tests/protractor.conf.js b/web/e2e-tests/protractor.conf.js new file mode 100644 index 00000000..13c5cb62 --- /dev/null +++ b/web/e2e-tests/protractor.conf.js @@ -0,0 +1,22 @@ +//jshint strict: false +exports.config = { + + allScriptsTimeout: 11000, + + specs: [ + '*.js' + ], + + capabilities: { + 'browserName': 'chrome' + }, + + baseUrl: 'http://localhost:8000/', + + framework: 'jasmine', + + jasmineNodeOpts: { + defaultTimeoutInterval: 30000 + } + +}; diff --git a/web/e2e-tests/scenarios.js b/web/e2e-tests/scenarios.js new file mode 100644 index 00000000..240d5f61 --- /dev/null +++ b/web/e2e-tests/scenarios.js @@ -0,0 +1,42 @@ +'use strict'; + +/* https://github.com/angular/protractor/blob/master/docs/toc.md */ + +describe('my app', function() { + + + it('should automatically redirect to /view1 when location hash/fragment is empty', function() { + browser.get('index.html'); + expect(browser.getLocationAbsUrl()).toMatch("/view1"); + }); + + + describe('view1', function() { + + beforeEach(function() { + browser.get('index.html#!/view1'); + }); + + + it('should render view1 when user navigates to /view1', function() { + expect(element.all(by.css('[ng-view] p')).first().getText()). + toMatch(/partial for view 1/); + }); + + }); + + + describe('view2', function() { + + beforeEach(function() { + browser.get('index.html#!/view2'); + }); + + + it('should render view2 when user navigates to /view2', function() { + expect(element.all(by.css('[ng-view] p')).first().getText()). + toMatch(/partial for view 2/); + }); + + }); +}); diff --git a/web/error.html b/web/error.html deleted file mode 100644 index 3a89b218..00000000 --- a/web/error.html +++ /dev/null @@ -1,37 +0,0 @@ -{{template "header" .}} - -
- -
- -
- -
-
- -
-
- -
-

ERROR

-

The error {{.Error}} has occured.

-

- -

-
- -
-
-
-
- -
- -
- -
- -{{template "footer" .}} diff --git a/web/favicon.ico b/web/favicon.ico deleted file mode 100644 index 2216206f..00000000 Binary files a/web/favicon.ico and /dev/null differ diff --git a/web/footer.html b/web/footer.html deleted file mode 100644 index 37bdaade..00000000 --- a/web/footer.html +++ /dev/null @@ -1,4 +0,0 @@ -{{define "footer"}} - - -{{end}} \ No newline at end of file diff --git a/web/glorious-web/Server.js b/web/glorious-web/Server.js deleted file mode 100644 index f72cf164..00000000 --- a/web/glorious-web/Server.js +++ /dev/null @@ -1,39 +0,0 @@ -var express = require('express'); -var routes = require('./routes'); -var app = express(); - -// set the view engine to ejs -app.set('view engine', 'ejs'); - -// use res.render to load up an ejs view file - -// index page -app.get('/', function(req, res) { - res.render('pages/index', { - }); -}); - -// setting page -app.get('/settings', function(req, res) { - res.render('pages/settings', { - }); -}); - -// about page -app.get('/about', function(req, res) { - res.render('pages/about'); -}); - - -app.get('/data/all-enabled-currencies', function (req, res) { - request({ - url :'http://localhost:9050/exchanges/enabled/latest/all' - },function(err, resp, body){ - res.send(body); - }) - -}); - -app.listen(80, function(){ - console.log('CORS-enabled web server listening on port 80'); -}); \ No newline at end of file diff --git a/web/glorious-web/controllers.js b/web/glorious-web/controllers.js deleted file mode 100644 index ea84afdc..00000000 --- a/web/glorious-web/controllers.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -/* Controllers */ - -angular.module('gocryptoweb.controllers', []). - controller('HomeController', function ($scope, $http) { - $scope.working = true; - $http({ - method: 'GET', - url: '/data/all-enabled-currencies' - }). - success(function (data, status, headers, config) { - $scope.exchanges = data.data.exchanges; - }). - error(function (data, status, headers, config) { - console.log('error'); - }); - - }). - controller('MyCtrl1', function ($scope) { - // write Ctrl here - - }); diff --git a/web/glorious-web/index.js b/web/glorious-web/index.js deleted file mode 100644 index 218da370..00000000 --- a/web/glorious-web/index.js +++ /dev/null @@ -1,9 +0,0 @@ - -exports.index = function(req, res){ - res.render('index'); -}; - -exports.partials = function (req, res) { - var name = req.params.name; - res.render('partials/' + name); -}; \ No newline at end of file diff --git a/web/glorious-web/package.json b/web/glorious-web/package.json deleted file mode 100644 index 6ed86901..00000000 --- a/web/glorious-web/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name" : "gocryptotrader-website", - "version" : "0.0.1", - "scripts" : { - "start" : "node Server.js" - }, - "dependencies" : { - "express" : "latest", - "ejs":"latest" - } -} diff --git a/web/glorious-web/routes/index.js b/web/glorious-web/routes/index.js deleted file mode 100644 index c2d652f5..00000000 --- a/web/glorious-web/routes/index.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.index = function(req, res){ - res.render('layout'); -}; \ No newline at end of file diff --git a/web/glorious-web/views/pages/index.ejs b/web/glorious-web/views/pages/index.ejs deleted file mode 100644 index ff23f2f1..00000000 --- a/web/glorious-web/views/pages/index.ejs +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <% include ../partials/head %> - - - -
- <% include ../partials/header %> -
- -
-
- - {{working}} -
-
- - - - - \ No newline at end of file diff --git a/web/glorious-web/views/pages/settings.ejs b/web/glorious-web/views/pages/settings.ejs deleted file mode 100644 index 582d5c3a..00000000 --- a/web/glorious-web/views/pages/settings.ejs +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - <% include ../partials/head %> - - - -
- <% include ../partials/header %> -
- -
-
-

Settings

-

This will be a visiual interface to edit the config file

-

Things like enabling exchanges, currencies and setting excahnge account settings

-
-
- - - - - \ No newline at end of file diff --git a/web/glorious-web/views/partials/footer.ejs b/web/glorious-web/views/partials/footer.ejs deleted file mode 100644 index 55675996..00000000 --- a/web/glorious-web/views/partials/footer.ejs +++ /dev/null @@ -1,3 +0,0 @@ - - -

Copyright 2016 GoCrypto Trader

\ No newline at end of file diff --git a/web/glorious-web/views/partials/head.ejs b/web/glorious-web/views/partials/head.ejs deleted file mode 100644 index 00ba9698..00000000 --- a/web/glorious-web/views/partials/head.ejs +++ /dev/null @@ -1,11 +0,0 @@ - - - -GoCrpto Trader - - - - - - - \ No newline at end of file diff --git a/web/glorious-web/views/partials/header.ejs b/web/glorious-web/views/partials/header.ejs deleted file mode 100644 index ce5d59b8..00000000 --- a/web/glorious-web/views/partials/header.ejs +++ /dev/null @@ -1,21 +0,0 @@ - - - \ No newline at end of file diff --git a/web/header.html b/web/header.html deleted file mode 100644 index 18cf5c47..00000000 --- a/web/header.html +++ /dev/null @@ -1,19 +0,0 @@ -{{define "header"}} - - - - - {{.Title}} - - - - - - - - {{.StaticStylesheet}} - - - - -{{end}} diff --git a/web/index.html b/web/index.html deleted file mode 100644 index f58206dc..00000000 --- a/web/index.html +++ /dev/null @@ -1,37 +0,0 @@ -{{template "header" .}} - -
- -
- -
- -
-
- -
-
- -
-

Template Trading Platform v0.0

-

Login Test

-

- Login Test Page -

-
- -
-
-
-
- -
- -
- -
- -{{template "footer" .}} diff --git a/web/karma.conf.js b/web/karma.conf.js new file mode 100644 index 00000000..7271e9fe --- /dev/null +++ b/web/karma.conf.js @@ -0,0 +1,34 @@ +//jshint strict: false +module.exports = function(config) { + config.set({ + + basePath: './app', + + files: [ + 'bower_components/angular/angular.js', + 'bower_components/angular-route/angular-route.js', + 'bower_components/angular-mocks/angular-mocks.js', + 'components/**/*.js', + 'view*/**/*.js' + ], + + autoWatch: true, + + frameworks: ['jasmine'], + + browsers: ['Chrome'], + + plugins: [ + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-jasmine', + 'karma-junit-reporter' + ], + + junitReporter: { + outputFile: 'test_out/unit.xml', + suite: 'unit' + } + + }); +}; diff --git a/web/login.html b/web/login.html deleted file mode 100644 index 699df545..00000000 --- a/web/login.html +++ /dev/null @@ -1,6 +0,0 @@ -{{template "header" .}} -

- This is the login page.... -

-goto dashboard -{{template "footer" .}} diff --git a/web/package.json b/web/package.json new file mode 100644 index 00000000..883369d4 --- /dev/null +++ b/web/package.json @@ -0,0 +1,38 @@ +{ + "name": "angular-seed", + "private": true, + "version": "0.0.0", + "description": "A starter project for AngularJS", + "repository": "https://github.com/angular/angular-seed", + "license": "MIT", + "devDependencies": { + "bower": "^1.7.7", + "http-server": "^0.9.0", + "jasmine-core": "^2.4.1", + "karma": "^0.13.22", + "karma-chrome-launcher": "^0.2.3", + "karma-firefox-launcher": "^0.1.7", + "karma-jasmine": "^0.3.8", + "karma-junit-reporter": "^0.4.1", + "protractor": "^3.2.2", + "express" : "latest" + }, + "scripts": { + "postinstall": "bower install", + + "prestart": "npm install", + "start": "node server.js", + + "pretest": "npm install", + "test": "karma start karma.conf.js", + "test-single-run": "karma start karma.conf.js --single-run", + + "preupdate-webdriver": "npm install", + "update-webdriver": "webdriver-manager update", + + "preprotractor": "npm run update-webdriver", + "protractor": "protractor e2e-tests/protractor.conf.js", + + "update-index-async": "node -e \"var fs=require('fs'),indexFile='app/index-async.html',loaderFile='app/bower_components/angular-loader/angular-loader.min.js',loaderText=fs.readFileSync(loaderFile,'utf-8').split(/sourceMappingURL=angular-loader.min.js.map/).join('sourceMappingURL=bower_components/angular-loader/angular-loader.min.js.map'),indexText=fs.readFileSync(indexFile,'utf-8').split(/\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/).join('//@@NG_LOADER_START@@\\n'+loaderText+' //@@NG_LOADER_END@@');fs.writeFileSync(indexFile,indexText);\"" + } +} diff --git a/web/server.js b/web/server.js new file mode 100644 index 00000000..7f2bf597 --- /dev/null +++ b/web/server.js @@ -0,0 +1,27 @@ +var express = require('express') + , app = express(); +var request = require('request'); +var path = __dirname + '/app/'; + +app.use("/bower_components", express.static(path + '/bower_components')); + +app.get("/",function(req,res){ + res.sendFile(path + "index.html"); +}); + +app.use("/", express.static(path + '/')); + +app.get('/data/all-enabled-currencies', function (req, res) { + request({ + url :'http://localhost:9050/exchanges/enabled/latest/all' + },function(err, resp, body){ + res.send(body); + }) + +}); + + + +app.listen(80, function(){ + console.log('CORS-enabled web server listening on port 80'); +}); \ No newline at end of file diff --git a/web/static/css/cover.css b/web/static/css/cover.css deleted file mode 100644 index f4d789e9..00000000 --- a/web/static/css/cover.css +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Globals - */ - -/* Links */ -a, -a:focus, -a:hover { - color: #fff; -} - -/* Custom default button */ -.btn-default, -.btn-default:hover, -.btn-default:focus { - color: #333; - text-shadow: none; /* Prevent inheritence from `body` */ - background-color: #fff; - border: 1px solid #fff; -} - - -/* - * Base structure - */ - -html, -body { - height: 100%; - background-color: #333; -} -body { - color: #fff; - text-align: center; - text-shadow: 0 1px 3px rgba(0,0,0,.5); -} - -/* Extra markup and styles for table-esque vertical and horizontal centering */ -.site-wrapper { - display: table; - width: 100%; - height: 100%; /* For at least Firefox */ - min-height: 100%; - -webkit-box-shadow: inset 0 0 100px rgba(0,0,0,.5); - box-shadow: inset 0 0 100px rgba(0,0,0,.5); -} -.site-wrapper-inner { - display: table-cell; - vertical-align: top; -} -.cover-container { - margin-right: auto; - margin-left: auto; -} - -/* Padding for spacing */ -.inner { - padding: 30px; -} - - -/* - * Header - */ -.masthead-brand { - margin-top: 10px; - margin-bottom: 10px; -} - -.masthead-nav > li { - display: inline-block; -} -.masthead-nav > li + li { - margin-left: 20px; -} -.masthead-nav > li > a { - padding-right: 0; - padding-left: 0; - font-size: 16px; - font-weight: bold; - color: #fff; /* IE8 proofing */ - color: rgba(255,255,255,.75); - border-bottom: 2px solid transparent; -} -.masthead-nav > li > a:hover, -.masthead-nav > li > a:focus { - background-color: transparent; - border-bottom-color: #a9a9a9; - border-bottom-color: rgba(255,255,255,.25); -} -.masthead-nav > .active > a, -.masthead-nav > .active > a:hover, -.masthead-nav > .active > a:focus { - color: #fff; - border-bottom-color: #fff; -} - -@media (min-width: 768px) { - .masthead-brand { - float: left; - } - .masthead-nav { - float: right; - } -} - - -/* - * Cover - */ - -.cover { - padding: 0 20px; -} -.cover .btn-lg { - padding: 10px 20px; - font-weight: bold; -} - - -/* - * Footer - */ - -.mastfoot { - color: #999; /* IE8 proofing */ - color: rgba(255,255,255,.5); -} - - -/* - * Affix and center - */ - -@media (min-width: 768px) { - /* Pull out the header and footer */ - .masthead { - position: fixed; - top: 0; - } - .mastfoot { - position: fixed; - bottom: 0; - } - /* Start the vertical centering */ - .site-wrapper-inner { - vertical-align: middle; - } - /* Handle the widths */ - .masthead, - .mastfoot, - .cover-container { - width: 100%; /* Must be percentage or pixels for horizontal alignment */ - } -} - -@media (min-width: 992px) { - .masthead, - .mastfoot, - .cover-container { - width: 700px; - } -} \ No newline at end of file diff --git a/web/static/css/dashboard.css b/web/static/css/dashboard.css deleted file mode 100644 index de315748..00000000 --- a/web/static/css/dashboard.css +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Base structure - */ - -/* Move down content because we have a fixed navbar that is 50px tall */ -body { - padding-top: 50px; -} - - -/* - * Global add-ons - */ - -.sub-header { - padding-bottom: 10px; - border-bottom: 1px solid #eee; -} - -/* - * Top navigation - * Hide default border to remove 1px line. - */ -.navbar-fixed-top { - border: 0; -} - -/* - * Sidebar - */ - -/* Hide for mobile, show later */ -.sidebar { - display: none; -} -@media (min-width: 768px) { - .sidebar { - position: fixed; - top: 51px; - bottom: 0; - left: 0; - z-index: 1000; - display: block; - padding: 20px; - overflow-x: hidden; - overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ - background-color: #f5f5f5; - border-right: 1px solid #eee; - } -} - -/* Sidebar navigation */ -.nav-sidebar { - margin-right: -21px; /* 20px padding + 1px border */ - margin-bottom: 20px; - margin-left: -20px; -} -.nav-sidebar > li > a { - padding-right: 20px; - padding-left: 20px; -} -.nav-sidebar > .active > a, -.nav-sidebar > .active > a:hover, -.nav-sidebar > .active > a:focus { - color: #fff; - background-color: #428bca; -} - - -/* - * Main content - */ - -.main { - padding: 20px; -} -@media (min-width: 768px) { - .main { - padding-right: 40px; - padding-left: 40px; - } -} -.main .page-header { - margin-top: 0; -} - - -/* - * Placeholder dashboard ideas - */ - -.placeholders { - margin-bottom: 30px; - text-align: center; -} -.placeholders h4 { - margin-bottom: 0; -} -.placeholder { - margin-bottom: 20px; -} -.placeholder img { - display: inline-block; - border-radius: 50%; -} \ No newline at end of file