Skip to content

Commit ec237bd

Browse files
committed
add angular example
1 parent 8357fde commit ec237bd

35 files changed

+14569
-4
lines changed

.github/workflows/angular.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Deploy Angular Example
2+
3+
env:
4+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_ANGULAR_PROJECT_ID }}
6+
VERCEL_TOKEN: ${{ secrets.VERCEL_DEPLOYMENT_TOKEN }}
7+
on:
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- "frameworks/angular/**"
13+
pull_request:
14+
branches:
15+
- main
16+
paths:
17+
- "frameworks/angular/**"
18+
19+
jobs:
20+
deploy-preview:
21+
if: github.event_name == 'pull_request'
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: "20"
32+
33+
- name: Install dependencies
34+
run: npm install
35+
working-directory: ./frameworks/angular
36+
37+
- name: Install Vercel CLI
38+
run: npm install -g vercel@latest
39+
40+
- name: Pull Vercel Environment Information
41+
run: vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
42+
working-directory: ./frameworks/angular
43+
44+
- name: Build Project Artifacts
45+
run: vercel build --token=$VERCEL_TOKEN
46+
working-directory: ./frameworks/angular
47+
48+
- name: Deploy Project Artifacts to Vercel
49+
run: vercel deploy --prebuilt --token=$VERCEL_TOKEN
50+
working-directory: ./frameworks/angular
51+
52+
deploy-prod:
53+
if: github.event_name == 'push'
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v2
59+
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v3
62+
with:
63+
node-version: "20"
64+
65+
- name: Install dependencies
66+
run: npm install
67+
working-directory: ./frameworks/angular
68+
69+
- name: Install Vercel CLI
70+
run: npm install -g vercel@latest
71+
72+
- name: Pull Vercel Environment Information
73+
run: vercel pull --yes --environment=production --token=$VERCEL_TOKEN
74+
working-directory: ./frameworks/angular
75+
76+
- name: Build Project Artifacts
77+
run: vercel build --prod --token=$VERCEL_TOKEN
78+
working-directory: ./frameworks/angular
79+
80+
- name: Deploy Project Artifacts to Vercel
81+
run: vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN
82+
working-directory: ./frameworks/angular

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This is a repo for code examples showing how to integrate Keycloak with various
1313
| Nuxt (keycloak-js) | [🧑‍💻📁](./frameworks/nuxt/keycloak-js/) | [👩‍💻🚀](https://phasetwo-nuxt-keycloakjs-example.vercel.app/) | [👩‍🏫] (https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nuxt/) |
1414
| Nuxt (oidc-client-ts) | [🧑‍💻📁](./frameworks/nuxt/oidc-client-ts/) | [👩‍💻🚀](https://phasetwo-nuxt-oidc-example.vercel.app/) | [👩‍🏫] (https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nuxt/) |
1515
| Sveltekit | [🧑‍💻📁](./frameworks/sveltekit/) | [👩‍💻🚀](https://phasetwo-sveltekit-example.vercel.app) | [👩‍🏫] (https://phasetwo.io/blog/instant-user-management-and-sso-for-sveltekit/) |
16+
| Angular | [🧑‍💻📁](./frameworks/angular/) | [👩‍💻🚀](https://phasetwo-angular-example.vercel.app) | 👩‍🏫 |
1617
| Django | [🧑‍💻📁](./frameworks/django/) | 👩‍💻⚒️ | [👩‍🏫](https://phasetwo.io/blog/secure-django/) |
1718
| SpringBoot + Angular | [🧑‍💻📁](./frameworks/spring-boot-keycloak/) | 👩‍💻⚒️ | [👩‍🏫] https://phasetwo.io/blog/secure-spring-boot/ |
1819

frameworks/angular/.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

frameworks/angular/.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db
43+
.vercel

frameworks/angular/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Angular + Phase Two Example
2+
3+
[🚀 See Deployed Example](https://phasetwo-angular-example.vercel.app)
4+
5+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.1.3.
6+
7+
## Development server
8+
9+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
10+
11+
## Code scaffolding
12+
13+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
14+
15+
## Build
16+
17+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
18+
19+
## Running unit tests
20+
21+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
22+
23+
## Running end-to-end tests
24+
25+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
26+
27+
## Further help
28+
29+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.

frameworks/angular/angular.json

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"cli": {
5+
"packageManager": "npm"
6+
},
7+
"newProjectRoot": "projects",
8+
"projects": {
9+
"angular": {
10+
"projectType": "application",
11+
"schematics": {},
12+
"root": "",
13+
"sourceRoot": "src",
14+
"prefix": "app",
15+
"architect": {
16+
"build": {
17+
"builder": "@angular-devkit/build-angular:application",
18+
"options": {
19+
"outputPath": "dist/angular",
20+
"index": "src/index.html",
21+
"browser": "src/main.ts",
22+
"polyfills": [
23+
"zone.js"
24+
],
25+
"tsConfig": "tsconfig.app.json",
26+
"assets": [
27+
{
28+
"glob": "**/*",
29+
"input": "public"
30+
}
31+
],
32+
"styles": [
33+
"src/styles.css"
34+
],
35+
"scripts": []
36+
},
37+
"configurations": {
38+
"production": {
39+
"budgets": [
40+
{
41+
"type": "initial",
42+
"maximumWarning": "500kB",
43+
"maximumError": "1MB"
44+
},
45+
{
46+
"type": "anyComponentStyle",
47+
"maximumWarning": "2kB",
48+
"maximumError": "4kB"
49+
}
50+
],
51+
"outputHashing": "all"
52+
},
53+
"development": {
54+
"optimization": false,
55+
"extractLicenses": false,
56+
"sourceMap": true
57+
}
58+
},
59+
"defaultConfiguration": "production"
60+
},
61+
"serve": {
62+
"builder": "@angular-devkit/build-angular:dev-server",
63+
"configurations": {
64+
"production": {
65+
"buildTarget": "angular:build:production"
66+
},
67+
"development": {
68+
"buildTarget": "angular:build:development"
69+
}
70+
},
71+
"defaultConfiguration": "development"
72+
},
73+
"extract-i18n": {
74+
"builder": "@angular-devkit/build-angular:extract-i18n"
75+
},
76+
"test": {
77+
"builder": "@angular-devkit/build-angular:karma",
78+
"options": {
79+
"polyfills": [
80+
"zone.js",
81+
"zone.js/testing"
82+
],
83+
"tsConfig": "tsconfig.spec.json",
84+
"assets": [
85+
{
86+
"glob": "**/*",
87+
"input": "public"
88+
}
89+
],
90+
"styles": [
91+
"src/styles.css"
92+
],
93+
"scripts": []
94+
}
95+
}
96+
}
97+
}
98+
}
99+
}

0 commit comments

Comments
 (0)