Skip to content

Commit cdd1ef8

Browse files
committed
add Angular frontend
1 parent 52e0fc8 commit cdd1ef8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+13158
-10
lines changed

angular/.browserslistrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
18+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

angular/.dockerignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# editor configs
2+
Properties
3+
.vscode
4+
.editorconfig
5+
.prettierrc
6+
.stylelintrc.json
7+
8+
# code binaries
9+
bin
10+
obj
11+
node_modules
12+
npm-debug.log
13+
log
14+
15+
# docs
16+
*.md
17+
LICENSE
18+
19+
# docker
20+
.docker
21+
.dockerignore
22+
Dockerfile
23+
*/docker-compose*
24+
25+
# repositories
26+
.git
27+
.hg
28+
.svn

angular/.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db

angular/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Angular JWT Demo
2+
3+
This is a regular Angular project, which is created by Angular CLI. This project demonstrates the JWT communications with a backend web API project.
4+
5+
In my demo, this project will be served by NGINX using Docker Compose. In order to let NGINX have access to the compiled Angular web app, please run command `npm run deploy:nginx` to save the output files to a `wwwroot` folder in the `nginx` directory.
6+
7+
Alternatively, you can deploy the Angular web app to a `wwwroot` folder in the ASP.NET Core web app and use Kestrel to serve the Angular app as a SPA.
8+
9+
## API BaseURL
10+
11+
Currently, the API BaseURL is set in the `environment.ts` file with a value of `https://localhost:5001`. You can change it to an empty string if the app is served by Kestrel. Or you can modify the value according to the web API app.

angular/angular.json

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"skipTests": true
11+
},
12+
"@schematics/angular:class": {
13+
"skipTests": true
14+
},
15+
"@schematics/angular:directive": {
16+
"skipTests": true
17+
},
18+
"@schematics/angular:guard": {
19+
"skipTests": true
20+
},
21+
"@schematics/angular:interceptor": {
22+
"skipTests": true
23+
},
24+
"@schematics/angular:module": {
25+
"skipTests": true
26+
},
27+
"@schematics/angular:pipe": {
28+
"skipTests": true
29+
},
30+
"@schematics/angular:service": {
31+
"skipTests": true
32+
}
33+
},
34+
"root": "",
35+
"sourceRoot": "src",
36+
"prefix": "app",
37+
"architect": {
38+
"build": {
39+
"builder": "@angular-devkit/build-angular:browser",
40+
"options": {
41+
"outputPath": "dist/angular",
42+
"index": "src/index.html",
43+
"main": "src/main.ts",
44+
"polyfills": "src/polyfills.ts",
45+
"tsConfig": "tsconfig.app.json",
46+
"aot": true,
47+
"assets": [
48+
"src/favicon.ico",
49+
"src/assets"
50+
],
51+
"styles": [
52+
"src/styles.css"
53+
],
54+
"scripts": []
55+
},
56+
"configurations": {
57+
"production": {
58+
"fileReplacements": [
59+
{
60+
"replace": "src/environments/environment.ts",
61+
"with": "src/environments/environment.prod.ts"
62+
}
63+
],
64+
"optimization": true,
65+
"outputHashing": "all",
66+
"sourceMap": false,
67+
"extractCss": true,
68+
"namedChunks": false,
69+
"extractLicenses": true,
70+
"vendorChunk": false,
71+
"buildOptimizer": true,
72+
"budgets": [
73+
{
74+
"type": "initial",
75+
"maximumWarning": "2mb",
76+
"maximumError": "5mb"
77+
},
78+
{
79+
"type": "anyComponentStyle",
80+
"maximumWarning": "6kb",
81+
"maximumError": "10kb"
82+
}
83+
]
84+
}
85+
}
86+
},
87+
"serve": {
88+
"builder": "@angular-devkit/build-angular:dev-server",
89+
"options": {
90+
"browserTarget": "angular:build"
91+
},
92+
"configurations": {
93+
"production": {
94+
"browserTarget": "angular:build:production"
95+
}
96+
}
97+
},
98+
"extract-i18n": {
99+
"builder": "@angular-devkit/build-angular:extract-i18n",
100+
"options": {
101+
"browserTarget": "angular:build"
102+
}
103+
}
104+
}
105+
}
106+
},
107+
"defaultProject": "angular",
108+
"cli": {
109+
"analytics": "a7d8b924-2f4c-4728-82b9-a0d4d6592366"
110+
}
111+
}

0 commit comments

Comments
 (0)