Simple React + Spring web app.
Simple React + Spring Boot + MySQL (inside docker container) web application, where you can create/update/delete/get banners/categories and search by their names.
App can be run locally, requirements a listed below.
Build docker image
$ cd backend
$ docker build -t test_task .
Start container with environment arguments.
$ docker run -d --name <container_id> -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<password> -e MYSQL_DATABASE=<db_name> test:latest
By default app works with MYSQL_ROOT_PASSWORD=secret
and MYSQL_DATABASE=mySchema
. If you change it, don't forget to change them in application.properties
too.
MySql database started on port 3306
(you can specify external port :)).
$ docker run -d --name test_task -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=mySchema test_task:latest
(inside backend directory)
$ mvn clean package
$ java -jar target/backend-0.0.1-SNAPSHOT.jar
Spring boot aplication has been started on port 8080
(you can specify it in application.properties
)
In another terminal :)
$ cd frontend
$ npm install
$ npm run start
Frontend has been started on port 3000
.
You can see it in browser on localhost:3000/sign_in
By default only /bid endpoint is public.
In database was preloaded default user(admin) with username: admin
and password: admin
to pass autentication and access private
/banner/*
and /category/*
endpoints.