Demo project used during series of application development workshops. Includes topics related to:
- front-end development
- back-end development (to-be-added)
- deployment and other topics (to-be-added)
To starting project development:
- install actual version of Node.js
- install Angular CLI
npm install -g @angular/cli
- clone repository
git clone https://github.com/Vitaljok/charging-station-demo.git
- move to front-end directory
cd charging-station-demo/front-end
- install dependencies
npm install
- start local development server
ng serve
To start project back-end development:
- install IntelliJ IDEA Community Edition or other IDE of your choice
- clone repository
git clone https://github.com/Vitaljok/charging-station-demo.git
- import Gradle project from
./web-api/
folder
Use git pull
to get fresh updates from repository.
Workshop progress is saved in form of separate commits with tags step-NNN
.
In order to move to specific step use
git checkout tags/step-NNN
where NNN
is zero padded number of desired step, for example git checkout tags/step-004
.
Run npm install
if any dependencies are changed when switching steps.
Front-end project is initialized using Angular CLI utility ng new front-end
and is committed "as-is".
Adding basic application page structure: navigation header with links to List and Tree views, page content section and footer.
- Added Bootstrap library
npm install --save [email protected]
- Included Bootstrap styles into compilation configuration
.angular-cli.json
- Styled application page
- Added
ChargingStation
class - Initialized two distinct variables
- Used initialized variables in the template
- Changed charging stations variables to array
- Used
ngFor
directive in template - Adding conditional styling via
ngClass
directive
- Created service using
ng generate service Data
- Moved
stations
array from component to service - Moved
ChargingStation
class to separatedomain.ts
file and used imports - Added fake processing delay to service method
- Defined
DataService
in module providers to get dependency injection work - Injected
DataService
into component's constructor and used it duringOnInit
life-cycle hook.
- Changed service method to return
Observable
- Used subscription approach to get data asynchronously
- Created new component using
ng generate component StationList
(it also adds new component toapp.module.ts
declarations) - Moved list design to
station-list.component.html
- Moved data fetching to
station-list.component.ts
- Used new
<app-station-list>
tag inapp.component.html
- Created new component using
ng generate component StationTree
- Used list component as base for design and data fetching routines
- Added new
<app-station-tree>
tag inapp.component.html
- Defined application routes in
app.module.ts
- Used
<router-outlet>
in application template - Updated navigation links with
routerLink
directive - Styled active navigation link with
routerLinkActive
directive
- Adding
HttpModule
toapp.module.ts
- Changing
DataService
implementation to use provided back-end API - (alternative)
- install JSON server using
npm install -g json-server
- run own fake back-end API
json-server db.json
- install JSON server using
- Created new component using
ng generate component StationDetails
- Added parametrized route in
app.module.ts
- Retrieving provided route parameter via
ActivatedRoute
- Adding
routerLink
to station list and tree components
- Adding API call to
DataService
- Created
proxy.conf.json
configuration - Changed startup script in
package.json
- Form structure via
form-group
- Various input elements
- Dynamic city dropdown list
- Added
FormsModule
toapp.module.ts
- Changing
ChargingStation
class to allow parameterless constructor - Bi-directional data binding via
[(ngModel)]
- Button event binding via
(click)
- Added methods to
DataService
- Calling service methods from the component
- Implemented deleting functionality
- Defining new route in
app.module.ts
- Adding methods to
DataService
- Component initialization changes
- Adding controls to design
- Input element validation via styles
- Whole form validation via in-line variable
- Created new Gradle + Java project via wizard
- Added
.gitignore
file
Application
class withmain
methodPaymentService
class with calculations- Unit tests for service
- Adding Spring Bood dependencies
- Refactoring
Application
class - Adding unit tests for application
- Created
PaymentController
- Request mapping and response
- Refactoring
Application
class
- Created
StationBean
class - Created
StationController
- Added Lombok dependency
- Moved classes to
stations
package
- Added Spring JPA dependency
- Added H2 embedded database
- Custom configuration in
application.yml
- Simple
Station
entity
- Created
StationRepository
- Created
StationService
- Initialized database
- Modified
StationController
- Added
POST
endpoint definition to controller - Implemented service method for station creation
- Additional fields in
Station
entity
- Created
StationDetailsBean
- Implemented method for station details
- Timestamps conversion dependencies and configuration
- Added
PUT
endpoint - Implemented service method
- Used
@Transactional
annotation
- Created
StationEvent
entity - Defined
@OneToMany
mapping - Updated service
- Created
MessageController
for demonstration - Added Spring Security dependency
- Created
SecurityConfig
- Added in-memory users
- Added
HttpSecurity
config - Defined global authorization rules
PreAuthorize
rules
- Created and configured
auth-server
module - Modified
web-api
configuration for token authentication