{"id":18612433,"url":"https://github.com/alejandro945/states-machine-server","last_synced_at":"2026-04-19T10:31:33.407Z","repository":{"id":69072163,"uuid":"538189490","full_name":"alejandro945/states-machine-server","owner":"alejandro945","description":"REST API store in web heroic servers using a basic CI/CD pipeline when pushing to the main branch 🔥","archived":false,"fork":false,"pushed_at":"2022-09-27T16:03:11.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-14T19:37:20.937Z","etag":null,"topics":["mealy-machine","moore-machine","rest-api","spring-boot","state-machine"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alejandro945.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-09-18T17:39:48.000Z","updated_at":"2022-10-03T16:28:03.000Z","dependencies_parsed_at":"2023-04-22T08:31:29.911Z","dependency_job_id":null,"html_url":"https://github.com/alejandro945/states-machine-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alejandro945/states-machine-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fstates-machine-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fstates-machine-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fstates-machine-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fstates-machine-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alejandro945","download_url":"https://codeload.github.com/alejandro945/states-machine-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fstates-machine-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32003980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["mealy-machine","moore-machine","rest-api","spring-boot","state-machine"],"created_at":"2024-11-07T03:17:10.784Z","updated_at":"2026-04-19T10:31:33.369Z","avatar_url":"https://github.com/alejandro945.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Get Started 👋\n\n## Enviroment Configuration\n\n1. First install on your Vs Code IDE, the Spring Boot Extension Pack that includes: \n\n    * Spring Boot Tools\n    * Spring Initializr\n    * Spring Boot Dashboard\n\n2. Make sure you have the JDK, extension pack for Java already install 🔥\n\n3. This software version need at least java version 8\n\n## Are you creating the project?\n\nThe Spring Initializr extension allows you to search for dependencies and generate new Spring Boot projects.\n\nHere is a list of facts using ```vscode-spring-initializr```:\n\n* Once you have the extension installed, open the Command Palette (⇧⌘P) and type Spring Initializr to start generating a Maven or Gradle project and then follow the wizard.\n\n    - Service URL\n    - Project Name - Artifact -\n    - Type: Maven\n    - Packaging: jar\n    - Java Version: 8\n    - Language: Java\n    - Group: net.state\n    - Package: net.state.statemachineserver\n\n* Add new dependecies in your pom.xml file just right clicking and pushing your specific libraries -Add straters- \n\n## Clone the project\n* ssh\n``` sh\ngit clone git@github.com:juanosorio0219/state-machine-client.git\n```\n* https\n```sh\ngit clone https://github.com/juanosorio0219/state-machine-client.git\n```\n\n## Folder structure\n\n```bash\n|- net.state.statemachineserver\n    |- controller\n        |- EntityController.java - Handle our entrypoint of our product -\n    |- model\n        |- Entity.java - Business Logic -\n    |- repository\n        |- EntityRepository - Communication wirh another data services layers -\n```\n\n## Deployment 📦\n\nCreate your **jar** executable maven project with the following line: \n\n```bash\n./mvnw package\n```\n\nUsing Azure Kubernetes Service cluster. 🐳\n\n### What is Kubernetes? 🛳\n\nKubernetes is a cluster-based orchestrator. It provides your application with several benefits, such as availability, monitoring, scaling, and rolling updates.\n\n* Cluster nodes\nA cluster is node-based and there are two types of nodes:\n\n**Control plane nodes:** These nodes host the cluster's control plane aspects and are reserved for services that control the cluster. They're responsible for providing the API you and all the other nodes use to communicate. No workloads are deployed or scheduled on these nodes.\n\n**Nodes:** These nodes are responsible for executing custom workloads and applications, such as components from your cloud-based video rendering service.\n\n### Cluster Creation \n\n* Create variables for the configuration values\n```bash\nexport RESOURCE_GROUP=rg-state-machine\nexport CLUSTER_NAME=aks-state-machine\nexport LOCATION=eastus\n```\n* Create the resource group\n```bash\naz group create --name=$RESOURCE_GROUP --location=$LOCATION\n```\nRespose from the Azure CLI 🥭\n\n```ts\n{\n  \"id\": \"/subscriptions/d566fc78-dc22-4e5d-9917-e832b5354249/resourceGroups/rg-state-machine\",\n  \"location\": \"eastus\",\n  \"managedBy\": null,\n  \"name\": \"rg-state-machine\",\n  \"properties\": {\n    \"provisioningState\": \"Succeeded\"\n  },\n  \"tags\": null,\n  \"type\": \"Microsoft.Resources/resourceGroups\"\n}\n```\n\n* Create the AKS Cluster\n```bash\naz aks create \\\n    --resource-group $RESOURCE_GROUP \\\n    --name $CLUSTER_NAME \\\n    --node-count 2 \\\n    --enable-addons http_application_routing \\\n    --generate-ssh-keys \\\n    --node-vm-size Standard_B2s \\\n    --network-plugin azure\n```\n* Link your Kubernetes cluster with kubectl by running the following command in Cloud Shell.\n\n```bash\naz aks get-credentials --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP\n```\n\n* Then if you just make use of your conneciton tool in this case kubectl running the following code line.\n\n```bash\nkubectl get nodes\n```\n- You will get\n\n```bash\nNAME                                STATUS   ROLES   AGE     VERSION\naks-nodepool1-14700414-vmss000000   Ready    agent   2m25s   v1.23.8\naks-nodepool1-14700414-vmss000001   Ready    agent   2m31s   v1.23.8\n```\n\n### App Deployment in AKS\n\n1. Creates your ACR in your azure account, take in mind you need to create a local image of your product then login to your registry and push tour image like:\n\n```bash\ndocker login registrystatemachines.azurecr.io\ndocker tag \u003cimageID\u003e registrystatemachines.azurecr.io/state-machines:v1\ndocker push registrystatemachines.azurecr.io/state-machines:v1\n```\n\n2. Using Azure CLI tool you need to az login \u003cacr-name\u003e --get-token and then\n\n```bash\ndocker login registrystatemachines.azurecr.io -u 00000000-0000-0000-0000-000000000000 -p token-already-provided\n```\n\n3. Submit the deployment manifest to your cluster.\n\n```bash\nkubectl apply -f ./deployment.yaml\n```\n\n4. Run the kubectl get deploy command to check if the deployment was successful.\n\n```bash\nkubectl get deploy machines-website\n```\n\n5. Run the ```kubectl get pods``` command to check if the pod is running.\n\n```bash\nkubectl get pods\n```\n\n6. Enable network access to an application\n\n    * Kubernetes servises types:\n\n        - **ClusterIP:** This value exposes the applications internally only. This option allows the service to act as a port-forwarder and makes the service available within the cluster. This value is the default when omitted.\n\n        - **NodePort:** This value exposes the service externally. It assigns each node a static port that responds to that service. When accessed through ```nodeIp:port```, the node automatically redirects the request to an internal service of the ClusterIP type. This service then forwards the request to the applications.\n\n        - **LoadBalancer:** This value exposes the service externally by using Azure's load-balancing solution. When created, this resource spins up an Azure Load Balancer resource within your Azure subscription. Also, this type automatically creates a NodePort service to which the load balancer's traffic is redirected and a ClusterIP service to forward internally.\n\n        - **ExternalName:** This value maps the service by using a DNS resolution through a CNAME record. You use this service type to direct traffic to services that exist outside the Kubernetes cluster.\n\n7. Deploy the service and check it out\n\n```bash\nkubectl apply -f ./service.yaml\nkubectl get service machines-website\n```\n\n8. Azure DNS zone list\n\n```bash\naz aks show \\\n  -g $RESOURCE_GROUP \\\n  -n $CLUSTER_NAME \\\n  -o tsv \\\n  --query addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName\n```\n\n9. Deploy the ingress and check it out\n\n```bash\nkubectl apply -f ./ingress.yaml\nkubectl get ingress machines-website\n```\n\n10. Clean up resources \n\nhttps://portal.azure.com/\n\n```bash\nkubectl config delete-context aks-state-machine\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandro945%2Fstates-machine-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falejandro945%2Fstates-machine-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandro945%2Fstates-machine-server/lists"}