Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial setup #1

Merged
merged 2 commits into from Jun 24, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
@@ -0,0 +1 @@
# Add files here to ignore them from prettier formatting
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"singleQuote": true
}
@@ -0,0 +1,21 @@
# LaaS.sh

LaaS is Lightning As A Service - use it as a self-hosted starting point for your own project or as a paid API. Includes a simple app where users can Receive and Send Bitcoin, built step by step in a series of online tutorials. Visit our website at https://laas.sh

This project is built using modern Open Source enterprise grade development tools:
- [Nx](https://nx.dev)
- [Angular](https://angular.io)
- [PostgreSQL](https://www.postgresql.org)
- [Docker](https://www.docker.com)
- [socket.io](https://socket.io)
- TODO: finalize this list

## STEP-BY-STEP TUTORIALS

You can see the final product at https://laas.sh, the source code is found at https://github.com/laas-sh/laas. The app is built in a series of steps, each step featuring a tutorial and a working build:

1. Nx, static pages, SSR

## MISCELLANEOUS

Files in `apps/frontend/src/app/assets/favicon/*` were generated using https://www.favicon-generator.org.
@@ -0,0 +1,161 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "",
"projects": {
"frontend": {
"root": "apps/frontend/",
"sourceRoot": "apps/frontend/src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@nrwl/schematics:component": {
"style": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/frontend",
"index": "apps/frontend/src/index.html",
"main": "apps/frontend/src/main.ts",
"polyfills": "apps/frontend/src/polyfills.ts",
"tsConfig": "apps/frontend/tsconfig.app.json",
"assets": [
"apps/frontend/src/favicon.ico",
"apps/frontend/src/assets"
],
"styles": ["apps/frontend/src/styles.scss"],
"scripts": [],
"es5BrowserSupport": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/frontend/src/environments/environment.ts",
"with": "apps/frontend/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "frontend:build"
},
"configurations": {
"production": {
"browserTarget": "frontend:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "frontend:build"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/frontend/tsconfig.app.json",
"apps/frontend/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
},
"test": {
"builder": "@nrwl/builders:jest",
"options": {
"jestConfig": "apps/frontend/jest.config.js",
"tsConfig": "apps/frontend/tsconfig.spec.json",
"setupFile": "apps/frontend/src/test-setup.ts"
}
}
}
},
"frontend-e2e": {
"root": "apps/frontend-e2e",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@nrwl/builders:cypress",
"options": {
"cypressConfig": "apps/frontend-e2e/cypress.json",
"tsConfig": "apps/frontend-e2e/tsconfig.e2e.json",
"devServerTarget": "frontend:serve"
},
"configurations": {
"production": {
"devServerTarget": "frontend:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "apps/frontend-e2e/tsconfig.e2e.json",
"exclude": ["**/node_modules/**"]
}
}
}
},
"shared": {
"root": "libs/shared",
"sourceRoot": "libs/shared/src",
"projectType": "library",
"prefix": "laas",
"architect": {
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/shared/tsconfig.lib.json",
"libs/shared/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
},
"test": {
"builder": "@nrwl/builders:jest",
"options": {
"jestConfig": "libs/shared/jest.config.js",
"tsConfig": "libs/shared/tsconfig.spec.json",
"setupFile": "libs/shared/src/test-setup.ts"
}
}
},
"schematics": {}
}
},
"cli": {
"warnings": {
"typescriptMismatch": false,
"versionMismatch": false
},
"defaultCollection": "@nrwl/schematics"
},
"schematics": {},
"defaultProject": "frontend"
}
@@ -0,0 +1,11 @@
{
"fileServerFolder": "../../dist/out-tsc/apps/frontend-e2e",
"fixturesFolder": "../../dist/out-tsc/apps/frontend-e2e/src/fixtures",
"integrationFolder": "../../dist/out-tsc/apps/frontend-e2e/src/integration",
"pluginsFile": "../../dist/out-tsc/apps/frontend-e2e/src/plugins/index.js",
"supportFile": false,
"video": true,
"videosFolder": "../../dist/out-tsc/apps/frontend-e2e/videos",
"screenshotsFolder": "../../dist/out-tsc/apps/frontend-e2e/screenshots",
"chromeWebSecurity": false
}
@@ -0,0 +1,4 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io"
}
@@ -0,0 +1,9 @@
import { getGreeting } from '../support/app.po';

describe('Hello Nx', () => {
beforeEach(() => cy.visit('/'));

it('should display welcome message', () => {
getGreeting().contains('Welcome to frontend!');
});
});
@@ -0,0 +1,17 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

module.exports = (on: Cypress.Actions, config: Cypress.ConfigOptions) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};
@@ -0,0 +1 @@
export const getGreeting = () => cy.get('h1');
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"sourceMap": false,
"outDir": "../../dist/out-tsc/apps/frontend-e2e/src"
},
"include": ["src/**/*.ts"]
}
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}
@@ -0,0 +1,11 @@
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11
@@ -0,0 +1,9 @@
module.exports = {
name: 'frontend',
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/apps/frontend/',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js'
]
};
@@ -0,0 +1,33 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { Page } from '@laas/shared';
import { HomePageComponent } from './components/pages/home/home-page.component';
import { PrivacyPolicyPageComponent } from './components/pages/privacy-policy/privacy-policy-page.component';
import { TermsOfServicePageComponent } from './components/pages/terms-of-service/terms-of-service-page.component';

const routes: Routes = [
{
path: '',
pathMatch: 'full',
component: HomePageComponent,
},
{
path: Page.PRIVACY_POLICY,
component: PrivacyPolicyPageComponent
},
{
path: Page.TERMS_OF_SERVICE,
component: TermsOfServicePageComponent
},
{
path: '**',
redirectTo: ''
}
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {
}
@@ -0,0 +1,5 @@
<app-header></app-header>

<div class="content"><router-outlet></router-outlet></div>

<app-footer></app-footer>
@@ -0,0 +1,12 @@
:host {
display: flex;
flex-direction: column;
height: 100vh;
width: 100%;
overflow: hidden;
}

.content {
height: 100%;
width: 100%;
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.