- From the root of the project
gradlew build
- RESULT: it will produce a jar inside of: ./cnswapweb/build/libs/
- To build the docker container
- FOR MAC PLATFORM:
docker build --build-arg JAR_FILE=build/libs/cnswapweb-0.0.1-SNAPSHOT.jar -t avera/cnswap .
- FOR x64:
docker build --platform linux/amd64 --build-arg JAR_FILE=build/libs/cnswapweb-0.0.1-SNAPSHOT.jar -t avera/cnswap:0.0.1_linux .
- FOR MAC PLATFORM:
- RESULT: it will produce a new container into the local docker registry: avera/swapy:latest
- To run the docker:
docker run -p 8080:8080 avera/swapy
If you get an invalid username or password, is likely that the DB has not been initialized. Modify the application.properties to be: spring.sql.init.mode=always
@Controller classes serve as C from MVC. Note that the real controller in Spring MVC is DispatcherServlet that will use the specific @Controller class to handle the URL request.
@Service classes should serve for your service layer. Here you should put your business logic.
@Repository classes should serve for your data access layer. Here you should put CRUD logic: insert, update, delete, select.
@Service, @Repository and your entity classes will be M from MVC. JSP and other view technologies(e.g. JSP, Thymeleaf etc.) will conform V from MVC.
@Controller classes should only have access to @Service classes through interfaces. Similar, @Service classes should only have access to other @Service classes and for a specific set of @Repository classes through interfaces.
- (Source) https://stackoverflow.com/questions/25355385/where-to-put-business-logic-in-spring-mvc-framework
- Bootstrap reference documents: Used to render components in HTML
- Should had started with this one, as it explains the whole Database USER, ROLE relation for the Database login part
- I kept going back to this guy as it has a over all explanation of the processs too.
- This one explains the lambda anotation, I kept refering to it at times
- This one has a very good overall process too and it usesrs thymeleaf
- Explains the difference when using an MVC controler vs a RestControler
- a Complete end to end of what I did
- OH MY GOSH!! Why didn't I think of starting here, react and spring boots, but this one doesn't have the DB and authentication part
- A course in 28 minutes: I didn't try it but it seems to cover the basics