├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── keycloak-springboot-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── springboot │ │ └── keycloak │ │ ├── Application.java │ │ ├── config │ │ └── SecurityConfig.java │ │ ├── controller │ │ └── EmployeeController.java │ │ ├── keycloakservice │ │ └── KeycloakService.java │ │ └── vo │ │ └── EmployeeVO.java │ └── resources │ └── application.properties ├── logging-log4j2-knf ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ ├── HelloController.java │ │ └── StartApplication.java │ └── resources │ ├── application.properties │ └── log4j2.xml ├── registration-login-spring-boot-security-thymeleaf-rdbms ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ ├── RegistrationLoginSpringBootSecurityThymeleafApplication.java │ │ ├── config │ │ └── SecurityConfiguration.java │ │ ├── dto │ │ └── UserRegistrationDto.java │ │ ├── model │ │ ├── Role.java │ │ └── User.java │ │ ├── repository │ │ └── UserRepository.java │ │ ├── service │ │ ├── UserService.java │ │ └── UserServiceImpl.java │ │ └── web │ │ ├── HomeController.java │ │ └── RegistrationController.java │ └── resources │ └── templates │ ├── index.html │ ├── login.html │ └── registration.html ├── spring-actuator-custom-health-indicator ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springactuatorcustomhealthindicator │ │ │ ├── Application.java │ │ │ └── customindicator │ │ │ ├── VowelHealthIndicator1.java │ │ │ └── VowelHealthIndicator2.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springactuatorcustomhealthindicator │ └── SpringActuatorCustomHealthIndicatorApplicationTests.java ├── spring-boot-activemq5-producer-consumer ├── consumer │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ └── consumer │ │ │ │ ├── ConsumerApplication.java │ │ │ │ └── service │ │ │ │ └── Consumer.java │ │ └── resources │ │ │ └── application.yaml │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── consumer │ │ └── ConsumerApplicationTests.java └── producer │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── producer │ │ │ ├── ProducerApplication.java │ │ │ ├── controller │ │ │ └── MessageController.java │ │ │ └── service │ │ │ └── Producer.java │ └── resources │ │ └── application.yaml │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── producer │ └── ProducerApplicationTests.java ├── spring-boot-astra-db-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── StudentController.java │ │ │ ├── entity │ │ │ └── Student.java │ │ │ ├── exception │ │ │ ├── CustomErrorResponse.java │ │ │ ├── EntityNotFoundException.java │ │ │ └── GlobalExceptionHandler.java │ │ │ └── repository │ │ │ └── StudentRepository.java │ └── resources │ │ └── application.yaml │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── ApplicationTests.java ├── spring-boot-data-jdbc-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootdatajdbccrud │ │ │ ├── SpringBootDataJdbcCrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── ErrorMessage.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── InternalServerError.java │ │ │ └── UserNotFound.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ ├── Query.java │ │ │ ├── UserRepository.java │ │ │ └── UserRepositoryImpl.java │ └── resources │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootdatajdbccrud │ └── SpringBootDataJdbcCrudApplicationTests.java ├── spring-boot-data-jdbc-postgresql-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootdatajdbccrud │ │ │ ├── SpringBootDataJdbcCrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── ErrorMessage.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── InternalServerError.java │ │ │ └── UserNotFound.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ ├── Query.java │ │ │ ├── UserRepository.java │ │ │ └── UserRepositoryImpl.java │ └── resources │ │ ├── application.properties │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootdatajdbccrud │ └── SpringBootDataJdbcCrudApplicationTests.java ├── spring-boot-dto-validation-custom-annotation ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── dto │ │ │ └── ProfileDto.java │ │ │ ├── exception │ │ │ └── RestExceptionHandler.java │ │ │ └── validation │ │ │ ├── URLValidator.java │ │ │ └── ValidURL.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── ApplicationTests.java ├── spring-boot-hashicorp-vault-sample ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ └── controller │ │ │ └── MyController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── ApplicationTests.java ├── spring-boot-java-record ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── springbootjavarecord │ │ ├── SpringBootJavaRecordApplication.java │ │ ├── controller │ │ └── UserController.java │ │ ├── dto │ │ └── User.java │ │ ├── entity │ │ └── User.java │ │ ├── repsitory │ │ └── UserRepository.java │ │ └── service │ │ └── UserService.java │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootjavarecord │ └── SpringBootJavaRecordApplicationTests.java ├── spring-boot-jdbcclient-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── StudentController.java │ │ │ ├── dao │ │ │ ├── StudentDAO.java │ │ │ └── StudentDAOImpl.java │ │ │ └── model │ │ │ └── Student.java │ └── resources │ │ ├── application.yaml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── StudentControllerTests.java ├── spring-boot-json-properties-demo ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ ├── DemoApplication.java │ │ │ └── JsonPropertySourceLoader.java │ └── resources │ │ ├── META-INF │ │ └── spring.factories │ │ └── application.json │ └── test │ └── java │ └── com │ └── example │ └── demo │ └── DemoApplicationTests.java ├── spring-boot-jsp-helloworld ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── helloworld │ │ │ ├── Application.java │ │ │ └── controller │ │ │ └── HelloController.java │ ├── resources │ │ └── application.properties │ └── webapp │ │ └── WEB-INF │ │ └── jsp │ │ └── index.jsp │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── helloworld │ └── ApplicationTest.java ├── spring-boot-jsp-postgresql-crud ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── crudapp │ │ ├── Application.java │ │ ├── controller │ │ └── StudentController.java │ │ ├── dto │ │ └── StudentDTO.java │ │ ├── model │ │ └── Student.java │ │ ├── repository │ │ └── StudentRepository.java │ │ ├── service │ │ └── StudentService.java │ │ └── serviceImpl │ │ └── StudentServiceImpl.java │ ├── resources │ └── application.properties │ └── webapp │ └── WEB-INF │ └── jsp │ ├── student-add-update.jsp │ └── student-list.jsp ├── spring-boot-kafka-producer-consumer ├── consumer │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ └── consumer │ │ │ │ ├── ConsumerApplication.java │ │ │ │ └── service │ │ │ │ └── Consumer.java │ │ └── resources │ │ │ └── application.yaml │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── consumer │ │ └── ConsumerApplicationTests.java └── producer │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── producer │ │ │ ├── ProducerApplication.java │ │ │ ├── controller │ │ │ └── MessageController.java │ │ │ └── service │ │ │ └── Producer.java │ └── resources │ │ └── application.yaml │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── producer │ └── ProducerApplicationTests.java ├── spring-boot-mockito-example ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── mockito │ │ ├── Application.java │ │ ├── controller │ │ └── UserRestController.java │ │ ├── entity │ │ └── User.java │ │ ├── repository │ │ └── UserRepository.java │ │ └── service │ │ ├── UserService.java │ │ └── UserServiceImpl.java │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── mockito │ ├── ApplicationTest.java │ ├── controller │ └── UserRestControllerTest.java │ └── service │ └── UserServiceImplTest.java ├── spring-boot-mybatis-multidatasource-mysql-postgresql ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── config │ │ │ ├── mysql │ │ │ │ ├── MySQLConfig.java │ │ │ │ └── MySQLConnMapper.java │ │ │ └── postgresql │ │ │ │ ├── PostgreSQLConfig.java │ │ │ │ └── PostgreSQLConnMapper.java │ │ │ ├── controller │ │ │ ├── mysql │ │ │ │ └── StudentController.java │ │ │ └── postgresql │ │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── CustomErrorResponse.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── mapper │ │ │ ├── mysql │ │ │ │ └── StudentMapper.java │ │ │ └── postgresql │ │ │ │ └── UserMapper.java │ │ │ └── model │ │ │ ├── mysql │ │ │ └── Student.java │ │ │ └── postgresql │ │ │ └── User.java │ └── resources │ │ ├── application.properties │ │ └── mapper │ │ ├── mysql │ │ └── StudentMapper.xml │ │ └── postgresql │ │ └── UserMapper.xml │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── Application.java ├── spring-boot-mybatis-one-to-many-one-to-one ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── model │ │ │ ├── Card.java │ │ │ └── User.java │ │ │ └── repository │ │ │ ├── CardRepository.java │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ ├── data.sql │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── Application.java ├── spring-boot-mybatis-xml-one-to-many-one-to-one ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── model │ │ │ ├── Card.java │ │ │ └── User.java │ │ │ └── repository │ │ │ ├── CardRepository.java │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ ├── data.sql │ │ ├── mapper │ │ ├── CardMapper.xml │ │ └── UserMapper.xml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── Application.java ├── spring-boot-mysql-rest-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootmysqlrestcrud │ │ │ ├── SpringBootMysqlRestCrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ ├── exception │ │ │ ├── ErrorMessage.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── InternalServerError.java │ │ │ └── UserNotFound.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootmysqlrestcrud │ └── SpringBootMysqlRestCrudApplicationTests.java ├── spring-boot-okta-secure-rest-api ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── SpringBootOktaSecureRestApiApplication.java │ │ │ ├── config │ │ │ └── SecurityConfig.java │ │ │ └── controller │ │ │ └── DemoController.java │ └── resources │ │ └── application.yaml │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── SpringBootOktaSecureRestApiApplicationTests.java ├── spring-boot-postgresql-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootpostgresqlcrud │ │ │ ├── SpringBootPostgresqlCrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ ├── exception │ │ │ ├── ErrorMessage.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── InternalServerError.java │ │ │ └── UserNotFound.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootpostgresqlcrud │ └── SpringBootPostgresqlCrudApplicationTests.java ├── spring-boot-postgresql-mybatis-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── CustomErrorResponse.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── Application.java ├── spring-boot-postgresql-mybatis-xml-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── CustomErrorResponse.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ ├── mapper │ │ └── UserMapper.xml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── Application.java ├── spring-boot-rabbitmq-producer-consumer ├── consumer │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ └── consumer │ │ │ │ └── RabbitMQConsumer.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── ApplicationTests.java └── producer │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── config │ │ │ └── RabbitMQConfig.java │ │ │ ├── controller │ │ │ └── MessageController.java │ │ │ └── producer │ │ │ └── RabbitMQProducer.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── ApplicationTests.java ├── spring-boot-security-jwt-auth-mongodb-master ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ ├── Application.java │ │ │ ├── controllers │ │ │ ├── AuthController.java │ │ │ └── EmployeeController.java │ │ │ ├── models │ │ │ ├── ERole.java │ │ │ ├── Employee.java │ │ │ └── Role.java │ │ │ ├── repository │ │ │ ├── EmployeeRepository.java │ │ │ └── RoleRepository.java │ │ │ ├── request │ │ │ ├── LoginRequest.java │ │ │ └── SignupRequest.java │ │ │ ├── response │ │ │ ├── JwtResponse.java │ │ │ └── MessageResponse.java │ │ │ └── security │ │ │ ├── WebSecurityConfig.java │ │ │ ├── jwt │ │ │ ├── AuthEntryPointJwt.java │ │ │ ├── AuthTokenFilter.java │ │ │ └── JwtUtils.java │ │ │ └── services │ │ │ ├── EmployeeDetailsImpl.java │ │ │ └── EmployeeDetailsServiceImpl.java │ └── resources │ │ └── application.yaml │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── ApplicationTests.java ├── spring-boot-spring-data-jdbc-sqlserver-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── CustomErrorResponse.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ ├── Query.java │ │ │ ├── UserRepository.java │ │ │ └── UserRepositoryImpl.java │ └── resources │ │ ├── application.properties │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── Application.java ├── spring-boot-spring-data-jpa-sqlserver-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ ├── exception │ │ │ ├── CustomErrorResponse.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── Application.java ├── spring-boot-thymeleaf-zxing-qrcode ├── Readme.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── QRCodeDemoApplication.java │ │ ├── controller │ │ └── QRCodeController.java │ │ └── service │ │ └── QRCodeService.java │ └── resources │ ├── application.properties │ └── templates │ └── index.html ├── spring-boot-vaadin ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ ├── DemoApplication.java │ │ ├── User.java │ │ ├── UserService.java │ │ └── VaadinUI.java │ └── resources │ └── application.properties ├── spring-cloud-sleuth-zipkin-demo ├── account │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── account │ │ │ └── AccountServiceApplication.java │ │ └── resources │ │ └── application.yml ├── cart │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── cart │ │ │ └── CartServiceApplication.java │ │ └── resources │ │ └── application.yml ├── order │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── order │ │ │ └── OrderServiceApplication.java │ │ └── resources │ │ └── application.yml └── product │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── product │ │ └── ProductServiceApplication.java │ └── resources │ └── application.yml ├── spring-controlleradvice-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ ├── entity │ │ └── User.java │ │ ├── exception │ │ ├── CustomErrorResponse.java │ │ ├── GlobalExceptionHandler.java │ │ └── UserNotFoundException.java │ │ └── repository │ │ └── UserRepository.java │ └── resources │ └── application.properties ├── spring-get-post-put-delete-mapping-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ ├── entity │ │ └── User.java │ │ ├── exception │ │ ├── CustomErrorResponse.java │ │ ├── GlobalExceptionHandler.java │ │ └── ResourceNotFoundException.java │ │ └── repository │ │ └── UserRepository.java │ └── resources │ └── application.properties ├── spring-github-oauth2 ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springoauth2github │ │ │ ├── Springoauth2GithubApplication.java │ │ │ └── config │ │ │ ├── SecurityConfig.java │ │ │ └── WebMvcConfig.java │ └── resources │ │ ├── application.yaml │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springoauth2github │ └── Springoauth2GithubApplicationTests.java ├── spring-google-oauth2 ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── SpringOauth2googleApplication.java │ │ │ └── config │ │ │ ├── SecurityConfig.java │ │ │ └── WebMvcConfig.java │ └── resources │ │ ├── application.yaml │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── SpringOauth2googleApplicationTests.java ├── spring-groovy-jpa-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springjpagroovycrud │ │ │ ├── SpringjpagroovycrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── model │ │ │ └── User.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ └── UserService.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── create-update.tpl │ │ └── home.tpl │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springjpagroovycrud │ └── SpringjpagroovycrudApplicationTests.java ├── spring-interceptors ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── SpringInterceptorsApplication.java │ │ │ ├── config │ │ │ └── InterceptorConfig.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ └── interceptor │ │ │ └── MyInterceptor.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── SpringInterceptorsApplicationTests.java ├── spring-jdbcclient-example ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── dao │ │ │ ├── StudentDAO.java │ │ │ └── StudentDAOImpl.java │ │ │ └── model │ │ │ └── Student.java │ └── resources │ │ ├── application.yaml │ │ ├── schema.sql │ │ └── test-student-data.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── StudentDAOTests.java ├── spring-modelattribute-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ └── model │ │ └── User.java │ └── resources │ ├── application.properties │ └── templates │ └── user.html ├── spring-okta-oauth2 ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── SpringOauth2OktaApplication.java │ │ │ └── controller │ │ │ └── WebController.java │ └── resources │ │ ├── application.yaml │ │ └── templates │ │ └── index.html │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── SpringOauth2googleApplicationTests.java ├── spring-pathvariable-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ └── dto │ │ └── User.java │ └── resources │ └── application.properties ├── spring-quartz-joblistener-demo ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ ├── DemoApplication.java │ │ │ ├── config │ │ │ ├── AutowiringSpringBeanJobFactory.java │ │ │ └── SchedulerConfig.java │ │ │ ├── job │ │ │ └── MySimpleJob.java │ │ │ ├── listener │ │ │ ├── GlobalJobListener.java │ │ │ └── JobListenerConfig.java │ │ │ └── service │ │ │ └── TestService.java │ └── resources │ │ ├── application.properties │ │ └── quartz.properties │ └── test │ └── java │ └── com │ └── example │ └── demo │ └── DemoApplicationTests.java ├── spring-requestbody-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ └── dto │ │ └── User.java │ └── resources │ └── application.properties ├── spring-requestheader-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ └── dto │ │ └── User.java │ └── resources │ └── application.properties ├── spring-requestparam-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ └── dto │ │ └── User.java │ └── resources │ └── application.properties ├── spring-responsebody-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ └── dto │ │ └── User.java │ └── resources │ └── application.properties ├── spring-responsestatus-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ ├── exception │ │ └── UserNotFoundException.java │ │ └── model │ │ └── User.java │ └── resources │ └── application.properties ├── spring-restclient ├── spring-restclient-app │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── SpringRestclientAppApplication.java │ │ │ │ ├── config │ │ │ │ └── RestClientConfig.java │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ ├── response │ │ │ │ └── ErrorMessage.java │ │ │ │ └── service │ │ │ │ ├── UserService.java │ │ │ │ └── UserServiceImpl.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringRestclientAppApplicationTests.java └── user-management-demo │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── UserManagementDemoApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ ├── exception │ │ │ ├── ErrorMessage.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── UserManagementDemoApplicationTests.java ├── spring-restontroller-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ └── dto │ │ └── User.java │ └── resources │ └── application.properties ├── spring-thymeleaf-crud-pagination ├── LICENSE ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ ├── domain │ │ └── User.java │ │ ├── exception │ │ └── RecordNotFoundException.java │ │ ├── repository │ │ └── UserRepository.java │ │ ├── service │ │ ├── UserService.java │ │ └── impl │ │ │ └── UserServiceImpl.java │ │ └── util │ │ └── Pager.java │ └── resources │ ├── application.properties │ └── templates │ ├── add-edit-user.html │ └── list-users.html ├── spring-webflux-filedownload ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── deno │ │ │ └── springwebfluxfiledownload │ │ │ ├── SpringwebfluxfiledownloadApplication.java │ │ │ └── controller │ │ │ └── DownloadFile.java │ └── resources │ │ ├── application.properties │ │ └── dummy.txt │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── deno │ └── springwebfluxfiledownload │ └── SpringwebfluxfiledownloadApplicationTests.java ├── spring-webflux-fileupload-download ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── SpringwebfluxfileuploaddownloadApplication.java │ │ │ └── controller │ │ │ └── UploadDownloadController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── SpringwebfluxfileuploaddownloadApplicationTests.java ├── spring-webflux-simplecrud-example ├── .factorypath ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── springwebfluxsimplecrudexample │ │ ├── SpringwebfluxsimplecrudexampleApplication.java │ │ ├── controller │ │ └── UserController.java │ │ ├── model │ │ └── User.java │ │ └── repository │ │ └── UserRepository.java │ └── resources │ ├── application.yaml │ └── schema.sql ├── spring-webflux-video-streaming-example ├── build.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── demo │ │ │ ├── SpringWebfluxVideoStreamingExampleApplication.java │ │ │ ├── config │ │ │ └── EndPointConfig.java │ │ │ ├── controller │ │ │ └── VideoStreamingController.java │ │ │ └── service │ │ │ └── VideoStreamingService.java │ └── resources │ │ ├── application.properties │ │ ├── mp4 │ │ └── sample_960x540.mp4 │ │ └── static │ │ └── index.html │ └── test │ └── java │ └── com │ └── knf │ └── demo │ └── SpringWebfluxVideoStreamingExampleApplicationTests.java ├── springboot-JPA-H2DB ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ ├── Entity │ │ └── User.java │ │ ├── Repository │ │ └── UserRepository.java │ │ ├── VO │ │ └── UserVo.java │ │ └── knowledgefactorydemo │ │ ├── HomeController.java │ │ └── KnowledgefactorydemoApplication.java │ └── resources │ └── application.properties ├── springboot-JPA-HikariCp ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ ├── Entity │ │ └── User.java │ │ ├── Repository │ │ └── UserRepository.java │ │ ├── VO │ │ └── UserVo.java │ │ └── knowledgefactorydemo │ │ ├── HomeController.java │ │ └── KnowledgefactorydemoApplication.java │ └── resources │ └── application.properties ├── springboot-JPA-TomcatCp ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ ├── Entity │ │ └── User.java │ │ ├── Repository │ │ └── UserRepository.java │ │ ├── VO │ │ └── UserVo.java │ │ └── knowledgefactorydemo │ │ ├── HomeController.java │ │ └── KnowledgefactorydemoApplication.java │ └── resources │ └── application.properties ├── springboot-azure ├── spring-azure-app-config │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knd │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ └── HelloController.java │ │ └── resources │ │ │ └── bootstrap.yaml │ │ └── test │ │ └── java │ │ └── com │ │ └── knd │ │ └── dev │ │ └── demo │ │ └── SpringAzureAppConfigApplicationTests.java ├── spring-azure-blob-react-file-handling │ ├── LICENSE │ ├── README.md │ ├── backend │ │ └── spring-azure-storage-blob │ │ │ ├── pom.xml │ │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ ├── config │ │ │ │ └── AzureBlobConfig.java │ │ │ │ ├── controller │ │ │ │ └── AzureController.java │ │ │ │ └── service │ │ │ │ └── AzureBlobService.java │ │ │ └── resources │ │ │ └── application.yaml │ └── frontend │ │ └── react-drag-drop-file-upload-download │ │ ├── package.json │ │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── Common.js │ │ ├── components │ │ └── UploadFilesComponent.js │ │ ├── index.css │ │ ├── index.js │ │ ├── reportWebVitals.js │ │ ├── serviceWorker.js │ │ └── services │ │ └── UploadFilesService.js ├── spring-azure-cosmosdb-mongo-api-crud │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ └── repository │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringAzureCosmosdbMongoApiCrudApplicationTests.java ├── spring-azure-storage-blob │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── config │ │ │ └── AzureBlobConfig.java │ │ │ ├── controller │ │ │ └── AzureController.java │ │ │ └── service │ │ │ └── AzureBlobService.java │ │ └── resources │ │ └── application.yaml ├── spring-boot-azure-cosmos-db-sql-api-crud │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── entity │ │ │ │ └── User.java │ │ │ │ ├── exception │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ ├── UnKnownException.java │ │ │ │ └── UserNotFound.java │ │ │ │ └── repository │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ └── application.yaml │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringBootAzureCosmosDbSqlApiCrudApplicationTests.java ├── spring-boot-azure-key-vault │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ └── SecretTestController.java │ │ └── resources │ │ │ └── application.yaml │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringBootAzureKeyVaultApplicationTests.java ├── spring-boot-azure-mysql-crud │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── entity │ │ │ │ └── User.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorMessage.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserNotFound.java │ │ │ │ └── repository │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringBootAzureMysqlCrudApplicationTests.java ├── spring-boot-azure-postgresql-crud │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── entity │ │ │ │ └── User.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorMessage.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserNotFound.java │ │ │ │ └── repository │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringBootAzurePostgresqlCrudApplicationTests.java ├── spring-boot-azure-sql-crud │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ └── springbootazuresqlcrud │ │ │ │ ├── Application.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── entity │ │ │ │ └── User.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorMessage.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserNotFound.java │ │ │ │ └── repository │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ └── application.yaml │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── springbootazuresqlcrud │ │ └── SpringBootAzureSqlCrudApplicationTests.java ├── spring-data-jdbc-azure-mysql-crud │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── SpringDataJdbcAzureMysqlCrudApplication.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorMessage.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserNotFound.java │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ └── repository │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringDataJdbcAzureMysqlCrudApplicationTests.java ├── spring-data-jdbc-azure-postgres-crud │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ └── springdatajdbcazurepostgrescrud │ │ │ │ ├── Application.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorMessage.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserNotFound.java │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ └── repository │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── springdatajdbcazurepostgrescrud │ │ └── SpringDataJdbcAzurePostgresCrudApplicationTests.java ├── spring-jdbc-api-azure-sql-crud │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorMessage.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserNotFound.java │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ └── repository │ │ │ │ ├── Query.java │ │ │ │ ├── UserRepository.java │ │ │ │ └── UserRepositoryImpl.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringJdbcApiAzureSqlCrudApplicationTests.java ├── spring-jdbc-azure-mysql-crud │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── SpringJdbcAzureMysqlCrudApplication.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorMessage.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserNotFound.java │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ └── repository │ │ │ │ ├── Query.java │ │ │ │ ├── UserRepository.java │ │ │ │ └── UserRepositoryImpl.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringJdbcAzureMysqlCrudApplicationTests.java ├── spring-jdbc-azure-postgres-crud │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ └── springdatajdbcazurepostgrescrud │ │ │ │ ├── SpringDataJdbcAzurePostgresCrudApplication.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorMessage.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserNotFound.java │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ └── repository │ │ │ │ ├── Query.java │ │ │ │ ├── UserRepository.java │ │ │ │ └── UserRepositoryImpl.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── springdatajdbcazurepostgrescrud │ │ └── SpringDataJdbcAzurePostgresCrudApplicationTests.java ├── spring-webflux-azure-cosmos-db-sql-api-crud │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── knf │ │ │ │ └── dev │ │ │ │ └── demo │ │ │ │ ├── Application.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── model │ │ │ │ └── User.java │ │ │ │ └── repository │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ └── application.yaml │ │ └── test │ │ └── java │ │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── SpringWebfluxAzureCosmosDbSqlApiCrudApplicationTests.java ├── spring-webflux-cosmosdb-mongo-api-crud │ ├── LICENSE │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── model │ │ │ └── User.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ ├── UserService.java │ │ │ └── UserServiceImpl.java │ │ └── resources │ │ └── application.properties └── springboot-jpa-azure-sql-react-table-pagination │ ├── LICENSE │ ├── README.md │ ├── react-datatable-pagination │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── components │ │ ├── AddUser.js │ │ ├── User.js │ │ └── UsersList.js │ │ ├── http-common.js │ │ ├── index.css │ │ ├── index.js │ │ ├── reportWebVitals.js │ │ ├── services │ │ └── UserService.js │ │ └── setupTests.js │ └── springboot-azure-sql-crud-pagination │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootpagination │ │ │ ├── SpringbootPaginationApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── ResourceNotFoundException.java │ │ │ └── ServerError.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ └── application.yaml │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootpagination │ └── SpringbootPaginationApplicationTests.java ├── springboot-custom-exception ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── example │ └── demo │ ├── DemoApplication.java │ ├── controller │ └── DemoController.java │ ├── exception │ ├── CustomerNotFoundException.java │ └── response │ │ └── CustomErrorResponse.java │ └── exceptionhandler │ └── GlobalExceptionHandler.java ├── springboot-datable-pagination ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ └── springbootdatablepagination │ │ ├── Application.java │ │ ├── controller │ │ └── WebController.java │ │ └── vo │ │ └── Vo.java │ └── resources │ ├── application.properties │ ├── static │ ├── css │ │ └── jquery.dataTables.min.css │ └── js │ │ ├── controller.js │ │ ├── jquery-3.3.1.js │ │ └── jquery.dataTables.min.js │ └── templates │ └── index.html ├── springboot-embeddedserver-undertow ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── Controller.java │ │ └── KnowledgefactorydemoApplication.java │ └── resources │ └── application.properties ├── springboot-export-csv-apache-commons ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── example │ │ └── demo │ │ ├── SpringbootExportCsvDemoApplication.java │ │ ├── controller │ │ └── EmployeeController.java │ │ ├── helper │ │ └── CSVHelper.java │ │ ├── model │ │ └── Employee.java │ │ ├── repository │ │ └── EmployeeRepository.java │ │ └── service │ │ └── EmployeeService.java │ └── resources │ └── application.properties ├── springboot-export-csv-demo ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── example │ │ └── demo │ │ ├── SpringbootExportCsvDemoApplication.java │ │ ├── controller │ │ └── EmployeeController.java │ │ ├── model │ │ └── Employee.java │ │ ├── repository │ │ └── EmployeeRepository.java │ │ └── service │ │ └── EmployeeService.java │ └── resources │ └── application.properties ├── springboot-export-pdf ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ ├── SpringExportPdfApplication.java │ │ ├── controller │ │ └── EmployeeController.java │ │ ├── model │ │ └── Employee.java │ │ ├── repository │ │ └── EmployeeRepository.java │ │ └── util │ │ └── PDFGenerator.java │ └── resources │ └── application.properties ├── springboot-fileupload-filedownload ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── KnowledgefactorydemoApplication.java │ │ ├── controller │ │ ├── HomeController.java │ │ └── WebController.java │ │ └── service │ │ └── UploadDownloadService.java │ └── resources │ ├── application.properties │ ├── static │ └── dist │ │ └── js │ │ └── controller.js │ └── templates │ └── index.html ├── springboot-freemaker ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── HomeController.java │ │ └── KnowledgefactorydemoApplication.java │ └── resources │ ├── application.properties │ └── templates │ └── index.ftl ├── springboot-freemarker-jpa-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootfreemarkerjpacrud │ │ │ ├── SpringbootfreemarkerjpacrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ └── RecordNotFoundException.java │ │ │ ├── model │ │ │ └── User.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ └── UserService.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── create-update.ftlh │ │ └── home.ftlh │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootfreemarkerjpacrud │ └── SpringbootfreemarkerjpacrudApplicationTests.java ├── springboot-graphql-crud-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── SpringGraphqlCrudExampleApplication.java │ │ ├── entity │ │ ├── Author.java │ │ └── Book.java │ │ ├── repository │ │ ├── AuthorRepository.java │ │ └── BookRepository.java │ │ └── resolver │ │ ├── Mutation.java │ │ └── Query.java │ └── resources │ ├── application.properties │ └── schema.graphqls ├── springboot-hystrix ├── spring-rest-hystrix-consumer │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── knowledgefactory │ │ │ └── knowledgefactorydemo │ │ │ ├── Controller.java │ │ │ ├── KnowledgefactorydemoApplication.java │ │ │ └── ServiceLayer.java │ │ └── resources │ │ └── application.properties └── springboot-rest-producer │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── Controller.java │ │ └── KnowledgefactorydemoApplication.java │ └── resources │ └── application.properties ├── springboot-interceptor-demo ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ ├── SpringbootInterceptorDemoApplication.java │ │ ├── controller │ │ └── HomeController.java │ │ └── interceptor │ │ ├── ServiceInterceptor.java │ │ └── ServiceInterceptorAppConfig.java │ └── resources │ └── application.properties ├── springboot-jetty-embeddedserver ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── Controller.java │ │ └── KnowledgefactorydemoApplication.java │ └── resources │ └── application.properties ├── springboot-jpa-hibernate-manytomany-mapping ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ ├── Application.java │ │ ├── controller │ │ └── HomeController.java │ │ ├── dto │ │ ├── AuthorDto.java │ │ └── BookDto.java │ │ ├── model │ │ ├── Author.java │ │ └── Book.java │ │ └── repository │ │ └── BookRepository.java │ └── resources │ └── application.properties ├── springboot-jpa-hibernate-onetomany-mapping ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ ├── SpringbootJpaHibernateOnetoonemappingApplication.java │ │ │ ├── controller │ │ │ └── HomeController.java │ │ │ ├── model │ │ │ ├── Employee.java │ │ │ └── EmployeeContact.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── demo │ └── SpringbootJpaHibernateOnetoonemappingApplicationTests.java ├── springboot-jpa-hibernate-onetoone-mapping ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ ├── SpringbootJpaHibernateOnetoonemappingApplication.java │ │ │ ├── controller │ │ │ └── HomeController.java │ │ │ ├── model │ │ │ ├── Employee.java │ │ │ └── EmployeeContact.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── demo │ └── SpringbootJpaHibernateOnetoonemappingApplicationTests.java ├── springboot-microsoft-word ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ └── demo │ │ ├── KnowledgefactorydemoApplication.java │ │ ├── controller │ │ └── WordController.java │ │ └── helper │ │ └── WordHelper.java │ └── resources │ └── spring.png ├── springboot-mustache-crud ├── LICENSE ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootjpamustachecrud │ │ │ ├── SpringbootjpamustachecrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── model │ │ │ └── User.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ └── UserService.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── create-update.mustache │ │ └── home.mustache │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootjpamustachecrud │ └── SpringbootjpamustachecrudApplicationTests.java ├── springboot-mustache-jpa-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootjpamustachecrud │ │ │ ├── SpringbootjpamustachecrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── model │ │ │ └── User.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ └── UserService.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── create-update.mustache │ │ └── home.mustache │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootjpamustachecrud │ └── SpringbootjpamustachecrudApplicationTests.java ├── springboot-mustache ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── HomeController.java │ │ └── KnowledgefactorydemoApplication.java │ └── resources │ ├── application.properties │ └── templates │ └── index.html ├── springboot-mybatis-crud-example ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ ├── Application.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ ├── CustomErrorResponse.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── User.java │ │ │ └── repository │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── Application.java ├── springboot-rest-xml-crud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── springbootrestxml │ │ │ ├── SpringbootrestxmlApplication.java │ │ │ ├── config │ │ │ └── WebConfig.java │ │ │ ├── controller │ │ │ └── BookController.java │ │ │ ├── model │ │ │ └── Book.java │ │ │ └── repository │ │ │ └── BookRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── springbootrestxml │ └── SpringbootrestxmlApplicationTests.java ├── springboot-rest ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── HomeController.java │ │ ├── KnowledgefactorydemoApplication.java │ │ └── UserVo.java │ └── resources │ └── application.properties ├── springboot-restemplate-example ├── springboot-rest-consumer │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── knowledgefactory │ │ │ └── knowledgefactorydemo │ │ │ ├── Controller.java │ │ │ ├── Key.java │ │ │ ├── KnowledgefactorydemoApplication.java │ │ │ ├── User.java │ │ │ └── UserService.java │ │ └── resources │ │ └── application.properties └── springboot-rest-producer │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── Controller.java │ │ ├── Key.java │ │ ├── KnowledgefactorydemoApplication.java │ │ ├── User.java │ │ └── UserService.java │ └── resources │ └── application.properties ├── springboot-scheduled-task-demo ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ ├── KnowledgefactoryScheduler.java │ │ └── SpringScheduler.java │ └── resources │ └── application.properties ├── springboot-send-email ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── sibin │ │ │ └── dev │ │ │ └── emaildemo │ │ │ ├── EmailDemoApplication.java │ │ │ └── util │ │ │ └── EmailUtil.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── sibin │ └── dev │ └── emaildemo │ └── EmailDemoApplicationTests.java ├── springboot-swagger ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── Controller.java │ │ ├── KnowledgefactorydemoApplication.java │ │ ├── User.java │ │ └── UserService.java │ └── resources │ └── application.yaml ├── springboot-thymeleaf-jpa-crud ├── LICENSE ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ ├── Application.java │ │ ├── controller │ │ └── UserController.java │ │ ├── entity │ │ └── User.java │ │ ├── exception │ │ └── RecordNotFoundException.java │ │ ├── repository │ │ └── UserRepository.java │ │ └── service │ │ └── UserService.java │ └── resources │ ├── application.properties │ └── templates │ ├── add-edit-user.html │ └── list-users.html ├── springboot-videostream ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ └── knowledgefactorydemo │ │ ├── HomeController.java │ │ ├── KnowledgefactorydemoApplication.java │ │ └── MyResourceHttpRequestHandler.java │ └── resources │ ├── application.properties │ ├── static │ ├── dist │ │ ├── css │ │ │ ├── adminlte.css │ │ │ └── adminlte.min.css │ │ └── js │ │ │ ├── adminlte.js │ │ │ └── adminlte.min.js │ └── plugins │ │ ├── bootstrap │ │ ├── css │ │ │ └── bootstrap.min.css │ │ └── js │ │ │ └── bootstrap.bundle.min.js │ │ └── jquery │ │ └── jquery.min.js │ └── templates │ └── index.ftl ├── springboot-webflux-reactivemonogo ├── .factorypath ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── reactivestack │ │ │ └── dev │ │ │ ├── MainApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── domain │ │ │ └── User.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ └── UserServiceImpl.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── knf │ └── reactivestack │ └── dev │ └── MainApplicationTest.java ├── springboot-websocket-example ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knowledgefactory │ │ ├── KnowledgefactorydemoApplication.java │ │ ├── SocketConfig.java │ │ └── TextHandler.java │ └── resources │ ├── application.properties │ ├── static │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── jquery.min.js │ └── main.js │ └── templates │ └── index.html ├── springboot-zxing-itext-qrcode-pdf ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── knf │ │ └── dev │ │ ├── Application.java │ │ ├── controller │ │ └── TestController.java │ │ └── util │ │ ├── PDFGenerator.java │ │ └── QRCodeGenerator.java │ └── resources │ └── application.properties ├── springbootfreemarkerjpacrud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springbootfreemarkerjpacrud │ │ │ ├── SpringbootfreemarkerjpacrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── exception │ │ │ └── RecordNotFoundException.java │ │ │ ├── model │ │ │ └── User.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ └── UserService.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── create-update.ftlh │ │ └── home.ftlh │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springbootfreemarkerjpacrud │ └── SpringbootfreemarkerjpacrudApplicationTests.java ├── springjpagroovycrud ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── knf │ │ │ └── dev │ │ │ └── demo │ │ │ └── springjpagroovycrud │ │ │ ├── SpringjpagroovycrudApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── model │ │ │ └── User.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ └── UserService.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── create-update.tpl │ │ └── home.tpl │ └── test │ └── java │ └── com │ └── knf │ └── dev │ └── demo │ └── springjpagroovycrud │ └── SpringjpagroovycrudApplicationTests.java └── twilio-springboot-demo ├── pom.xml └── src └── main ├── java └── com │ └── knf │ └── sibin │ └── dev │ ├── TwilioSpringbootDemoApplication.java │ └── controller │ └── MessageController.java └── resources └── application.properties /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "kotlin-springboot"] 2 | path = kotlin-springboot 3 | url = https://github.com/knowledgefactory4u/kotlin_springboot_app 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot examples 2 | 3 | # Local setup 4 | 5 | Step 1: Download or clone the source code from GitHub to the local machine 6 | 7 | Step 2: ```mvn clean install``` 8 | 9 | Step 3: ```mvn spring-boot:run``` or Run as Java Application 10 | 11 | 12 | -------------------------------------------------------------------------------- /keycloak-springboot-example/src/main/java/com/knf/springboot/keycloak/vo/EmployeeVO.java: -------------------------------------------------------------------------------- 1 | package com.knf.springboot.keycloak.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class EmployeeVO { 9 | private String email; 10 | private String password; 11 | private String firstname; 12 | private String lastname; 13 | private int statusCode; 14 | private String status; 15 | 16 | } -------------------------------------------------------------------------------- /keycloak-springboot-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 9080 2 | keycloak.auth-server-url = http://localhost:8080/auth 3 | keycloak.realm = knowledgefactory-realm 4 | keycloak.resource = knowledgefactory-client 5 | keycloak.public-client = true 6 | keycloak.use-resource-role-mappings = true 7 | keycloak.ssl-required = external 8 | server.connection-timeout = 6000 9 | keycloak.credentials.secret = 86996cf7-5030-4a37-948b-99223f8bdabf 10 | 11 | 12 | -------------------------------------------------------------------------------- /logging-log4j2-knf/src/main/java/com/knowledgefactory/StartApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class StartApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(StartApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /logging-log4j2-knf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.com.knowledgefactory=INFO 2 | #logging.level.=ERROR 3 | logging.level.org.springframework=INFO -------------------------------------------------------------------------------- /registration-login-spring-boot-security-thymeleaf-rdbms/src/main/java/com/knf/dev/RegistrationLoginSpringBootSecurityThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RegistrationLoginSpringBootSecurityThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RegistrationLoginSpringBootSecurityThymeleafApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /registration-login-spring-boot-security-thymeleaf-rdbms/src/main/java/com/knf/dev/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.knf.dev.model.User; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository { 10 | User findByEmail(String email); 11 | } 12 | -------------------------------------------------------------------------------- /registration-login-spring-boot-security-thymeleaf-rdbms/src/main/java/com/knf/dev/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.security.core.userdetails.UserDetailsService; 6 | 7 | import com.knf.dev.dto.UserRegistrationDto; 8 | import com.knf.dev.model.User; 9 | 10 | public interface UserService extends UserDetailsService { 11 | User save(UserRegistrationDto registrationDto); 12 | List getAll(); 13 | } 14 | -------------------------------------------------------------------------------- /registration-login-spring-boot-security-thymeleaf-rdbms/src/main/java/com/knf/dev/web/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.web; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | @Controller 7 | public class HomeController { 8 | 9 | @GetMapping("/login") 10 | public String login() { 11 | return "login"; 12 | } 13 | 14 | @GetMapping("/") 15 | public String home() { 16 | return "index"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spring-actuator-custom-health-indicator/src/main/java/com/knf/dev/demo/springactuatorcustomhealthindicator/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springactuatorcustomhealthindicator; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-actuator-custom-health-indicator/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | management.endpoint.health.show-details=always 2 | -------------------------------------------------------------------------------- /spring-actuator-custom-health-indicator/src/test/java/com/knf/dev/demo/springactuatorcustomhealthindicator/SpringActuatorCustomHealthIndicatorApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springactuatorcustomhealthindicator; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringActuatorCustomHealthIndicatorApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-activemq5-producer-consumer/consumer/src/main/java/com/knf/dev/demo/consumer/ConsumerApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.consumer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ConsumerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ConsumerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-activemq5-producer-consumer/consumer/src/main/java/com/knf/dev/demo/consumer/service/Consumer.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.consumer.service; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class Consumer { 8 | 9 | @JmsListener(destination = "${activemq.topic.name}") 10 | public void listenToTopic(String message) 11 | { 12 | System.out.println("Message arrived! Message: " + message); 13 | } 14 | } -------------------------------------------------------------------------------- /spring-boot-activemq5-producer-consumer/consumer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | activemq: 3 | broker-url: tcp://localhost:61616 4 | password: admin 5 | user: admin 6 | jms: 7 | pub-sub-domain: true 8 | 9 | activemq: 10 | topic: 11 | name: knowledgeFactory_Topic -------------------------------------------------------------------------------- /spring-boot-activemq5-producer-consumer/consumer/src/test/java/com/knf/dev/demo/consumer/ConsumerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.consumer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ConsumerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-activemq5-producer-consumer/producer/src/main/java/com/knf/dev/demo/producer/ProducerApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.producer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ProducerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ProducerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-activemq5-producer-consumer/producer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | activemq: 3 | broker-url: tcp://localhost:61616 4 | password: admin 5 | user: admin 6 | jms: 7 | pub-sub-domain: true 8 | 9 | activemq: 10 | topic: 11 | name: knowledgeFactory_Topic 12 | -------------------------------------------------------------------------------- /spring-boot-activemq5-producer-consumer/producer/src/test/java/com/knf/dev/demo/producer/ProducerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.producer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ProducerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-astra-db-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-astra-db-crud/src/main/java/com/knf/dev/demo/exception/EntityNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class EntityNotFoundException extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public EntityNotFoundException(String message) { 7 | super(message); 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /spring-boot-astra-db-crud/src/main/java/com/knf/dev/demo/repository/StudentRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.entity.Student; 4 | import org.springframework.data.cassandra.repository.CassandraRepository; 5 | 6 | import java.util.List; 7 | import java.util.UUID; 8 | 9 | public interface StudentRepository extends CassandraRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /spring-boot-astra-db-crud/src/test/java/com/knf/dev/demo/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/SpringBootDataJdbcCrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootDataJdbcCrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication. 11 | run(SpringBootDataJdbcCrudApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/exception/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud.exception; 2 | 3 | import java.util.Date; 4 | 5 | public record ErrorMessage 6 | (Integer statusCode, 7 | Date timestamp, 8 | String message, 9 | String description) { 10 | } 11 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/exception/InternalServerError.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud.exception; 2 | public class InternalServerError extends RuntimeException { 3 | 4 | private static final long serialVersionUID = 1L; 5 | 6 | public InternalServerError(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /spring-boot-data-jdbc-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud.exception; 2 | public class UserNotFound extends RuntimeException { 3 | 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/model/User.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud.model; 2 | 3 | public record User 4 | (Long id, 5 | String firstName, 6 | String lastName, 7 | String email) { 8 | } 9 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Create table for `users` 3 | -- 4 | CREATE TABLE `users` ( 5 | `id` bigint(20) generated by default as identity NOT NULL, 6 | `first_name` varchar(100) NOT NULL, 7 | `last_name` varchar(100) NOT NULL, 8 | `email` varchar(100) NOT NULL 9 | ); -------------------------------------------------------------------------------- /spring-boot-data-jdbc-crud/src/test/java/com/knf/dev/demo/springbootdatajdbccrud/SpringBootDataJdbcCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootDataJdbcCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-postgresql-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/SpringBootDataJdbcCrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootDataJdbcCrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication. 11 | run(SpringBootDataJdbcCrudApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-postgresql-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/exception/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud.exception; 2 | 3 | import java.util.Date; 4 | 5 | public record ErrorMessage 6 | (Integer statusCode, 7 | Date timestamp, 8 | String message, 9 | String description) { 10 | } 11 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-postgresql-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/exception/InternalServerError.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud.exception; 2 | public class InternalServerError extends RuntimeException { 3 | 4 | private static final long serialVersionUID = 1L; 5 | 6 | public InternalServerError(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /spring-boot-data-jdbc-postgresql-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud.exception; 2 | public class UserNotFound extends RuntimeException { 3 | 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-postgresql-crud/src/main/java/com/knf/dev/demo/springbootdatajdbccrud/model/User.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud.model; 2 | 3 | public record User 4 | (Long id, 5 | String firstName, 6 | String lastName, 7 | String email) { 8 | } 9 | 10 | -------------------------------------------------------------------------------- /spring-boot-data-jdbc-postgresql-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url= jdbc:postgresql://localhost:5432/postgres 2 | spring.datasource.username= postgres 3 | spring.datasource.password= password 4 | 5 | spring.datasource.initialization-mode=always -------------------------------------------------------------------------------- /spring-boot-data-jdbc-postgresql-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Create table for `users` 3 | -- 4 | 5 | CREATE TABLE users ( 6 | id serial PRIMARY KEY, 7 | first_name VARCHAR ( 50 ) NOT NULL, 8 | last_name VARCHAR ( 50 ) NOT NULL, 9 | email VARCHAR ( 255 ) NOT NULL 10 | ); -------------------------------------------------------------------------------- /spring-boot-data-jdbc-postgresql-crud/src/test/java/com/knf/dev/demo/springbootdatajdbccrud/SpringBootDataJdbcCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatajdbccrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootDataJdbcCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-dto-validation-custom-annotation/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-dto-validation-custom-annotation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-boot-dto-validation-custom-annotation 2 | -------------------------------------------------------------------------------- /spring-boot-dto-validation-custom-annotation/src/test/java/com/knf/dev/demo/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-hashicorp-vault-sample/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-hashicorp-vault-sample/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-boot-hashicorp-vault-sample 2 | spring.cloud.vault.token=hvs.hwiyGMfXljRFzsDuSLiAtY6P 3 | spring.cloud.vault.uri=http://localhost:8200 4 | spring.config.import: vault:// -------------------------------------------------------------------------------- /spring-boot-hashicorp-vault-sample/src/test/java/com/knf/dev/demo/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-java-record/src/main/java/com/knf/dev/demo/springbootjavarecord/dto/User.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjavarecord.dto; 2 | 3 | public record 4 | User(Long id, String firstName, 5 | String lastName, String email) { 6 | } 7 | -------------------------------------------------------------------------------- /spring-boot-java-record/src/main/java/com/knf/dev/demo/springbootjavarecord/repsitory/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjavarecord.repsitory; 2 | 3 | import java.util.List; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | import com.knf.dev.demo.springbootjavarecord.entity.User; 7 | 8 | @Repository 9 | public interface UserRepository 10 | extends CrudRepository { 11 | List findAll(); 12 | } -------------------------------------------------------------------------------- /spring-boot-java-record/src/test/java/com/knf/dev/demo/springbootjavarecord/SpringBootJavaRecordApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjavarecord; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootJavaRecordApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-jdbcclient-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-jdbcclient-crud/src/main/java/com/knf/dev/demo/dao/StudentDAO.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.dao; 2 | 3 | import com.knf.dev.demo.model.Student; 4 | 5 | import java.util.List; 6 | import java.util.Optional; 7 | 8 | public interface StudentDAO { 9 | 10 | Integer insertStudent(Student student); 11 | 12 | Student updateStudent(Student student); 13 | 14 | void deleteStudent(Long id); 15 | 16 | List getAllStudents(); 17 | 18 | Optional findStudentById(Long id); 19 | 20 | } -------------------------------------------------------------------------------- /spring-boot-jdbcclient-crud/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:postgresql://localhost:5432/postgres 4 | username: postgres 5 | password: root 6 | sql: 7 | init: 8 | mode: always 9 | -------------------------------------------------------------------------------- /spring-boot-jdbcclient-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS students ( 2 | id SERIAL PRIMARY KEY, 3 | name VARCHAR(250) NOT NULL, 4 | email VARCHAR(250) NOT NULL, 5 | gender VARCHAR(250) NOT NULL, 6 | age INT 7 | ); -------------------------------------------------------------------------------- /spring-boot-json-properties-demo/src/main/java/com/example/demo/JsonPropertySourceLoader.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.springframework.boot.env.YamlPropertySourceLoader; 4 | 5 | public class JsonPropertySourceLoader 6 | extends YamlPropertySourceLoader { 7 | 8 | @Override 9 | public String[] getFileExtensions() { 10 | return new String[] { "json" }; 11 | } 12 | } -------------------------------------------------------------------------------- /spring-boot-json-properties-demo/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.PropertySourceLoader=com.example.demo.JsonPropertySourceLoader -------------------------------------------------------------------------------- /spring-boot-json-properties-demo/src/main/resources/application.json: -------------------------------------------------------------------------------- 1 | { 2 | "server.port":9080, 3 | "testdata1":"testing", 4 | "valuesMap":"{key1: '1', key2: '2', key3: '3'}" 5 | } -------------------------------------------------------------------------------- /spring-boot-json-properties-demo/src/test/java/com/example/demo/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-jsp-helloworld/src/main/java/com/knf/dev/demo/helloworld/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.helloworld; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-jsp-helloworld/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mvc.view.prefix: /WEB-INF/jsp/ 2 | spring.mvc.view.suffix: .jsp 3 | -------------------------------------------------------------------------------- /spring-boot-jsp-helloworld/src/main/webapp/WEB-INF/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ${message}! 6 | 7 | 8 |

