The brackets at the end of each step indicate the alias’s or IntelliJ Live Templates to use. You can find the template definitions at mraible/idea-live-templates.
-
start.spring.io: JPA, H2, Rest Repositories, Lombok, Okta, and Web [
boot-start
]http https://start.spring.io/starter.zip dependencies==h2,data-jpa,data-rest,lombok,okta,web javaVersion==11 bootVersion==2.2.0.M4 -d
-
Comment out
okta-spring-boot-starter
dependency inpom.xml
-
Add
Car
,CarRepository
, andApplicationRunner
bean [boot-entity-lombok
,boot-repo
,boot-data
] -
Start and see list of cars in console:
./mvnw spring-boot:run
-
Create
CoolCarController
with a/cool-cars
endpoint [boot-cool
] -
Restart and confirm http://localhost:8080/cars works in browser and with HTTPie
http POST :8080/cars name='VW Bus' http PUT :8080/cars/10 name='Hefe the Bus' http DELETE :8080/cars/10
-
Install Angular CLI
npm i -g @angular/[email protected]
-
Run
ng new client --routing --style css --enable-ivy
; show app withng serve -o
-
Install Angular Material [
ng add @angular/material
] -
Generate a car service to talk to the API [
a-httpclient-get
]ng g s shared/car/car
-
Add
HttpClientModule
as an import inapp.module.ts
-
Generate a
CarListComponent
and modify it to useCarService
ng g c car-list
-
Update
car-list.component.html
to show the list of cars [a-ngFor
] -
Update
app.component.html
to use the<app-car-list>
component -
Start the app, show error, modify
/cool-cars
and repository to use@CrossOrigin
-
Add Angular Material imports and modify HTML [
mat-imports
,mat-toolbar
,mat-card
] -
Add Animated Cars with Giphy [
ng-giphy-service
,ng-giphy-foreach
]
-
Create a
CarEditComponent
to modify car datang g c car-edit
-
Add a link to edit component (+add button) in
car-list.component.html
[mat-edit
,mat-add
] -
Import the
FormsModule
inapp.module.ts
-
Add routing to list and edit components in
app-routing.module.ts
[ng-routes
] -
Modify edit component and car service to add methods for saving and deleting. [
ng-service-api
,ng-service-cud
,ng-edit
] -
Make the edit template look good + add some CSS. [
mat-form
] -
Remove
<app-car-list/>
fromapp.component.html
, show CORS error and fix [cors-filter
] -
Restart, demo, and be proud!
-
Uncomment Okta Spring Boot starter in
pom.xml
-
Create OIDC app in Okta; add properties to
application.yml
[ss-okta
] -
Create
SecurityConfiguration
for resource server [ss-resource-config
] -
Show 401 at
http://localhost:8080/
-
Commit all changes to Git
-
Add Okta’s Angular SDK using OktaDev Schematics
ng add @oktadev/schematics
-
Show changes made to project and explain
-
Remove default route and add
canActivate: [OktaAuthGuard]
to routes inapp-routing.module.ts
-
Modify
app.component.html
to have login and logout buttons + adjust CSS [mat-login
,toolbar-spacer
] -
Update
HomeComponent
to use Angular Material and link to Car List [mat-home
] -
Add
MatButtonModule
andMatCardModule
toauth-routing.module.ts
-
Change
<mat-card>
to fill the screen by adding the following tostyles.css
mat-card { height: 100vh; }
-
Disable Ivy in
tsconfig.app.json
because Ivy doesn’t have CommonJS/UMD support -
Show app and rejoice 🎉