{"id":19738156,"url":"https://github.com/yanmastra/spring-boot-learning","last_synced_at":"2026-01-16T00:52:22.114Z","repository":{"id":244576218,"uuid":"767879095","full_name":"yanmastra/spring-boot-learning","owner":"yanmastra","description":"This is learning project, implementing spring-boot and keycloak to build a Microservices","archived":false,"fork":false,"pushed_at":"2024-09-30T02:32:16.000Z","size":1408,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T19:28:36.797Z","etag":null,"topics":["docker","docker-compose","keycloak","nginx","openid-connect","spring-boot-3","spring-boot-security-oauth2"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yanmastra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-06T03:57:32.000Z","updated_at":"2024-09-30T02:32:19.000Z","dependencies_parsed_at":"2024-06-15T19:25:24.079Z","dependency_job_id":"d7a7e4c6-5782-47bc-b5ab-ed89bbece540","html_url":"https://github.com/yanmastra/spring-boot-learning","commit_stats":null,"previous_names":["yanmastra/spring-boot-learning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanmastra%2Fspring-boot-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanmastra%2Fspring-boot-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanmastra%2Fspring-boot-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanmastra%2Fspring-boot-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yanmastra","download_url":"https://codeload.github.com/yanmastra/spring-boot-learning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241067698,"owners_count":19903867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","keycloak","nginx","openid-connect","spring-boot-3","spring-boot-security-oauth2"],"created_at":"2024-11-12T01:13:24.324Z","updated_at":"2026-01-16T00:52:22.088Z","avatar_url":"https://github.com/yanmastra.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Practicing to build Microservices with Spring-boot, Keycloak, and SSL integrated\nThis project was created to practice building Microservices with Spring-boot, Securing services with Keycloak and testing the performance of Spring JPA and hibernate query.\nIn this project, there is a sample of the Rest-API project that contains a sample of Endpoint classes and a boilerplate class to make us easier to create CRUD Endpoint \nIf you are interested, let's see a couple of documentation below.\n\n\n## Introduction\nThis project is build by Spring-boot, you can see what is Spring-boot on their [official website](https://docs.spring.io/spring-boot/index.html).\nGoals of this project is \u003cstrong\u003e\"to learn and find a better way how to build a Microservices System Architecture using Spring-boot\"\u003c/strong\u003e,\nso the description on the ``README.md`` file will be changed periodically following updates of this project. \u003cbr/\u003e\nThere are some important things you should know about this project\n1. Root Folder description\n    - [`ms-persistent-base`](/ms-persistent-base) contains Base classes to creating Entity, Payload, or Response\n    - [`ms-security-base`](/ms-security-base) is a spring-boot project that contains the Security Configuration will be used in all services\n    - [`spring-boot-ms-integration-test`](/spring-boot-ms-integration-test) is a spring-boot project that contains the Security Configuration will be used in all services\n    - [`docker`](/docker) contains files that needed to build Container of Keycloak and PostgresQL\n    - [`docs`](/docs) contains image assets and markdown (`.md`) files of project documentation\n    - [`nginx`](/nginx) contains files that needed to run the Nginx\n2. Incomplete parts\n    1. Performance test with JMeter is totally not created yet.\n       This part will test some API endpoint from Rest Sample and Rest-Sample Reactive services to compare their performance\n    2. Documentation of the Architecture\n3. This project is developed and tested on MacOS, it might not be working properly on Windows OS\n\n\u003chr/\u003e\n\n## Prerequisites\nTo follow this guide, you need:\n1. Understand Java\n2. Understand Object Oriented Programming\n3. Understand Docker\n4. OpenJDK 21+ installed\n5. Apache Maven 3.9.6 or newer\n6. Docker\n\n\u003e :warning: It would be better you install ``sdkman`` on your computer, and then use ``sdkman`` to install OpenJDK\n\u003e \u003cbr/\u003e [See this to install ``SDKMAN`` ](https://sdkman.io/install)\n\n\u003chr/\u003e\n\n## How to setup ?\nPlease follow these steps to run this project correctly\n### 1. Clone the project\nThere is no special way to clone this project\n\n### 2. Localhost setup\nWe need to setup our localhost or our Local Machine to make a DNS running on our Local Machine\n\n#### - Linux / MacOS\n1. Open your terminal\n2. Type ``sudo vi /etc/hosts`` and input your computer password\n3. Press i on keyboard and type this on new line\n   ```shell\n   ...\n   \n   10.123.123.123 \u003cdomain name that you want\u003e\n   10.123.123.123 keycloak.\u003cdomain name that you want\u003e\n   ```\n   it would be like\n    ```shell\n   ...\n   \n   10.123.123.123 example.com \n   10.123.123.123 keycloak.example.com \n    ```\n   or\n    ```shell\n   ...\n   \n   10.123.123.123 practicing-spring-boot.com\n   10.123.123.123 keycloak.practicing-spring-boot.com \n    ```\n   or something else\n4. Press ``Esc`` on keyboard, then press ``Shift`` + ``Z`` twice\n\n#### - Windows\n- Coming soon\n\n### 3. Environment Variables Setup\n1. Please copy ``docker_env.env.example`` to ``docker_env.env``\n2. Fill in these variable first\n    - ``SERVER_HOST`` is the domain name that you have added before to ``/etc/hosts``\n    - ``KEYCLOAK_HOST`` is your domain name with prefix ``keycoak.``\n    - All environment variables with prefix ``DATABASE_``\n    - ``KEYCLOAK_EXTERNAL_PORT`` is accessible port of keycloak container\n    - ``KEYCLOAK_ADMIN`` and ``KEYCLOAK_ADMIN_PASSWORD`` is a user credential will be used to sign in to keycloak admin console\n    - ``KEYCLOAK_KEYSTORE_PASSWORD`` keystore password to secure the keycloak\n\n### 4. Create local DNS\nThis step is to make our domain works on our local\n1. Open your terminal\n2. Navigate to this project root folder\n3. Type ``./create-local-dns.sh`` and enter\n4. The result would be like this \u003cbr/\u003e\n   ![image](/docs/img/create-local-dns.png)\n5. To make sure your domain works, type this on terminal,\n   ```shell\n   ping 10.123.123.123\n   ```\n   and\n   ```shell\n   ping \u003cyour domain\u003e\n   ```\n   if it works, the result would be like this\n   ```text\n   PING q-learning.com (10.123.123.123): 56 data bytes\n   64 bytes from 10.123.123.123: icmp_seq=0 ttl=64 time=0.118 ms\n   64 bytes from 10.123.123.123: icmp_seq=1 ttl=64 time=0.299 ms\n   64 bytes from 10.123.123.123: icmp_seq=2 ttl=64 time=0.296 ms\n   64 bytes from 10.123.123.123: icmp_seq=3 ttl=64 time=0.220 ms\n   ```\n\n### 5. Create certificate for keycloak and SSL\nCertificate is needed to secure our keycloak\n1. Run ``./create-certificate.sh`` on your terminal\n2. After that check on folder ``./nginx/certs``, ``self-signed.crt`` and ``self-signed.key`` files would be there \u003cbr/\u003e\n   ![image](/docs/img/nginx-certs.png)\n3. And then check on folder ``./docker/keycloak/``, ``server.keystore`` would be there\n   ![image](/docs/img/server-keystore.png) \u003cbr/\u003e\n   (don't worry about Dockerfile, it would be generated letter)\n\n### 6. Run Keycloak and PostgreSQL\n1. On your terminal, please run this ``./compose-up-keycloak-posgress.sh``\n2. Please wait until finish, the result would be like this\n   ![image](/docs/img/compose-up-keycloak-postgress.png)\n\n### [7. Setup keycloak](/docs/keycloak-setup.md)\nClick [the title](/docs/keycloak-setup.md) to see the complete instruction\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanmastra%2Fspring-boot-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanmastra%2Fspring-boot-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanmastra%2Fspring-boot-learning/lists"}