${message}!

9 | 10 | -------------------------------------------------------------------------------- /spring-boot-jsp-helloworld/src/test/java/com/knf/dev/demo/helloworld/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.helloworld; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ApplicationTest { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-jsp-postgresql-crud/src/main/java/com/knf/dev/demo/crudapp/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.crudapp; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-jsp-postgresql-crud/src/main/java/com/knf/dev/demo/crudapp/repository/StudentRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.crudapp.repository; 2 | 3 | import com.knf.dev.demo.crudapp.model.Student; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | 8 | @Repository 9 | public interface StudentRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /spring-boot-jsp-postgresql-crud/src/main/java/com/knf/dev/demo/crudapp/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.crudapp.service; 2 | 3 | 4 | import com.knf.dev.demo.crudapp.dto.StudentDTO; 5 | import java.util.List; 6 | 7 | public interface StudentService { 8 | 9 | public void createOrUpdateStudent(StudentDTO empDTO); 10 | 11 | public List getAllStudent(); 12 | 13 | public void deleteStudent(Long id); 14 | 15 | public StudentDTO editStudent(Long id); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot-jsp-postgresql-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:postgresql://localhost:5432/students 2 | spring.datasource.username=postgres 3 | spring.datasource.password=root 4 | spring.jpa.show-sql=true 5 | 6 | # Hibernate ddl auto (create, create-drop, validate, update) 7 | spring.jpa.hibernate.ddl-auto = update 8 | 9 | spring.mvc.view.prefix: /WEB-INF/jsp/ 10 | spring.mvc.view.suffix: .jsp 11 | -------------------------------------------------------------------------------- /spring-boot-kafka-producer-consumer/consumer/src/main/java/com/knf/dev/demo/consumer/ConsumerApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.consumer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ConsumerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ConsumerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-kafka-producer-consumer/consumer/src/main/java/com/knf/dev/demo/consumer/service/Consumer.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.consumer.service; 2 | 3 | import org.springframework.kafka.annotation.KafkaListener; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class Consumer { 8 | 9 | @KafkaListener(topics = {"${kafka.topic.name}"}, groupId = "${kafka.topic.name}") 10 | public void listenToTopic(String message) 11 | { 12 | System.out.println("Message arrived! Message: " + message); 13 | } 14 | } -------------------------------------------------------------------------------- /spring-boot-kafka-producer-consumer/consumer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | kafka: 3 | producer: 4 | bootstrap-servers: localhost:9092 5 | key-serializer: org.apache.kafka.common.serialization.StringSerializer 6 | value-serializer: org.apache.kafka.common.serialization.StringSerializer 7 | kafka: 8 | topic: 9 | name: knowledgeFactory_Topic 10 | group: knowledgeFactory_group 11 | -------------------------------------------------------------------------------- /spring-boot-kafka-producer-consumer/consumer/src/test/java/com/knf/dev/demo/consumer/ConsumerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.consumer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ConsumerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-kafka-producer-consumer/producer/src/main/java/com/knf/dev/demo/producer/ProducerApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.producer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ProducerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ProducerApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-kafka-producer-consumer/producer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | kafka: 3 | producer: 4 | bootstrap-servers: localhost:9092 5 | key-serializer: org.apache.kafka.common.serialization.StringSerializer 6 | value-serializer: org.apache.kafka.common.serialization.StringSerializer 7 | kafka: 8 | topic: 9 | name: knowledgeFactory_Topic 10 | -------------------------------------------------------------------------------- /spring-boot-kafka-producer-consumer/producer/src/test/java/com/knf/dev/demo/producer/ProducerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.producer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ProducerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mockito-example/src/main/java/com/knf/dev/mockito/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.mockito; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot-mockito-example/src/main/java/com/knf/dev/mockito/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.mockito.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.knf.dev.mockito.entity.User; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository { 10 | 11 | public User findByName(String name); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mockito-example/src/main/java/com/knf/dev/mockito/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.mockito.service; 2 | 3 | import java.util.List; 4 | 5 | import com.knf.dev.mockito.entity.User; 6 | 7 | public interface UserService { 8 | 9 | public User getUserByName(String name); 10 | public User saveUser(User user); 11 | public List getAllUsers(); 12 | } -------------------------------------------------------------------------------- /spring-boot-mockito-example/src/test/java/com/knf/dev/mockito/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.mockito; 2 | 3 | import org.junit.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class ApplicationTest { 8 | 9 | @Test 10 | public void main() { 11 | Application.main(new String[] {}); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /spring-boot-mybatis-multidatasource-mysql-postgresql/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mybatis-multidatasource-mysql-postgresql/src/main/java/com/knf/dev/demo/config/mysql/MySQLConnMapper.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.config.mysql; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.lang.annotation.*; 6 | 7 | @Target({ ElementType.TYPE }) 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Documented 10 | @Component 11 | public @interface MySQLConnMapper { 12 | String value() default ""; 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mybatis-multidatasource-mysql-postgresql/src/main/java/com/knf/dev/demo/config/postgresql/PostgreSQLConnMapper.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.config.postgresql; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.lang.annotation.*; 6 | 7 | @Target({ ElementType.TYPE }) 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Documented 10 | @Component 11 | public @interface PostgreSQLConnMapper { 12 | 13 | String value() default ""; 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-mybatis-multidatasource-mysql-postgresql/src/main/java/com/knf/dev/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class ResourceNotFoundException extends RuntimeException{ 4 | private static final long serialVersionUID = 1L; 5 | 6 | public ResourceNotFoundException(String message) { 7 | super(message); 8 | } 9 | } -------------------------------------------------------------------------------- /spring-boot-mybatis-multidatasource-mysql-postgresql/src/test/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Application { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mybatis-one-to-many-one-to-one/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mybatis-one-to-many-one-to-one/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.com.knf.dev.demo=TRACE -------------------------------------------------------------------------------- /spring-boot-mybatis-one-to-many-one-to-one/src/test/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Application { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mybatis-xml-one-to-many-one-to-one/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @MapperScan("com.knf.dev.demo.repository") 9 | public class Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-mybatis-xml-one-to-many-one-to-one/src/main/java/com/knf/dev/demo/repository/CardRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.model.Card; 4 | 5 | public interface CardRepository { 6 | Card selectCardById(Integer id); 7 | 8 | } -------------------------------------------------------------------------------- /spring-boot-mybatis-xml-one-to-many-one-to-one/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | 4 | import com.knf.dev.demo.model.User; 5 | 6 | public interface UserRepository { 7 | User selectUserById(String email); 8 | 9 | } -------------------------------------------------------------------------------- /spring-boot-mybatis-xml-one-to-many-one-to-one/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.com.knf.dev.demo=TRACE 2 | 3 | #Configure the xml Mapping path 4 | mybatis.mapper-locations=classpath:mapper/*.xml -------------------------------------------------------------------------------- /spring-boot-mybatis-xml-one-to-many-one-to-one/src/test/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Application { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mysql-rest-crud/src/main/java/com/knf/dev/demo/springbootmysqlrestcrud/SpringBootMysqlRestCrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootmysqlrestcrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootMysqlRestCrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication. 11 | run(SpringBootMysqlRestCrudApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-mysql-rest-crud/src/main/java/com/knf/dev/demo/springbootmysqlrestcrud/exception/InternalServerError.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootmysqlrestcrud.exception; 2 | 3 | public class InternalServerError extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public InternalServerError(String msg) { 7 | super(msg); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spring-boot-mysql-rest-crud/src/main/java/com/knf/dev/demo/springbootmysqlrestcrud/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootmysqlrestcrud.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /spring-boot-mysql-rest-crud/src/main/java/com/knf/dev/demo/springbootmysqlrestcrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootmysqlrestcrud.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import com.knf.dev.demo.springbootmysqlrestcrud.entity.User; 5 | 6 | public interface UserRepository 7 | extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /spring-boot-mysql-rest-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url= jdbc:mysql://localhost:3306/userdb 2 | spring.datasource.username=root 3 | spring.datasource.password= 4 | 5 | spring.jpa.hibernate.ddl-auto=create-drop 6 | 7 | server.port=8081 -------------------------------------------------------------------------------- /spring-boot-mysql-rest-crud/src/test/java/com/knf/dev/demo/springbootmysqlrestcrud/SpringBootMysqlRestCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootmysqlrestcrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootMysqlRestCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-okta-secure-rest-api/src/main/java/com/knf/dev/demo/SpringBootOktaSecureRestApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootOktaSecureRestApiApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootOktaSecureRestApiApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-okta-secure-rest-api/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | okta: 2 | oauth2: 3 | issuer: https:///oauth2/default 4 | -------------------------------------------------------------------------------- /spring-boot-okta-secure-rest-api/src/test/java/com/knf/dev/demo/SpringBootOktaSecureRestApiApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootOktaSecureRestApiApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-postgresql-crud/src/main/java/com/knf/dev/demo/springbootpostgresqlcrud/SpringBootPostgresqlCrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootpostgresqlcrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootPostgresqlCrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run( 11 | SpringBootPostgresqlCrudApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-postgresql-crud/src/main/java/com/knf/dev/demo/springbootpostgresqlcrud/exception/InternalServerError.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootpostgresqlcrud.exception; 2 | 3 | public class InternalServerError extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public InternalServerError(String msg) { 8 | super(msg); 9 | } 10 | } -------------------------------------------------------------------------------- /spring-boot-postgresql-crud/src/main/java/com/knf/dev/demo/springbootpostgresqlcrud/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootpostgresqlcrud.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /spring-boot-postgresql-crud/src/main/java/com/knf/dev/demo/springbootpostgresqlcrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootpostgresqlcrud.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import com.knf.dev.demo.springbootpostgresqlcrud.entity.User; 5 | 6 | public interface UserRepository 7 | extends CrudRepository { 8 | 9 | } -------------------------------------------------------------------------------- /spring-boot-postgresql-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url= jdbc:postgresql://localhost:5432/postgres 2 | spring.datasource.username= postgres 3 | spring.datasource.password= password 4 | spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation= true 5 | spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.PostgreSQLDialect 6 | 7 | spring.jpa.hibernate.ddl-auto=create-drop 8 | server.port=8081 9 | -------------------------------------------------------------------------------- /spring-boot-postgresql-crud/src/test/java/com/knf/dev/demo/springbootpostgresqlcrud/SpringBootPostgresqlCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootpostgresqlcrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootPostgresqlCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-crud/src/main/java/com/knf/dev/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class ResourceNotFoundException extends RuntimeException{ 4 | private static final long serialVersionUID = 1L; 5 | 6 | public ResourceNotFoundException(String message) { 7 | super(message); 8 | } 9 | } -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:postgresql://localhost:5432/testdb 2 | spring.datasource.username=postgres 3 | spring.datasource.password=root 4 | 5 | spring.sql.init.mode=always -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS users 2 | ( 3 | id SERIAL PRIMARY KEY, 4 | first_name varchar(255) not null, 5 | last_name varchar(255) not null, 6 | email_id varchar(255) not null 7 | ); 8 | -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-crud/src/test/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Application { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-xml-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @MapperScan("com.knf.dev.demo.repository") 9 | public class Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-xml-crud/src/main/java/com/knf/dev/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class ResourceNotFoundException extends RuntimeException{ 4 | private static final long serialVersionUID = 1L; 5 | 6 | public ResourceNotFoundException(String message) { 7 | super(message); 8 | } 9 | } -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-xml-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.model.User; 4 | import java.util.List; 5 | import java.util.Optional; 6 | 7 | public interface UserRepository { 8 | 9 | List findAll(); 10 | 11 | Optional findById(Integer id); 12 | 13 | int deleteById(Integer id); 14 | 15 | int insert(User user); 16 | 17 | int update(User user); 18 | } -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-xml-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:postgresql://localhost:5432/testdb 2 | spring.datasource.username=postgres 3 | spring.datasource.password=root 4 | 5 | spring.sql.init.mode=always 6 | 7 | #Configure the xml Mapping path 8 | mybatis.mapper-locations=classpath:mapper/UserMapper.xml 9 | #Configure entity category names 10 | mybatis.type-aliases-package=com.knf.dev.demo.model -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-xml-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS users 2 | ( 3 | id SERIAL PRIMARY KEY, 4 | first_name varchar(255) not null, 5 | last_name varchar(255) not null, 6 | email_id varchar(255) not null 7 | ); -------------------------------------------------------------------------------- /spring-boot-postgresql-mybatis-xml-crud/src/test/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Application { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-rabbitmq-producer-consumer/consumer/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-rabbitmq-producer-consumer/consumer/src/main/java/com/knf/dev/demo/consumer/RabbitMQConsumer.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.consumer; 2 | 3 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class RabbitMQConsumer { 8 | 9 | 10 | @RabbitListener(queues = {"${rabbitmq.queue.name}"}) 11 | public void consume(String message){ 12 | 13 | System.out.println("Message arrived! Message: " + message); 14 | } 15 | } -------------------------------------------------------------------------------- /spring-boot-rabbitmq-producer-consumer/consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.rabbitmq.host=localhost 2 | spring.rabbitmq.port=5672 3 | spring.rabbitmq.username=guest 4 | spring.rabbitmq.password=guest 5 | 6 | rabbitmq.queue.name=knfQueue 7 | server.port=9080 8 | -------------------------------------------------------------------------------- /spring-boot-rabbitmq-producer-consumer/consumer/src/test/java/com/knf/dev/demo/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-rabbitmq-producer-consumer/producer/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-rabbitmq-producer-consumer/producer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.rabbitmq.host=localhost 2 | spring.rabbitmq.port=5672 3 | spring.rabbitmq.username=guest 4 | spring.rabbitmq.password=guest 5 | 6 | rabbitmq.queue.name=knfQueue 7 | rabbitmq.exchange.name=knfTopicExchange 8 | rabbitmq.routing.key=knfRoutingKey 9 | 10 | server.port=8081 -------------------------------------------------------------------------------- /spring-boot-rabbitmq-producer-consumer/producer/src/test/java/com/knf/dev/demo/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-security-jwt-auth-mongodb-master/src/main/java/com/knf/dev/models/ERole.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.models; 2 | 3 | public enum ERole { 4 | ROLE_EMPLOYEE, ROLE_ADMIN 5 | } 6 | -------------------------------------------------------------------------------- /spring-boot-security-jwt-auth-mongodb-master/src/main/java/com/knf/dev/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.repository; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.data.mongodb.repository.MongoRepository; 6 | 7 | import com.knf.dev.models.Employee; 8 | 9 | public interface EmployeeRepository extends MongoRepository { 10 | 11 | Optional findByEmployeename(String employeename); 12 | 13 | Boolean existsByEmployeename(String employeename); 14 | 15 | Boolean existsByEmail(String email); 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-security-jwt-auth-mongodb-master/src/main/java/com/knf/dev/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.repository; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.data.mongodb.repository.MongoRepository; 6 | 7 | import com.knf.dev.models.ERole; 8 | import com.knf.dev.models.Role; 9 | 10 | public interface RoleRepository extends MongoRepository { 11 | 12 | Optional findByName(ERole name); 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-security-jwt-auth-mongodb-master/src/main/java/com/knf/dev/response/MessageResponse.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.response; 2 | 3 | public class MessageResponse { 4 | private String message; 5 | 6 | public MessageResponse(String message) { 7 | this.message = message; 8 | } 9 | 10 | public String getMessage() { 11 | return message; 12 | } 13 | 14 | public void setMessage(String message) { 15 | this.message = message; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot-security-jwt-auth-mongodb-master/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | knf: 2 | app: 3 | jwtExpirationMs: 76300000 4 | jwtSecret: knowledgeFactory 5 | spring: 6 | data: 7 | mongodb: 8 | database: knfDemoDb 9 | host: localhost 10 | port: 27017 -------------------------------------------------------------------------------- /spring-boot-security-jwt-auth-mongodb-master/src/test/java/com/knf/dev/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev; 2 | 3 | import org.springframework.boot.test.context.SpringBootTest; 4 | 5 | @SpringBootTest 6 | class ApplicationTests { 7 | 8 | // @Test 9 | void contextLoads() { 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot-spring-data-jdbc-sqlserver-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-spring-data-jdbc-sqlserver-crud/src/main/java/com/knf/dev/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class ResourceNotFoundException extends RuntimeException{ 4 | private static final long serialVersionUID = 1L; 5 | 6 | public ResourceNotFoundException(String message) { 7 | super(message); 8 | } 9 | } -------------------------------------------------------------------------------- /spring-boot-spring-data-jdbc-sqlserver-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.model.User; 4 | import java.util.List; 5 | 6 | public interface UserRepository { 7 | 8 | public User findById(Long id); 9 | 10 | public List findAll(); 11 | 12 | public int insert(User user); 13 | 14 | public int update(User user); 15 | 16 | public int deleteById(Long id); 17 | } 18 | -------------------------------------------------------------------------------- /spring-boot-spring-data-jdbc-sqlserver-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url= jdbc:sqlserver://localhost:1433;databaseName=testdb; 2 | spring.datasource.username= knfuser 3 | spring.datasource.password= root 4 | 5 | spring.sql.init.mode=always -------------------------------------------------------------------------------- /spring-boot-spring-data-jdbc-sqlserver-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | IF OBJECT_ID(N'users', N'U') IS NULL 2 | CREATE TABLE users ( 3 | id INT NOT NULL IDENTITY PRIMARY KEY, 4 | first_name VARCHAR(100) NOT NULL, 5 | last_name VARCHAR(100), 6 | email VARCHAR(100) NOT NULL, 7 | ); -------------------------------------------------------------------------------- /spring-boot-spring-data-jdbc-sqlserver-crud/src/test/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Application { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-spring-data-jpa-sqlserver-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-spring-data-jpa-sqlserver-crud/src/main/java/com/knf/dev/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | public ResourceNotFoundException(String message) { 12 | super(message); 13 | } 14 | } -------------------------------------------------------------------------------- /spring-boot-spring-data-jpa-sqlserver-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.entity.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface UserRepository extends JpaRepository { 7 | 8 | } -------------------------------------------------------------------------------- /spring-boot-spring-data-jpa-sqlserver-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url= jdbc:sqlserver://localhost:1433;databaseName=testdb; 2 | spring.datasource.username= knfuser 3 | spring.datasource.password= root 4 | 5 | spring.jpa.hibernate.ddl-auto= update 6 | -------------------------------------------------------------------------------- /spring-boot-spring-data-jpa-sqlserver-crud/src/test/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Application { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-thymeleaf-zxing-qrcode/Readme.md: -------------------------------------------------------------------------------- 1 | More Info - https://www.knowledgefactory.net/2022/08/generate-qr-code-in-spring-boot-thymeleaf-application-with-zxing-example.html 2 | -------------------------------------------------------------------------------- /spring-boot-thymeleaf-zxing-qrcode/src/main/java/com/knf/dev/demo/QRCodeDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class QRCodeDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(QRCodeDemoApplication.class, args); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /spring-boot-thymeleaf-zxing-qrcode/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-boot-vaadin/src/main/java/com/knowledgefactory/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DemoApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-boot-vaadin/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-boot-vaadin/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin-demo/account/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: account 4 | server: 5 | port: 9091 -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin-demo/cart/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: cart 4 | server: 5 | port: 9092 -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin-demo/order/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: order 4 | server: 5 | port: 9093 -------------------------------------------------------------------------------- /spring-cloud-sleuth-zipkin-demo/product/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: product 4 | server: 5 | port: 9090 -------------------------------------------------------------------------------- /spring-controlleradvice-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-controlleradvice-example/src/main/java/com/knf/dev/demo/exception/UserNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | public class UserNotFoundException extends RuntimeException{ 7 | 8 | private static final long serialVersionUID = 1L; 9 | 10 | public UserNotFoundException(String message) { 11 | super(message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring-controlleradvice-example/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | 4 | import com.knf.dev.demo.entity.User; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository { 10 | 11 | } -------------------------------------------------------------------------------- /spring-controlleradvice-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-controlleradvice-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-get-post-put-delete-mapping-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-get-post-put-delete-mapping-example/src/main/java/com/knf/dev/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | 4 | public class ResourceNotFoundException extends RuntimeException{ 5 | 6 | private static final long serialVersionUID = 1L; 7 | 8 | public ResourceNotFoundException(String message) { 9 | super(message); 10 | } 11 | } -------------------------------------------------------------------------------- /spring-get-post-put-delete-mapping-example/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.entity.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface UserRepository extends JpaRepository { 9 | 10 | } -------------------------------------------------------------------------------- /spring-get-post-put-delete-mapping-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-get-post-put-delete-mapping-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-github-oauth2/src/main/java/com/knf/dev/demo/springoauth2github/Springoauth2GithubApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springoauth2github; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Springoauth2GithubApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Springoauth2GithubApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-github-oauth2/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | security: 3 | oauth2: 4 | client: 5 | registration: 6 | github: 7 | clientId: 8 | clientSecret: 9 | -------------------------------------------------------------------------------- /spring-github-oauth2/src/test/java/com/knf/dev/demo/springoauth2github/Springoauth2GithubApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springoauth2github; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Springoauth2GithubApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-google-oauth2/src/main/java/com/knf/dev/demo/SpringOauth2googleApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringOauth2googleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringOauth2googleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-google-oauth2/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | security: 3 | oauth2: 4 | client: 5 | registration: 6 | google: 7 | client-id: 8 | client-secret: 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spring-google-oauth2/src/test/java/com/knf/dev/demo/SpringOauth2googleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringOauth2googleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-groovy-jpa-crud/src/main/java/com/knf/dev/demo/springjpagroovycrud/SpringjpagroovycrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springjpagroovycrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringjpagroovycrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringjpagroovycrudApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-groovy-jpa-crud/src/main/java/com/knf/dev/demo/springjpagroovycrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springjpagroovycrud.repository; 2 | 3 | 4 | import com.knf.dev.demo.springjpagroovycrud.model.User; 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository 9 | public interface UserRepository extends CrudRepository { 10 | } -------------------------------------------------------------------------------- /spring-groovy-jpa-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #server.port:9080 2 | -------------------------------------------------------------------------------- /spring-groovy-jpa-crud/src/test/java/com/knf/dev/demo/springjpagroovycrud/SpringjpagroovycrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springjpagroovycrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringjpagroovycrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-interceptors/src/main/java/com/knf/dev/demo/SpringInterceptorsApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringInterceptorsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringInterceptorsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-interceptors/src/main/java/com/knf/dev/demo/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class TestController { 8 | 9 | @GetMapping("/hello") 10 | public String message() { 11 | return "Hello"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spring-interceptors/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-interceptors 2 | -------------------------------------------------------------------------------- /spring-interceptors/src/test/java/com/knf/dev/demo/SpringInterceptorsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringInterceptorsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-jdbcclient-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-jdbcclient-example/src/main/java/com/knf/dev/demo/model/Student.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.model; 2 | 3 | public record Student 4 | (Long id, 5 | String name, 6 | String email, 7 | Integer age, 8 | String gender ) {} -------------------------------------------------------------------------------- /spring-jdbcclient-example/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | #Real database(PostgreSQL) configuration 2 | spring: 3 | datasource: 4 | url: jdbc:postgresql://localhost:5432/postgres 5 | username: postgres 6 | password: root 7 | sql: 8 | init: 9 | mode: always -------------------------------------------------------------------------------- /spring-jdbcclient-example/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS students ( 2 | id SERIAL PRIMARY KEY, 3 | name VARCHAR(250) NOT NULL, 4 | email VARCHAR(250) NOT NULL, 5 | gender VARCHAR(250) NOT NULL, 6 | age INT 7 | ); 8 | -------------------------------------------------------------------------------- /spring-jdbcclient-example/src/main/resources/test-student-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO students (id,name, email, age, gender) VALUES 2 | (100,'Pro', 'pro@knf.com', 60, 'Male'), 3 | (101,'Alpha', 'alpha@knf.com', 50, 'Male'), 4 | (102,'Beta', 'beta@knf.com', 40, 'Female'), 5 | (103,'Gama', 'gama@knf.com', 30, 'Male'), 6 | (104,'Pekka', 'pekka@knf.com', 20, 'Female'), 7 | (105,'Noob', 'noob@knf.com', 10, 'Male'), 8 | (106,'Noob2', 'noob2@knf.com', 5, 'Male'), 9 | (107,'Noob3', 'noob3@knf.com', 5, 'Male'); -------------------------------------------------------------------------------- /spring-modelattribute-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-modelattribute-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-modelattribute-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-modelattribute-example/src/main/resources/templates/user.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User 6 | 7 | 8 | First Name:
9 | Last Name:
10 | Email: 11 | 12 | -------------------------------------------------------------------------------- /spring-okta-oauth2/src/main/java/com/knf/dev/demo/SpringOauth2OktaApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringOauth2OktaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringOauth2OktaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-okta-oauth2/src/main/java/com/knf/dev/demo/controller/WebController.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.controller; 2 | 3 | import java.security.Principal; 4 | 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | 8 | @Controller 9 | public class WebController { 10 | 11 | @GetMapping("/") 12 | public String index(Principal principal) { 13 | return "index"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-okta-oauth2/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | okta: 2 | oauth2: 3 | issuer: https:///oauth2/default 4 | client-secret: 5 | client-id: 6 | spring: 7 | thymeleaf: 8 | cache: 'false' 9 | -------------------------------------------------------------------------------- /spring-okta-oauth2/src/test/java/com/knf/dev/demo/SpringOauth2googleApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * package com.knf.dev.demo; 3 | * 4 | * import org.junit.jupiter.api.Test; import 5 | * org.springframework.boot.test.context.SpringBootTest; 6 | * 7 | * @SpringBootTest class SpringOauth2googleApplicationTests { 8 | * 9 | * @Test void contextLoads() { } 10 | * 11 | * } 12 | */ -------------------------------------------------------------------------------- /spring-pathvariable-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-pathvariable-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-pathvariable-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-quartz-joblistener-demo/src/main/java/com/example/demo/job/MySimpleJob.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.job; 2 | 3 | import org.quartz.Job; 4 | import org.quartz.JobExecutionContext; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import com.example.demo.service.TestService; 7 | 8 | public class MySimpleJob implements Job { 9 | 10 | @Autowired 11 | private TestService service; 12 | 13 | @Override 14 | public void execute(JobExecutionContext jobExecutionContext) { 15 | service.processData(); 16 | } 17 | } -------------------------------------------------------------------------------- /spring-quartz-joblistener-demo/src/main/java/com/example/demo/service/TestService.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.service; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.stereotype.Service; 6 | 7 | @Service 8 | public class TestService { 9 | 10 | private static final Logger LOG = LoggerFactory.getLogger(TestService.class); 11 | 12 | public void processData() { 13 | LOG.info("Inside Test Service"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /spring-quartz-joblistener-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | mysimplejob.frequency=500 2 | -------------------------------------------------------------------------------- /spring-quartz-joblistener-demo/src/main/resources/quartz.properties: -------------------------------------------------------------------------------- 1 | org.quartz.scheduler.instanceName=spring-quartz-demo 2 | org.quartz.scheduler.instanceId=AUTO 3 | org.quartz.threadPool.threadCount=10 4 | org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore -------------------------------------------------------------------------------- /spring-quartz-joblistener-demo/src/test/java/com/example/demo/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-requestbody-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-requestbody-example/src/main/java/com/knf/dev/demo/dto/User.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.dto; 2 | 3 | public class User { 4 | 5 | private String name; 6 | private String email; 7 | 8 | public String getName() { 9 | return name; 10 | } 11 | 12 | public void setName(String name) { 13 | this.name = name; 14 | } 15 | 16 | public String getEmail() { 17 | return email; 18 | } 19 | 20 | public void setEmail(String email) { 21 | this.email = email; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /spring-requestbody-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-requestbody-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-requestheader-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-requestheader-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-requestheader-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-requestparam-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-requestparam-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-requestparam-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-responsebody-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-responsebody-example/src/main/java/com/knf/dev/demo/dto/User.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.dto; 2 | 3 | public class User { 4 | 5 | private String name; 6 | private String email; 7 | 8 | public String getName() { 9 | return name; 10 | } 11 | 12 | public void setName(String name) { 13 | this.name = name; 14 | } 15 | 16 | public String getEmail() { 17 | return email; 18 | } 19 | 20 | public void setEmail(String email) { 21 | this.email = email; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /spring-responsebody-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-responsebody-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-responsestatus-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-responsestatus-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.error.include-message=always -------------------------------------------------------------------------------- /spring-restclient/spring-restclient-app/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | user.base.url = http://localhost:8080/api/v1/users 2 | spring.main.web-application-type=none 3 | -------------------------------------------------------------------------------- /spring-restclient/spring-restclient-app/src/test/java/com/knf/dev/demo/SpringRestclientAppApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringRestclientAppApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-restclient/user-management-demo/src/main/java/com/knf/dev/demo/UserManagementDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class UserManagementDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(UserManagementDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-restclient/user-management-demo/src/main/java/com/knf/dev/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | 4 | public class ResourceNotFoundException extends RuntimeException { 5 | 6 | private static final long serialVersionUID = 1L; 7 | 8 | public ResourceNotFoundException(String msg) { 9 | super(msg); 10 | } 11 | } -------------------------------------------------------------------------------- /spring-restclient/user-management-demo/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.entity.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface UserRepository extends JpaRepository { 7 | 8 | } -------------------------------------------------------------------------------- /spring-restclient/user-management-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-restclient/user-management-demo/src/test/java/com/knf/dev/demo/UserManagementDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class UserManagementDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-restontroller-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } -------------------------------------------------------------------------------- /spring-restontroller-example/src/main/java/com/knf/dev/demo/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.controller; 2 | 3 | import com.knf.dev.demo.dto.User; 4 | import org.springframework.web.bind.annotation.*; 5 | 6 | @RestController 7 | @RequestMapping("/api/v1") 8 | public class UserController { 9 | 10 | 11 | @GetMapping(value = "/users") 12 | public User getUser() { 13 | 14 | return new User("Sibin","India"); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spring-restontroller-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-restontroller-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-thymeleaf-crud-pagination/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.knf.dev.demo.domain.User; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository { 10 | 11 | } -------------------------------------------------------------------------------- /spring-thymeleaf-crud-pagination/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-thymeleaf-crud-pagination/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-webflux-filedownload/src/main/java/com/knf/dev/deno/springwebfluxfiledownload/SpringwebfluxfiledownloadApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.deno.springwebfluxfiledownload; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringwebfluxfiledownloadApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringwebfluxfiledownloadApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-webflux-filedownload/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-webflux-filedownload/src/main/resources/dummy.txt: -------------------------------------------------------------------------------- 1 | Dummy text......Dummy text......Dummy text...... -------------------------------------------------------------------------------- /spring-webflux-filedownload/src/test/java/com/knf/dev/deno/springwebfluxfiledownload/SpringwebfluxfiledownloadApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.deno.springwebfluxfiledownload; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringwebfluxfiledownloadApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-webflux-fileupload-download/src/main/java/com/knf/dev/demo/SpringwebfluxfileuploaddownloadApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringwebfluxfileuploaddownloadApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringwebfluxfileuploaddownloadApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-webflux-fileupload-download/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-webflux-fileupload-download/src/test/java/com/knf/dev/demo/SpringwebfluxfileuploaddownloadApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringwebfluxfileuploaddownloadApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-webflux-simplecrud-example/src/main/java/com/knf/dev/demo/springwebfluxsimplecrudexample/SpringwebfluxsimplecrudexampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springwebfluxsimplecrudexample; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringwebfluxsimplecrudexampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringwebfluxsimplecrudexampleApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spring-webflux-simplecrud-example/src/main/java/com/knf/dev/demo/springwebfluxsimplecrudexample/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springwebfluxsimplecrudexample.repository; 2 | 3 | import com.knf.dev.demo.springwebfluxsimplecrudexample.model.User; 4 | import org.springframework.data.repository.reactive.ReactiveCrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public 9 | interface UserRepository extends ReactiveCrudRepository { 10 | } 11 | -------------------------------------------------------------------------------- /spring-webflux-simplecrud-example/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | logging: 2 | level: 3 | org.springframework.data.r2dbc: DEBUG 4 | spring: 5 | r2dbc: 6 | url: r2dbc:h2:mem:///test?options=DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 7 | name: sa 8 | password: -------------------------------------------------------------------------------- /spring-webflux-simplecrud-example/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE USER ( 2 | ID INTEGER IDENTITY PRIMARY KEY , 3 | NAME VARCHAR(255) NOT NULL, 4 | EMAIL VARCHAR (255) NOT NULL 5 | ); -------------------------------------------------------------------------------- /spring-webflux-video-streaming-example/src/main/java/com/knf/demo/SpringWebfluxVideoStreamingExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringWebfluxVideoStreamingExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringWebfluxVideoStreamingExampleApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-webflux-video-streaming-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-webflux-video-streaming-example/src/main/resources/mp4/sample_960x540.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/spring-webflux-video-streaming-example/src/main/resources/mp4/sample_960x540.mp4 -------------------------------------------------------------------------------- /spring-webflux-video-streaming-example/src/test/java/com/knf/demo/SpringWebfluxVideoStreamingExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringWebfluxVideoStreamingExampleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-JPA-H2DB/src/main/java/com/knowledgefactory/Repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.Repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.knowledgefactory.Entity.User; 9 | @Repository 10 | public interface UserRepository extends CrudRepository { 11 | 12 | List findByName(String name); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-JPA-H2DB/src/main/java/com/knowledgefactory/VO/UserVo.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.VO; 2 | 3 | public class UserVo { 4 | 5 | private String name; 6 | private Long id; 7 | 8 | public String getName() { 9 | return name; 10 | } 11 | 12 | public void setName(String name) { 13 | this.name = name; 14 | } 15 | 16 | public Long getId() { 17 | return id; 18 | } 19 | 20 | public void setId(Long id) { 21 | this.id = id; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /springboot-JPA-H2DB/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework=INFO 2 | logging.level.com.knowledgefatory*=INFO 3 | logging.level.com.zaxxer=DEBUG 4 | logging.level.root=ERROR 5 | server.port=8081 -------------------------------------------------------------------------------- /springboot-JPA-HikariCp/src/main/java/com/knowledgefactory/Repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.Repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.knowledgefactory.Entity.User; 9 | @Repository 10 | public interface UserRepository extends CrudRepository { 11 | 12 | List findByName(String name); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-JPA-HikariCp/src/main/java/com/knowledgefactory/VO/UserVo.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.VO; 2 | 3 | public class UserVo { 4 | 5 | private String name; 6 | private Long id; 7 | 8 | public String getName() { 9 | return name; 10 | } 11 | 12 | public void setName(String name) { 13 | this.name = name; 14 | } 15 | 16 | public Long getId() { 17 | return id; 18 | } 19 | 20 | public void setId(Long id) { 21 | this.id = id; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /springboot-JPA-HikariCp/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework=INFO 2 | logging.level.com.knowledgefatory*=INFO 3 | logging.level.com.zaxxer=DEBUG 4 | logging.level.root=ERROR 5 | server.port=8081 6 | 7 | 8 | #connection pooling 9 | spring.datasource.hikari.connection-timeout=60000 10 | spring.datasource.hikari.maxLifetime=1700000 11 | spring.datasource.hikari.maximum-pool-size=5 -------------------------------------------------------------------------------- /springboot-JPA-TomcatCp/src/main/java/com/knowledgefactory/Repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.Repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.knowledgefactory.Entity.User; 9 | @Repository 10 | public interface UserRepository extends CrudRepository { 11 | 12 | List findByName(String name); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-JPA-TomcatCp/src/main/java/com/knowledgefactory/VO/UserVo.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.VO; 2 | 3 | public class UserVo { 4 | 5 | private String name; 6 | private Long id; 7 | 8 | public String getName() { 9 | return name; 10 | } 11 | 12 | public void setName(String name) { 13 | this.name = name; 14 | } 15 | 16 | public Long getId() { 17 | return id; 18 | } 19 | 20 | public void setId(Long id) { 21 | this.id = id; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /springboot-JPA-TomcatCp/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework=INFO 2 | logging.level.com.knowledgefatory*=INFO 3 | logging.level.com.zaxxer=DEBUG 4 | logging.level.root=ERROR 5 | server.port=8081 6 | 7 | 8 | #connection pooling 9 | spring.datasource.tomcat.initial-size=10 10 | spring.datasource.tomcat.max-wait=15000 11 | spring.datasource.tomcat.max-active=40 12 | spring.datasource.tomcat.max-idle=15 13 | spring.datasource.tomcat.min-idle=8 14 | spring.datasource.tomcat.default-auto-commit=true -------------------------------------------------------------------------------- /springboot-azure/spring-azure-app-config/src/main/java/com/knd/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knd.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | 7 | @SpringBootApplication 8 | public class Application { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(Application.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-app-config/src/main/resources/bootstrap.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | azure: 4 | appconfiguration: 5 | stores[0]: 6 | connection-string: 7 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-app-config/src/test/java/com/knd/dev/demo/SpringAzureAppConfigApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knd.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringAzureAppConfigApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/backend/spring-azure-storage-blob/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/backend/spring-azure-storage-blob/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | azure: 2 | storage: 3 | container: 4 | name: 5 | connection: 6 | string: 7 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/public/favicon.ico -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/public/logo192.png -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/public/logo512.png -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/src/App.css: -------------------------------------------------------------------------------- 1 | .dropzone { 2 | text-align: center; 3 | padding: 40px; 4 | border: 4px dashed #eeeeee; 5 | background-color: #fafafa; 6 | color: #bdbdbd; 7 | cursor: pointer; 8 | margin-bottom: 20px; 9 | } 10 | 11 | .selected-file-wrapper { 12 | text-align: center; 13 | } 14 | 15 | .selected-file { 16 | color: #000; 17 | font-weight: bold; 18 | } -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/src/Common.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | 3 | export default axios.create({ 4 | baseURL: "http://localhost:8080", 5 | headers: { 6 | "Content-type": "application/json" 7 | } 8 | }); -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import * as serviceWorker from './serviceWorker'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | serviceWorker.unregister(); 15 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-blob-react-file-handling/frontend/react-drag-drop-file-upload-download/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-cosmosdb-mongo-api-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-cosmosdb-mongo-api-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import org.springframework.data.mongodb.repository.MongoRepository; 4 | import com.knf.dev.demo.model.User; 5 | 6 | public interface UserRepository extends MongoRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-cosmosdb-mongo-api-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.mongodb.database= 2 | spring.data.mongodb.uri= -------------------------------------------------------------------------------- /springboot-azure/spring-azure-cosmosdb-mongo-api-crud/src/test/java/com/knf/dev/demo/SpringAzureCosmosdbMongoApiCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringAzureCosmosdbMongoApiCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-storage-blob/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-azure-storage-blob/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | azure: 2 | storage: 3 | container: 4 | name: 5 | connection: 6 | string: -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-cosmos-db-sql-api-crud/README.md: -------------------------------------------------------------------------------- 1 | # Build REST CRUD APIs with Spring Boot, Azure Cosmos DB and Azure Cosmos DB SQL API 2 | 3 | 4 | # Local setup 5 | 6 | Step 1: Download or clone the source code from GitHub to the local machine 7 | 8 | Step 2: ```mvn clean install``` 9 | 10 | Step 3: ```mvn spring-boot:run``` 11 | 12 | More Info - https://www.knowledgefactory.net/2022/07/build-rest-crud-apis-with-spring-boot-azure-cosmos-db-and-azure-cosmos-db-sql-api.html 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-cosmos-db-sql-api-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-cosmos-db-sql-api-crud/src/main/java/com/knf/dev/demo/exception/UnKnownException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class UnKnownException extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UnKnownException(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-cosmos-db-sql-api-crud/src/main/java/com/knf/dev/demo/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | public class UserNotFound extends RuntimeException { 3 | private static final long serialVersionUID = 1L; 4 | 5 | public UserNotFound(String msg) { 6 | super(msg); 7 | } 8 | } -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-cosmos-db-sql-api-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.azure.spring.data.cosmos.repository.CosmosRepository; 4 | import com.knf.dev.demo.entity.User; 5 | 6 | public interface UserRepository extends CosmosRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-cosmos-db-sql-api-crud/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | azure: 4 | cosmos: 5 | database: 6 | populate-query-metrics: true 7 | endpoint: 8 | key: 9 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-cosmos-db-sql-api-crud/src/test/java/com/knf/dev/demo/SpringBootAzureCosmosDbSqlApiCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAzureCosmosDbSqlApiCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-key-vault/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-key-vault/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | azure: 4 | keyvault: 5 | secret: 6 | property-source-enabled: true 7 | property-sources[0]: 8 | credential: 9 | client-secret: 10 | client-id: 11 | profile: 12 | tenant-id: 13 | endpoint: 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-key-vault/src/test/java/com/knf/dev/demo/SpringBootAzureKeyVaultApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAzureKeyVaultApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-mysql-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-mysql-crud/src/main/java/com/knf/dev/demo/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-mysql-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import com.knf.dev.demo.entity.User; 5 | 6 | public interface UserRepository extends CrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-mysql-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://:3306/test?createDatabaseIfNotExist=true 2 | spring.datasource.username=knfAdmin@knf-server 3 | spring.datasource.password= 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-mysql-crud/src/test/java/com/knf/dev/demo/SpringBootAzureMysqlCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAzureMysqlCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-postgresql-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-postgresql-crud/src/main/java/com/knf/dev/demo/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | public class UserNotFound extends RuntimeException { 3 | private static final long serialVersionUID = 1L; 4 | 5 | public UserNotFound(String msg) { 6 | super(msg); 7 | } 8 | } -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-postgresql-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import com.knf.dev.demo.entity.User; 5 | 6 | public interface UserRepository extends CrudRepository { 7 | 8 | } -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-postgresql-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url= jdbc:postgresql://:5432/postgres 2 | spring.datasource.username= knfadmin@knowledgefactory-poc 3 | spring.datasource.password= 4 | spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation= true 5 | spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.PostgreSQLDialect 6 | 7 | spring.jpa.hibernate.ddl-auto=update 8 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-postgresql-crud/src/test/java/com/knf/dev/demo/SpringBootAzurePostgresqlCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAzurePostgresqlCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-sql-crud/src/main/java/com/knf/dev/demo/springbootazuresqlcrud/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootazuresqlcrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-sql-crud/src/main/java/com/knf/dev/demo/springbootazuresqlcrud/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootazuresqlcrud.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-sql-crud/src/main/java/com/knf/dev/demo/springbootazuresqlcrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootazuresqlcrud.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.knf.dev.demo.springbootazuresqlcrud.entity.User; 6 | 7 | public interface UserRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-sql-crud/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | username: 4 | password: 5 | url: jdbc:sqlserver://:1433;database=demo_db;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30; 6 | jpa: 7 | show-sql: 'true' 8 | hibernate: 9 | ddl-auto: update 10 | logging: 11 | level: 12 | org: 13 | hibernate: 14 | SQL: DEBUG 15 | -------------------------------------------------------------------------------- /springboot-azure/spring-boot-azure-sql-crud/src/test/java/com/knf/dev/demo/springbootazuresqlcrud/SpringBootAzureSqlCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootazuresqlcrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootAzureSqlCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-mysql-crud/README.md: -------------------------------------------------------------------------------- 1 | # Local setup 2 | 3 | Step 1: Download or clone the source code from GitHub to the local machine 4 | 5 | Step 2: ```mvn clean install``` 6 | 7 | Step 3: ```mvn spring-boot:run``` 8 | -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/SpringDataJdbcAzureMysqlCrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringDataJdbcAzureMysqlCrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringDataJdbcAzureMysqlCrudApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/exception/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | import java.util.Date; 4 | 5 | public record ErrorMessage 6 | (Integer statusCode, 7 | Date timestamp, 8 | String message, 9 | String description) { 10 | } -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.model.User; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface UserRepository extends CrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-mysql-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | logging.level.org.springframework.jdbc.core=DEBUG 3 | 4 | spring.datasource.url=jdbc:mysql://.mysql.database.azure.com:3306/test?createDatabaseIfNotExist=true 5 | spring.datasource.username=knfAdmin@knf-server 6 | spring.datasource.password= 7 | 8 | spring.sql.init.mode=always -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-mysql-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS user; 2 | 3 | CREATE TABLE user ( 4 | id serial PRIMARY KEY, 5 | first_name VARCHAR ( 50 ) NOT NULL, 6 | last_name VARCHAR ( 50 ) NOT NULL, 7 | email VARCHAR ( 255 ) NOT NULL 8 | ); -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-mysql-crud/src/test/java/com/knf/dev/demo/SpringDataJdbcAzureMysqlCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringDataJdbcAzureMysqlCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-postgres-crud/README.md: -------------------------------------------------------------------------------- 1 | # Local setup 2 | 3 | Step 1: Download or clone the source code from GitHub to the local machine 4 | 5 | Step 2: ```mvn clean install``` 6 | 7 | Step 3: ```mvn spring-boot:run```a 8 | -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-postgres-crud/src/main/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-postgres-crud/src/main/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/exception/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud.exception; 2 | 3 | import java.util.Date; 4 | 5 | public record ErrorMessage 6 | (Integer statusCode, 7 | Date timestamp, 8 | String message, 9 | String description) { 10 | } -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-postgres-crud/src/main/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-postgres-crud/src/main/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud.repository; 2 | 3 | 4 | import com.knf.dev.demo.springdatajdbcazurepostgrescrud.model.User; 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | public interface UserRepository extends CrudRepository { 8 | 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-postgres-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.jdbc.core=DEBUG 2 | 3 | spring.datasource.url=jdbc:postgresql://:5432/postgres 4 | spring.datasource.username= 5 | spring.datasource.password= 6 | 7 | spring.sql.init.mode=always 8 | -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-postgres-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS users; 2 | 3 | CREATE TABLE users ( 4 | id serial PRIMARY KEY, 5 | first_name VARCHAR ( 50 ) NOT NULL, 6 | last_name VARCHAR ( 50 ) NOT NULL, 7 | email VARCHAR ( 255 ) NOT NULL 8 | ); -------------------------------------------------------------------------------- /springboot-azure/spring-data-jdbc-azure-postgres-crud/src/test/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/SpringDataJdbcAzurePostgresCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringDataJdbcAzurePostgresCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/README.md: -------------------------------------------------------------------------------- 1 | # Local setup 2 | 3 | Step 1: Download or clone the source code from GitHub to the local machine 4 | 5 | Step 2: ```mvn clean install``` 6 | 7 | Step 3: ```mvn spring-boot:run```a 8 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/src/main/java/com/knf/dev/demo/exception/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | import java.util.Date; 4 | 5 | public record ErrorMessage 6 | (Integer statusCode, 7 | Date timestamp, 8 | String message, 9 | String description) { 10 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/src/main/java/com/knf/dev/demo/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/src/main/java/com/knf/dev/demo/model/User.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.model; 2 | 3 | public record User 4 | (Long id, 5 | String firstName, 6 | String lastName, 7 | String email) { 8 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.model.User; 4 | 5 | import java.util.List; 6 | 7 | public interface UserRepository { 8 | 9 | public User findOne(Long id); 10 | 11 | public List findAll(); 12 | 13 | public void save(User user); 14 | 15 | public Long saveAndReturnId(User user); 16 | 17 | public void update(User user); 18 | 19 | public Boolean delete(Long id); 20 | 21 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.jdbc.core=DEBUG 2 | 3 | spring.datasource.url=jdbc:sqlserver://.database.windows.net:1433;database=demo_db;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30; 4 | spring.datasource.username= 5 | spring.datasource.password= 6 | 7 | spring.sql.init.mode=always -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS users; 2 | 3 | CREATE TABLE users ( 4 | id INT IDENTITY PRIMARY KEY, 5 | first_name VARCHAR ( 50 ) NOT NULL, 6 | last_name VARCHAR ( 50 ) NOT NULL, 7 | email VARCHAR ( 255 ) NOT NULL 8 | ); -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-api-azure-sql-crud/src/test/java/com/knf/dev/demo/SpringJdbcApiAzureSqlCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringJdbcApiAzureSqlCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/README.md: -------------------------------------------------------------------------------- 1 | # Local setup 2 | 3 | Step 1: Download or clone the source code from GitHub to the local machine 4 | 5 | Step 2: ```mvn clean install``` 6 | 7 | Step 3: ```mvn spring-boot:run``` 8 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/SpringJdbcAzureMysqlCrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringJdbcAzureMysqlCrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringJdbcAzureMysqlCrudApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/exception/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | import java.util.Date; 4 | 5 | public record ErrorMessage 6 | (Integer statusCode, 7 | Date timestamp, 8 | String message, 9 | String description) { 10 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/model/User.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.model; 2 | 3 | public record User 4 | (Long id, 5 | String firstName, 6 | String lastName, 7 | String email) { 8 | } 9 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.knf.dev.demo.model.User; 4 | import java.util.List; 5 | 6 | public interface UserRepository { 7 | 8 | public User findOne(Long id); 9 | 10 | public List findAll(); 11 | 12 | public void save(User user); 13 | 14 | public Long saveAndReturnId(User user); 15 | 16 | public void update(User user); 17 | 18 | public Boolean delete(Long id); 19 | 20 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.org.springframework.jdbc.core=DEBUG 2 | 3 | spring.datasource.url=jdbc:mysql://.mysql.database.azure.com:3306/test?createDatabaseIfNotExist=true 4 | spring.datasource.username=knfAdmin@knf-server 5 | spring.datasource.password= 6 | 7 | spring.sql.init.mode=always -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS users; 2 | 3 | CREATE TABLE users ( 4 | id serial PRIMARY KEY, 5 | first_name VARCHAR ( 50 ) NOT NULL, 6 | last_name VARCHAR ( 50 ) NOT NULL, 7 | email VARCHAR ( 255 ) NOT NULL 8 | ); -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-mysql-crud/src/test/java/com/knf/dev/demo/SpringJdbcAzureMysqlCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringJdbcAzureMysqlCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-postgres-crud/README.md: -------------------------------------------------------------------------------- 1 | # Local setup 2 | 3 | Step 1: Download or clone the source code from GitHub to the local machine 4 | 5 | Step 2: ```mvn clean install``` 6 | 7 | Step 3: ```mvn spring-boot:run``` 8 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-postgres-crud/src/main/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/exception/ErrorMessage.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud.exception; 2 | 3 | import java.util.Date; 4 | 5 | public record ErrorMessage 6 | (Integer statusCode, 7 | Date timestamp, 8 | String message, 9 | String description) { 10 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-postgres-crud/src/main/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/exception/UserNotFound.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud.exception; 2 | 3 | public class UserNotFound extends RuntimeException { 4 | private static final long serialVersionUID = 1L; 5 | 6 | public UserNotFound(String msg) { 7 | super(msg); 8 | } 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-postgres-crud/src/main/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/model/User.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud.model; 2 | 3 | public record User 4 | (Long id, 5 | String firstName, 6 | String lastName, 7 | String email) { 8 | } 9 | -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-postgres-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url= jdbc:postgresql:///postgres 2 | spring.datasource.username= 3 | spring.datasource.password= 4 | 5 | spring.sql.init.mode=always -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-postgres-crud/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS users; 2 | 3 | CREATE TABLE users ( 4 | id serial PRIMARY KEY, 5 | first_name VARCHAR ( 50 ) NOT NULL, 6 | last_name VARCHAR ( 50 ) NOT NULL, 7 | email VARCHAR ( 255 ) NOT NULL 8 | ); -------------------------------------------------------------------------------- /springboot-azure/spring-jdbc-azure-postgres-crud/src/test/java/com/knf/dev/demo/springdatajdbcazurepostgrescrud/SpringDataJdbcAzurePostgresCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springdatajdbcazurepostgrescrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringDataJdbcAzurePostgresCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-webflux-azure-cosmos-db-sql-api-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-webflux-azure-cosmos-db-sql-api-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository; 4 | import com.knf.dev.demo.model.User; 5 | 6 | public interface UserRepository extends ReactiveCosmosRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /springboot-azure/spring-webflux-azure-cosmos-db-sql-api-crud/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | azure: 4 | cosmos: 5 | database: knowledgehub 6 | populate-query-metrics: true 7 | endpoint: https://knowledgefactory.documents.azure.com:443/ 8 | key: hV5R1OBe67B9859yVQ1b71HOjSEH7ozYrJmENavBRVDhtLyB6jl8zSlqYvZtKWx9OMa0EvDZJNTYii0AXRgk1Q== -------------------------------------------------------------------------------- /springboot-azure/spring-webflux-azure-cosmos-db-sql-api-crud/src/test/java/com/knf/dev/demo/SpringWebfluxAzureCosmosDbSqlApiCrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringWebfluxAzureCosmosDbSqlApiCrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-webflux-cosmosdb-mongo-api-crud/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/spring-webflux-cosmosdb-mongo-api-crud/src/main/java/com/knf/dev/demo/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import org.springframework.data.mongodb.repository.ReactiveMongoRepository; 4 | import com.knf.dev.demo.model.User; 5 | 6 | public interface UserRepository 7 | extends ReactiveMongoRepository { 8 | 9 | } -------------------------------------------------------------------------------- /springboot-azure/spring-webflux-cosmosdb-mongo-api-crud/src/main/java/com/knf/dev/demo/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.service; 2 | 3 | import com.knf.dev.demo.model.User; 4 | import reactor.core.publisher.Flux; 5 | import reactor.core.publisher.Mono; 6 | 7 | public interface UserService { 8 | 9 | Mono save(User user); 10 | 11 | Mono delete(String id); 12 | 13 | Mono update(String id, User user); 14 | 15 | Flux findAll(); 16 | 17 | Mono findById(String id); 18 | } -------------------------------------------------------------------------------- /springboot-azure/spring-webflux-cosmosdb-mongo-api-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.mongodb.database=knowledgefactorydb 2 | spring.data.mongodb.uri=mongodb://knowledgefactory-poc:Bv0TX956l568s2pk7IhCumgWzIzt6oDeV6QVkMgHr84dSzTF9CMIFeoekKk6oCGCbDuTE9BUI4dmdKKI6KDrUw==@knowledgefactory-poc.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@knowledgefactory-poc@ -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/public/favicon.ico -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/public/logo192.png -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/public/logo512.png -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/src/App.css: -------------------------------------------------------------------------------- 1 | .list .action { 2 | cursor: pointer; 3 | } 4 | 5 | .submit-form { 6 | max-width: 4ex; 7 | margin: auto; 8 | } 9 | 10 | .edit-form { 11 | max-width: 400px; 12 | margin: auto; 13 | } -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/src/http-common.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | 3 | export default axios.create({ 4 | baseURL: "http://localhost:8080/api/v1", 5 | headers: { 6 | "Content-type": "application/json" 7 | } 8 | }); -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import { BrowserRouter } from "react-router-dom"; 4 | 5 | import App from "./App"; 6 | import reportWebVitals from './reportWebVitals'; 7 | 8 | ReactDOM.render( 9 | 10 | 11 | , 12 | document.getElementById("root") 13 | ); 14 | 15 | reportWebVitals(); 16 | -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/react-datatable-pagination/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/springboot-azure-sql-crud-pagination/src/main/java/com/knf/dev/demo/springbootpagination/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootpagination.exception; 2 | 3 | public class ResourceNotFoundException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public ResourceNotFoundException(String message) { 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/springboot-azure-sql-crud-pagination/src/main/java/com/knf/dev/demo/springbootpagination/exception/ServerError.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootpagination.exception; 2 | 3 | public class ServerError extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public ServerError(String message) { 8 | super(message); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/springboot-azure-sql-crud-pagination/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | username: 4 | password: 5 | url: jdbc:sqlserver://:1433;database=demo_db;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30; 6 | jpa: 7 | show-sql: 'true' 8 | hibernate: 9 | ddl-auto: update 10 | logging: 11 | level: 12 | org: 13 | hibernate: 14 | SQL: DEBUG -------------------------------------------------------------------------------- /springboot-azure/springboot-jpa-azure-sql-react-table-pagination/springboot-azure-sql-crud-pagination/src/test/java/com/knf/dev/demo/springbootpagination/SpringbootPaginationApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootpagination; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootPaginationApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-custom-exception/src/main/java/com/example/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DemoApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /springboot-custom-exception/src/main/java/com/example/demo/exception/CustomerNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.exception; 2 | 3 | public class CustomerNotFoundException extends RuntimeException { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public CustomerNotFoundException() { 11 | super("Customer Not Found"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /springboot-datable-pagination/src/main/java/com/knf/dev/demo/springbootdatablepagination/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatablepagination; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-datable-pagination/src/main/java/com/knf/dev/demo/springbootdatablepagination/vo/Vo.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootdatablepagination.vo; 2 | 3 | import java.util.List; 4 | 5 | public class Vo { 6 | private List data; 7 | 8 | public List getData() { 9 | return data; 10 | } 11 | 12 | public void setData(List data) { 13 | this.data = data; 14 | } 15 | } -------------------------------------------------------------------------------- /springboot-datable-pagination/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #server.port:9080 2 | -------------------------------------------------------------------------------- /springboot-datable-pagination/src/main/resources/static/js/controller.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('#example').DataTable( { 3 | "ajax": 'getcall' 4 | } ); 5 | } ); -------------------------------------------------------------------------------- /springboot-embeddedserver-undertow/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-embeddedserver-undertow/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 -------------------------------------------------------------------------------- /springboot-export-csv-apache-commons/src/main/java/com/example/demo/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.example.demo.model.Employee; 6 | 7 | public interface EmployeeRepository extends CrudRepository { 8 | 9 | } -------------------------------------------------------------------------------- /springboot-export-csv-apache-commons/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:h2:mem:knfdb 2 | spring.datasource.driverClassName=org.h2.Driver 3 | spring.datasource.username=sa 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 6 | logging.level.org.hibernate.SQL=DEBUG 7 | logging.level.org.hibernate.type=TRACE 8 | spring.h2.console.enabled=true 9 | -------------------------------------------------------------------------------- /springboot-export-csv-demo/src/main/java/com/example/demo/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.example.demo.model.Employee; 6 | 7 | public interface EmployeeRepository extends CrudRepository { 8 | 9 | } -------------------------------------------------------------------------------- /springboot-export-csv-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:h2:mem:knfdb 2 | spring.datasource.driverClassName=org.h2.Driver 3 | spring.datasource.username=sa 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 6 | logging.level.org.hibernate.SQL=DEBUG 7 | logging.level.org.hibernate.type=TRACE 8 | spring.h2.console.enabled=true 9 | -------------------------------------------------------------------------------- /springboot-export-pdf/src/main/java/com/knf/dev/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.knf.dev.model.Employee; 6 | 7 | public interface EmployeeRepository extends CrudRepository { 8 | } -------------------------------------------------------------------------------- /springboot-export-pdf/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-export-pdf/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-fileupload-filedownload/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | 7 | @SpringBootApplication 8 | public class KnowledgefactorydemoApplication { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-fileupload-filedownload/src/main/java/com/knowledgefactory/knowledgefactorydemo/controller/WebController.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | @Controller 7 | public class WebController { 8 | 9 | @GetMapping("/") 10 | public String index() { 11 | return "index"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /springboot-fileupload-filedownload/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | spring.servlet.multipart.enabled=true 3 | # Threshold after which files are written to disk. 4 | spring.servlet.multipart.file-size-threshold=2KB 5 | # Max file size. 6 | spring.servlet.multipart.max-file-size=200MB 7 | # Max Request Size 8 | spring.servlet.multipart.max-request-size=215MB 9 | 10 | 11 | -------------------------------------------------------------------------------- /springboot-freemaker/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-freemaker/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.freemarker.template-loader-path: classpath:/templates 2 | spring.freemarker.suffix: .ftl 3 | -------------------------------------------------------------------------------- /springboot-freemaker/src/main/resources/templates/index.ftl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello ${name}! 6 | 7 | 8 | 9 |

Hello ${name}!

10 | 11 | 12 | -------------------------------------------------------------------------------- /springboot-freemarker-jpa-crud/src/main/java/com/knf/dev/demo/springbootfreemarkerjpacrud/SpringbootfreemarkerjpacrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootfreemarkerjpacrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootfreemarkerjpacrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootfreemarkerjpacrudApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-freemarker-jpa-crud/src/main/java/com/knf/dev/demo/springbootfreemarkerjpacrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootfreemarkerjpacrud.repository; 2 | 3 | import com.knf.dev.demo.springbootfreemarkerjpacrud.model.User; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface UserRepository extends CrudRepository { 9 | 10 | } -------------------------------------------------------------------------------- /springboot-freemarker-jpa-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springboot-freemarker-jpa-crud/src/test/java/com/knf/dev/demo/springbootfreemarkerjpacrud/SpringbootfreemarkerjpacrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootfreemarkerjpacrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootfreemarkerjpacrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-graphql-crud-example/src/main/java/com/knf/dev/demo/SpringGraphqlCrudExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringGraphqlCrudExampleApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication. 11 | run(SpringGraphqlCrudExampleApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-graphql-crud-example/src/main/java/com/knf/dev/demo/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import com.knf.dev.demo.entity.Author; 5 | 6 | public interface AuthorRepository extends JpaRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /springboot-graphql-crud-example/src/main/java/com/knf/dev/demo/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import com.knf.dev.demo.entity.Book; 5 | 6 | public interface BookRepository extends JpaRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /springboot-graphql-crud-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springboot-hystrix/spring-rest-hystrix-consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9091 -------------------------------------------------------------------------------- /springboot-hystrix/springboot-rest-producer/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-hystrix/springboot-rest-producer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9094 -------------------------------------------------------------------------------- /springboot-interceptor-demo/src/main/java/com/knf/dev/SpringbootInterceptorDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootInterceptorDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootInterceptorDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-interceptor-demo/src/main/java/com/knf/dev/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HomeController { 8 | 9 | @GetMapping("/hello") 10 | public String getHello() { 11 | return "you are done"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-interceptor-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springboot-jetty-embeddedserver/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-jetty-embeddedserver/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-jetty-embeddedserver/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-jpa-hibernate-manytomany-mapping/src/main/java/com/knf/dev/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.knf.dev.model.Book; 9 | 10 | @Repository 11 | public interface BookRepository extends JpaRepository { 12 | List findByIsbn(String isbn); 13 | 14 | } -------------------------------------------------------------------------------- /springboot-jpa-hibernate-manytomany-mapping/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:h2:mem:knfdb 2 | spring.datasource.driverClassName=org.h2.Driver 3 | spring.datasource.username=sa 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 6 | logging.level.org.hibernate.SQL=DEBUG 7 | logging.level.org.hibernate.type=TRACE 8 | spring.h2.console.enabled=true 9 | spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true -------------------------------------------------------------------------------- /springboot-jpa-hibernate-onetomany-mapping/src/main/java/com/example/demo/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.example.demo.model.Employee; 9 | 10 | @Repository 11 | public interface EmployeeRepository extends JpaRepository { 12 | List findByName(String name); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-jpa-hibernate-onetomany-mapping/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:h2:mem:knfdb 2 | spring.datasource.driverClassName=org.h2.Driver 3 | spring.datasource.username=sa 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 6 | logging.level.org.hibernate.SQL=DEBUG 7 | logging.level.org.hibernate.type=TRACE 8 | spring.h2.console.enabled=true -------------------------------------------------------------------------------- /springboot-jpa-hibernate-onetomany-mapping/src/test/java/com/example/demo/SpringbootJpaHibernateOnetoonemappingApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * package com.example.demo; 3 | * 4 | * import org.junit.jupiter.api.Test; import 5 | * org.springframework.boot.test.context.SpringBootTest; 6 | * 7 | * @SpringBootTest class SpringbootJpaHibernateOnetoonemappingApplicationTests { 8 | * 9 | * @Test void contextLoads() { } 10 | * 11 | * } 12 | */ -------------------------------------------------------------------------------- /springboot-jpa-hibernate-onetoone-mapping/src/main/java/com/example/demo/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.example.demo.model.Employee; 9 | 10 | @Repository 11 | public interface EmployeeRepository extends JpaRepository { 12 | List findByName(String name); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-jpa-hibernate-onetoone-mapping/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:h2:mem:testdb 2 | spring.datasource.driverClassName=org.h2.Driver 3 | spring.datasource.username=sa 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 6 | logging.level.org.hibernate.SQL=DEBUG 7 | logging.level.org.hibernate.type=TRACE -------------------------------------------------------------------------------- /springboot-jpa-hibernate-onetoone-mapping/src/test/java/com/example/demo/SpringbootJpaHibernateOnetoonemappingApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * package com.example.demo; 3 | * 4 | * import org.junit.jupiter.api.Test; import 5 | * org.springframework.boot.test.context.SpringBootTest; 6 | * 7 | * @SpringBootTest class SpringbootJpaHibernateOnetoonemappingApplicationTests { 8 | * 9 | * @Test void contextLoads() { } 10 | * 11 | * } 12 | */ -------------------------------------------------------------------------------- /springboot-microsoft-word/src/main/java/com/knf/dev/demo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | 8 | public class KnowledgefactorydemoApplication { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-microsoft-word/src/main/resources/spring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-microsoft-word/src/main/resources/spring.png -------------------------------------------------------------------------------- /springboot-mustache-crud/src/main/java/com/knf/dev/demo/springbootjpamustachecrud/SpringbootjpamustachecrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjpamustachecrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootjpamustachecrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication 11 | .run(SpringbootjpamustachecrudApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /springboot-mustache-crud/src/main/java/com/knf/dev/demo/springbootjpamustachecrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjpamustachecrud.repository; 2 | 3 | import com.knf.dev.demo.springbootjpamustachecrud.model.User; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface UserRepository extends CrudRepository { 9 | } 10 | -------------------------------------------------------------------------------- /springboot-mustache-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-mustache-crud/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-mustache-crud/src/test/java/com/knf/dev/demo/springbootjpamustachecrud/SpringbootjpamustachecrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjpamustachecrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootjpamustachecrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mustache-jpa-crud/src/main/java/com/knf/dev/demo/springbootjpamustachecrud/SpringbootjpamustachecrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjpamustachecrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootjpamustachecrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootjpamustachecrudApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mustache-jpa-crud/src/main/java/com/knf/dev/demo/springbootjpamustachecrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjpamustachecrud.repository; 2 | 3 | import com.knf.dev.demo.springbootjpamustachecrud.model.User; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface UserRepository extends CrudRepository { 9 | } -------------------------------------------------------------------------------- /springboot-mustache-jpa-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #server.port=8081 -------------------------------------------------------------------------------- /springboot-mustache-jpa-crud/src/test/java/com/knf/dev/demo/springbootjpamustachecrud/SpringbootjpamustachecrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootjpamustachecrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootjpamustachecrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mustache/src/main/java/com/knowledgefactory/knowledgefactorydemo/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | 7 | @Controller 8 | public class HomeController { 9 | 10 | @GetMapping({ "/", "/welcome" }) 11 | public String hello(Model model) { 12 | 13 | return "index"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /springboot-mustache/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mustache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mustache.suffix:.html 2 | -------------------------------------------------------------------------------- /springboot-mustache/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello Mustache 6 | 7 | 8 | 9 |

Hello Mustache

10 | 11 | 12 | -------------------------------------------------------------------------------- /springboot-mybatis-crud-example/src/main/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-mybatis-crud-example/src/main/java/com/knf/dev/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.exception; 2 | 3 | public class ResourceNotFoundException extends RuntimeException{ 4 | private static final long serialVersionUID = 1L; 5 | 6 | public ResourceNotFoundException(String message) { 7 | super(message); 8 | } 9 | } -------------------------------------------------------------------------------- /springboot-mybatis-crud-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springboot-mybatis-crud-example/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | create table users 2 | ( 3 | id IDENTITY NOT NULL PRIMARY KEY , 4 | first_name VARCHAR(255) NOT NULL, 5 | last_name VARCHAR(255) NOT NULL, 6 | email_id VARCHAR(255) NOT NULL 7 | ); -------------------------------------------------------------------------------- /springboot-mybatis-crud-example/src/test/java/com/knf/dev/demo/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class Application { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-rest-xml-crud/src/main/java/com/knf/springbootrestxml/SpringbootrestxmlApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.springbootrestxml; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootrestxmlApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootrestxmlApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-rest-xml-crud/src/main/java/com/knf/springbootrestxml/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.springbootrestxml.repository; 2 | 3 | import java.util.List; 4 | 5 | import com.knf.springbootrestxml.model.Book; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | public interface BookRepository extends JpaRepository { 9 | List findByTitleContaining(String title); 10 | } 11 | -------------------------------------------------------------------------------- /springboot-rest-xml-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springboot-rest-xml-crud/src/test/java/com/knf/springbootrestxml/SpringbootrestxmlApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.springbootrestxml; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootrestxmlApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-rest/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-rest/src/main/java/com/knowledgefactory/knowledgefactorydemo/UserVo.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | public class UserVo { 4 | 5 | private String name; 6 | private String email; 7 | public String getName() { 8 | return name; 9 | } 10 | public void setName(String name) { 11 | this.name = name; 12 | } 13 | public String getEmail() { 14 | return email; 15 | } 16 | public void setEmail(String email) { 17 | this.email = email; 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /springboot-rest/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springboot-restemplate-example/springboot-rest-consumer/src/main/java/com/knowledgefactory/knowledgefactorydemo/Key.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | public class Key { 4 | 5 | private Integer key; 6 | 7 | public Integer getKey() { 8 | return key; 9 | } 10 | 11 | public void setKey(Integer key) { 12 | this.key = key; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-restemplate-example/springboot-rest-consumer/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-restemplate-example/springboot-rest-consumer/src/main/java/com/knowledgefactory/knowledgefactorydemo/User.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | public class User { 4 | 5 | private String name; 6 | private String mail; 7 | 8 | public String getName() { 9 | return name; 10 | } 11 | 12 | public void setName(String name) { 13 | this.name = name; 14 | } 15 | 16 | public String getMail() { 17 | return mail; 18 | } 19 | 20 | public void setMail(String mail) { 21 | this.mail = mail; 22 | } 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /springboot-restemplate-example/springboot-rest-consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9091 -------------------------------------------------------------------------------- /springboot-restemplate-example/springboot-rest-producer/src/main/java/com/knowledgefactory/knowledgefactorydemo/Key.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | public class Key { 4 | 5 | private Integer key; 6 | 7 | public Integer getKey() { 8 | return key; 9 | } 10 | 11 | public void setKey(Integer key) { 12 | this.key = key; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /springboot-restemplate-example/springboot-rest-producer/src/main/java/com/knowledgefactory/knowledgefactorydemo/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.knowledgefactorydemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-restemplate-example/springboot-rest-producer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9094 -------------------------------------------------------------------------------- /springboot-scheduled-task-demo/src/main/java/com/knowledgefactory/KnowledgefactoryScheduler.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableScheduling; 6 | 7 | @SpringBootApplication 8 | @EnableScheduling 9 | public class KnowledgefactoryScheduler { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(KnowledgefactoryScheduler.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /springboot-scheduled-task-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-scheduled-task-demo/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-send-email/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mail.host=smtp.gmail.com 2 | spring.mail.port=587 3 | spring.mail.username= 4 | spring.mail.password= 5 | spring.mail.properties.mail.smtp.auth=true 6 | spring.mail.properties.mail.smtp.starttls.enable=true 7 | -------------------------------------------------------------------------------- /springboot-send-email/src/test/java/com/knf/sibin/dev/emaildemo/EmailDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.sibin.dev.emaildemo; 2 | 3 | //import org.junit.jupiter.api.Test; 4 | //import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | //@SpringBootTest 7 | class EmailDemoApplicationTests { 8 | 9 | // @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-swagger/src/main/resources/application.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-swagger/src/main/resources/application.yaml -------------------------------------------------------------------------------- /springboot-thymeleaf-jpa-crud/src/main/java/com/knowledgefactory/Application.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-thymeleaf-jpa-crud/src/main/java/com/knowledgefactory/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.knowledgefactory.entity.User; 9 | 10 | @Repository 11 | public interface UserRepository extends CrudRepository { 12 | 13 | List findAll(); 14 | } 15 | -------------------------------------------------------------------------------- /springboot-thymeleaf-jpa-crud/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-thymeleaf-jpa-crud/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-videostream/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-videostream/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-webflux-reactivemonogo/src/main/java/com/knf/reactivestack/dev/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.reactivestack.dev.repository; 2 | 3 | import org.springframework.data.mongodb.repository.ReactiveMongoRepository; 4 | 5 | import com.knf.reactivestack.dev.domain.User; 6 | 7 | public interface UserRepository extends ReactiveMongoRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /springboot-webflux-reactivemonogo/src/main/java/com/knf/reactivestack/dev/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.knf.reactivestack.dev.service; 2 | 3 | import com.knf.reactivestack.dev.domain.User; 4 | 5 | import reactor.core.publisher.Flux; 6 | import reactor.core.publisher.Mono; 7 | 8 | public interface UserService { 9 | Mono save(User user); 10 | 11 | Mono delete(String id); 12 | 13 | Mono update(String id, User user); 14 | 15 | Flux findAll(); 16 | 17 | Mono findById(String id); 18 | } 19 | -------------------------------------------------------------------------------- /springboot-webflux-reactivemonogo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.mongodb.uri=mongodb://localhost:27017/users 2 | 3 | 4 | -------------------------------------------------------------------------------- /springboot-webflux-reactivemonogo/src/test/java/com/knf/reactivestack/dev/MainApplicationTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.knf.reactivestack.dev; 5 | 6 | /** 7 | * @author sibinmuhammed 8 | * 9 | */ 10 | public class MainApplicationTest { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /springboot-websocket-example/src/main/java/com/knowledgefactory/KnowledgefactorydemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knowledgefactory; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class KnowledgefactorydemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(KnowledgefactorydemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-websocket-example/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-websocket-example/src/main/resources/application.properties -------------------------------------------------------------------------------- /springboot-zxing-itext-qrcode-pdf/src/main/java/com/knf/dev/Application.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springboot-zxing-itext-qrcode-pdf/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowledgefactory4u/KnowledgeFactory/dc1b7cfe5d22c7f2f0158275cbd42caad18a9ada/springboot-zxing-itext-qrcode-pdf/src/main/resources/application.properties -------------------------------------------------------------------------------- /springbootfreemarkerjpacrud/src/main/java/com/knf/dev/demo/springbootfreemarkerjpacrud/SpringbootfreemarkerjpacrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootfreemarkerjpacrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootfreemarkerjpacrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootfreemarkerjpacrudApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springbootfreemarkerjpacrud/src/main/java/com/knf/dev/demo/springbootfreemarkerjpacrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootfreemarkerjpacrud.repository; 2 | 3 | import com.knf.dev.demo.springbootfreemarkerjpacrud.model.User; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface UserRepository extends CrudRepository { 9 | 10 | } -------------------------------------------------------------------------------- /springbootfreemarkerjpacrud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springbootfreemarkerjpacrud/src/test/java/com/knf/dev/demo/springbootfreemarkerjpacrud/SpringbootfreemarkerjpacrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springbootfreemarkerjpacrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootfreemarkerjpacrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springjpagroovycrud/src/main/java/com/knf/dev/demo/springjpagroovycrud/SpringjpagroovycrudApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springjpagroovycrud; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringjpagroovycrudApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringjpagroovycrudApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /springjpagroovycrud/src/main/java/com/knf/dev/demo/springjpagroovycrud/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springjpagroovycrud.repository; 2 | 3 | 4 | import com.knf.dev.demo.springjpagroovycrud.model.User; 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository 9 | public interface UserRepository extends CrudRepository { 10 | } -------------------------------------------------------------------------------- /springjpagroovycrud/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #server.port:9080 2 | -------------------------------------------------------------------------------- /springjpagroovycrud/src/test/java/com/knf/dev/demo/springjpagroovycrud/SpringjpagroovycrudApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.knf.dev.demo.springjpagroovycrud; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringjpagroovycrudApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /twilio-springboot-demo/src/main/java/com/knf/sibin/dev/TwilioSpringbootDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.knf.sibin.dev; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TwilioSpringbootDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TwilioSpringbootDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /twilio-springboot-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | twilio_account_sid= 3 | twilio_auth_token= 4 | twilioPhoneNumber= 5 | --------------------------------------------------------------------------------