It's year 1945 and the Soviet forces need a network for co-ordinating on the war effort. We are tasked with creating an app which can aid the Sovient forces to oust the Axis power from their motherland. You are the Lead engineer selected to design and develop this application.
This project was generated with Angular CLI version 13.0.1.
This project was generated with SPRING BOOT TOOLS SUITE : STS using JAVA 8.
This project database was generated with Mysql 8
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically load files.
Run STS for a Tomcat server . `http://localhost:8080/message'. The app api will automatically loaded into memory.
Installing
-
Angular CLI Angular CLI can be obtained from Here
npm install -g @angular/cli
-
SPRING BOOT TOOLS SUITE : STS STS can be obtained from Here
-
for installation Angular after downloa run at command prompt in projet folder npm install -g @angular/cli
-
Creating Front project After completing installation please create a new angular project using below command in SHELL at your desired folder
ng new NovaVoltaicFrontEnd
-
Copying files Download all the files from the github repository.
-
Running the server at command prompt / SHELL at your project folder run below command
ng serve
5.Starting Project
at chrome browser visit http://localhost:4200/
. From here you can surf the Single Page Web Site.
note : backend project should be running before surfing
-
Creating Backend project After competing installation please create a new maven project using sts for spring boot with specified depencies mentioned.
-
Copying Files Download all the files from the github repository.
-
Running Server After completion of download, load sts and run the project.
-
Starting Project. Tomacat Apache server at port 8080 will be loaded in the system. Exploring all the API End points.
-
Run mysql from windows.
-
enter password as root
-
to create database in mysql by writing following command.
create database soviet;
-
To check API using postman.
-
Run Postman in windows.
-
to generate token goto url box 'http:\localhost:8080\generate-token'
-
Select
POST
method. -
for eg. if you have a user whose username is admin and passowrd is root, so in body section select json format and write the following { "username":"admin", "password":"root" }
-
After send in Repsonse you will get token, copy it.
-
to view all message in response box , so goto
http://localhost:8080/message/all
-
Select Get Method.
-
in Headers create a Key, Value
-
Key as Authorization
-
value as
Bearer <token>
-
Send the request and you will see all the messages in the response box.
- Add the following dependecies in pom.xml
1. spring-boot-starter-data-jpa <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa -->
2. spring-boot-starter-web <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
3. mysql-connector-java <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
4. spring-boot-starter-security <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
5. jjwt <!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt -->
6. jaxb-api<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
- Add these in Application.properties file
server.port = 8080
server.servlet.context-path=/message
spring.datasource.url=jdbc:mysql://localhost:3306/soviet
spring.datasource.username=<username>
spring.datasource.password=<password>
spring.jpa.hibernate.ddl-auto=update
Way to add Angular Material io
material.angular.io
c:\<project folder> ng add @angular/material
1.API reference for Angular Material button
import {MatButtonModule} from '@angular/material/button';
2.API reference for Angular Material snack-bar
import {MatSnackBarModule} from '@angular/material/snack-bar';
- API reference for Angular Material toolbar
import {MatToolbarModule} from '@angular/material/toolbar';
- API reference for Angular Material icon
import {MatIconModule} from '@angular/material/icon';
- API reference for Angular Material form-field
import {MatFormFieldModule} from '@angular/material/form-field';
- API reference for Angular Material input
import {MatInputModule} from '@angular/material/input';
- forms in Angular
import { FormsModule } from '@angular/forms';
8.Communicating with backend services using HTTP
import { HttpClientModule } from '@angular/common/http';
9.API reference for Angular Material card
import {MatCardModule} from '@angular/material/card';
10.Pagination for Angular
npm install ngx-pagination --save
import { NgxPaginationModule } from 'ngx-pagination';
"# NovaVoltaic"