This demo project was bootstrapped with create-react-app, spring-boot-v2 and also jhipster.
Try deployed instance with Heroku productsapp
The main goal is to integrate various technologies and principles in a single full-stack application.
- axios
- reactstrap
- jsonwebtoken
- redux
- redux-thunk
- redux-devtools
- react-fontawesome
- react-bootstrap-table2
- react-bootstrap-table2-overlay
- react-bootstrap-table2-paginator
- react-bootstrap-typeahead
Clone project with
git clone github.com/gzheyts/productsapp <project_root>
mvn -f <project_root>/pom.xml spring-boot:run
Then navigate to localhost:8080
mvn -f <project_root>/pom.xml spring-boot:run -Dskip.yarn
This will run api
on localhost:8080/api
cd <project_root>/src/main/webapp
yarn start
Will run frontend dev server at localhost:3000
To launch application's tests, run:
mvn -f <project_root>/pom.xml test -Dskip.yarn
API usage examples httpie
http POST :8080/users/register username="user" password="password"
response
HTTP/1.1 200
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Length: 0
Expires: 0
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
http POST :8080/login username="user" password="password"
response
HTTP/1.1 200
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE1MzMxOTgxNTYsInN1YiI6InVzZXIifQ.zvw99k1_Nh1UTNI6ZCBHL3v6-boXvuiyBNEcFM2LVhW0Rc6pAN7lEEJpXcSsOrJy0_9ifzgcJvCJTE9C1hW-ig
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Length: 0
Expires: 0
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
http :8080/api/categories Authorization:"Bearer eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE1MzMxOTgxNTYsInN1YiI6InVzZXIifQ.zvw99k1_Nh1UTNI6ZCBHL3v6-boXvuiyBNEcFM2LVhW0Rc6pAN7lEEJpXcSsOrJy0_9ifzgcJvCJTE9C1hW-ig"
response
HTTP/1.1 200
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Expires: 0
Pragma: no-cache
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
{
"content": [... ],
"page": 0,
"pageSize": 20,
"total": 5
}
http :8080/logout Authorization:"Bearer eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE1MzMxOTgxNTYsInN1YiI6InVzZXIifQ.zvw99k1_Nh1UTNI6ZCBHL3v6-boXvuiyBNEcFM2LVhW0Rc6pAN7lEEJpXcSsOrJy0_9ifzgcJvCJTE9C1hW-ig"