{"id":23064368,"url":"https://github.com/hiejulia/hotelbooking","last_synced_at":"2025-08-15T10:31:08.996Z","repository":{"id":104755920,"uuid":"118022809","full_name":"hiejulia/HotelBooking","owner":"hiejulia","description":"Hotel Booking project","archived":false,"fork":false,"pushed_at":"2025-02-11T17:08:26.000Z","size":895,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T12:44:25.464Z","etag":null,"topics":["apache-avro","apache-kafka","api-gateway","cors","docker","eureka-server","hystrix-dashboard","kafka","maven","microservice","mysql","oauth2","rabbitmq","spring-security","springboot","springcloud","turbine","zuul-server"],"latest_commit_sha":null,"homepage":"https://github.com/HienNguyen711/HotelBooking","language":"Vue","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/hiejulia.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":"security-service/.DS_Store","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-18T18:40:10.000Z","updated_at":"2025-02-11T17:08:30.000Z","dependencies_parsed_at":"2023-05-29T14:45:10.083Z","dependency_job_id":null,"html_url":"https://github.com/hiejulia/HotelBooking","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hiejulia/HotelBooking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiejulia%2FHotelBooking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiejulia%2FHotelBooking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiejulia%2FHotelBooking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiejulia%2FHotelBooking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiejulia","download_url":"https://codeload.github.com/hiejulia/HotelBooking/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiejulia%2FHotelBooking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270558050,"owners_count":24606598,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"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":["apache-avro","apache-kafka","api-gateway","cors","docker","eureka-server","hystrix-dashboard","kafka","maven","microservice","mysql","oauth2","rabbitmq","spring-security","springboot","springcloud","turbine","zuul-server"],"created_at":"2024-12-16T04:17:52.883Z","updated_at":"2025-08-15T10:31:08.988Z","avatar_url":"https://github.com/hiejulia.png","language":"Vue","funding_links":["https://www.buymeacoffee.com/hientech"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.buymeacoffee.com/hientech\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee\" alt=\"Buy Me A Coffee\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n# HotelBooking\nHotel Booking project\n\n### Tech stack \n+ Microservice with Java Spring boot\n+ Service discovery and registration: Netflix Eureka\n+ Edge/proxy server: Zuul\n    + Client : RestTemplate, FeignClient, Eureka\n+ Load balancing: Ribbon\n+ Circuit breaker : Hystrix\n    + Hotel\n    + User \n    + Booking \n+ Monitoring dashboard: Nexflix Turbine\n    + User Turbine with Hystrix: http://localhost:8989/turbine.stream\n    + You should start RabbitMQ server\n    + Set up Hystrix dashboard \n    + Create Turbine service\n\n+ Container\n    + Docker\n    + Install with docker \n        + docker-machine rm default\n        + docker-machine create -d virtualbox --virtualbox-memory 4096 default\n    + Building Docker images with Maven :   \n        + User Docker Maven plugin \n        + Configure properties: \n            + Spring profile : Docker \n            + Port \n            + IP address set: true with Eureka(preferIp)\n            + User Eureka server hostname \n            + Run : `mvn -P docker clean package`\n            + Config Docker Maven plugin \n            + Create Dockerfile \n            + Config docker-assembly.xml \n            + Build Docker image : `mvn docker:build`\n            + Build Docker image : `docker run -it -p 8080:8080 hihi/hotel-service:-SNAPSHOT`\n            + Run Docker using Maven: \n                + Add Configuration in pom.xml\n                + Run : `mvc docker:start`\n            + Integration testing with Docker \n                + Use plugin: Failsafe\n                + Config Failsafe: pass service URL in service.url tag to perform integration testing \n                + User DockerIntegrationTest marker to mark our Docker integration test \n                + Command to perform integration testing using Maven: `mvn integration-test`\n\n            + Push the image to Docker hub \n                + Add tags under docker-maven plugin \n                + Run `mvn -Ddocker.username=\u003cusername\u003e -Ddocker.password=\u003cpassword\u003e deploy`\n            + Manage Docker container \n                + Before start : \n                    + Set up Docker local registry \n                    + Build docker local registry : `docker run -d -p 5000:5000 --restart=always --name registry registry:2`\n                    + Push , pull commands for local images : `docker push localhost:5000/sourabhh/hotel-service:- SNAPSHOT`,`docker-compose pull`\n                    + Execute docker-compose : `docker-compose up -d`\n                + Use Docker compose : manage docker containers\n                + Docker compose : number of containers, docker image, port, link \n                + Create docker-compose.yml \n                + Start all Docker containers with single command: `docker-compose up -d `\n                + List all Docker containers starting : `docker-compose ps`\n                + Check Docker images logs : `docker-compose logs`\n\n\n\n+ Reactive microservice \n    + Apache Kafka, Apache Avro \n    + Implement reactive microservice \n    + Produce an event and Consume an event \n\n    + Apache Avro \n        + Create avro schema \n        + Use avro-maven-plugin (add avro-maven plugin in pom.xml)\n        + Run `mvn package` to create BookingOrder.java class \n    + Apache Kafka stream : \n        + Message channel \n        + Add message converter bean \n        + Config kafka server \n\n        \n    + Ensure Kafka and Zookeeper are running in host and port defined in application.yaml\n    + Test the Producer \n    + Run the project and Post a new booking\n    + It will produce Kafka topic(event) as shown from the logs \n    + Check Kafka console : message that confirm the message is received by Kafka\n    + Consume the event \n    + Add avro schema\n    + Config message channel(input)\n    + Config kafka topic : bookingOrderInput \n    + config kafka server in consumer\n    + Add event listener : @StreamListener\n\n+ Secure microservice \n    + Enable SSL \n        + Set up SSL on Edge server : use Java keytool to generate keystore \n        + keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -ext san=dns:localhost -storepass password -validity 365 -keysize 2048\n        + keytool -importcert -file path/to/.crt -alias \u003ccert alias\u003e -  keystore \u003cJRE/JAVA_HOME\u003e/jre/lib/security/cacerts -storepass changeit\n        + update application.yaml with ssl config \n        + re build the zuul server with https\n        + Go to : localhost:8765/hotelapi/v1/hotels/1 ( the same with localhost:3401/v1/hotels/1)\n\n+ Logging and ELK stack (centralize logging)\n    + Docker compose logs : commands \n    + Elasticsearch, Logstash, Kibana ELK stack : log aggregation \n    + ELK stack set up : \n        + Download and install on localhost machine \n        + Install Elastic search \n            + Use ES docker image: docker pull docker.elastic.co/elasticsearch/elasticsearch:5.5.1 \n            + http://localhost:9200/\n            + Install GUI : plugin -install mobz/elasticsearch-head\n            + Run Docker image : `docker-compose` for later to run ELK stack together \n            + Access GUI : http://localhost:9200/_plugin/head/. \n        + Install Logstash \n            + Use docker image:docker pull docker.elastic.co/logstash/logstash:5.5.1 \n            + Config logstash : \n            input { \n            ### OTRS ### \n            file { \n                path =\u003e \"\\logs\\otrs-service.log\" \n                type =\u003e \"otrs-api\" \n                codec =\u003e \"json\" \n                start_position =\u003e \"beginning\" \n            } \n            \n            ### edge ### \n            file { \n                path =\u003e \"/logs/edge-server.log\" \n                type =\u003e \"edge-server\" \n                codec =\u003e \"json\" \n            } \n            } \n            \n            output { \n            stdout { \n                codec =\u003e rubydebug \n            } \n            elasticsearch { \n                hosts =\u003e \"localhost:9200\" \n            } \n            } \n            + Go to logstash home, run : bin/logstash agent -f logstash.conf \n\n        + Install Kibana: docker pull docker.elastic.co/kibana/kibana:5.5.1 \n            + config : open config/kibana.yml : point elasticsearch.url \n            elasticsearch.url:http://localhost:9200\n            + go tp kibana home : run : bin/kibana agent -f logstash.conf \n            + Or run docker image \n            + Access : http://localhost:5601/.\n        + Install ELK stack from Docker : willdurand/elk\n            + Run ELK stack using Docker compose : docker-compose-elk.yml\n            + docker-compose -f docker-compose-elk.yml up -d \n            + Restart Logstash container after copy the pipeline CONF file pipeline/logstash.conf : \n            input { \n            tcp { \n                port =\u003e 5001 \n                codec =\u003e \"json\" \n            } \n            } \n            \n            output { \n            elasticsearch { \n                hosts =\u003e \"elasticsearch:9200\" \n            } \n            } \n        + Push logs to the ELK stack \n\n        + Use Zipkin and Sleuth for tracking \n            + Trace ID \n        + Add Zipkin and Sleuth dependencies\n        + Go to : http://\u003czipkin host name\u003e:9411/zipkin/  (zipkin dashboard)\n        + \n\n+ Document API \n+ Versioning API \n\n\n\n### Run the project \n+ mvn clean install \n+ eureka server, turbine server, dashboard server , hotel service, user service, booking service, api-service \n+ Eureka server : `http://localhost:8761/`\n+ User API : `http://user-service/v1/users`\n+ Hotel API : `http://hotel-service/v1/users`\n+ Turbine Server : `http://localhost:8989/`\n+ Dashboard Server: `http://localhost:7979`\n\n\n\n### Tech stack \n+ Maven \n+ Spring cloud \n+ RabbitMQ \n+ Eureka \n+ Docker \n+ Apache Kafka\n+ Apache Avro\n+ ElasticSearch \n+ Logstash\n+ Kibana\n+ Test with JUnit\n\n\n\n\n## Screen shot \n+ \n\u003cimg src=\"./img/1.png\"\u003e\n\n+ Eureka server \n\u003cimg src=\"./img/1.png\"\u003e\n\u003cimg src=\"./img/2.png\"\u003e\n\u003cimg src=\"./img/3.png\"\u003e\n+ RabbitMQ server start\n\u003cimg src=\"./img/4.png\"\u003e \n\u003cimg src=\"./img/5.png\"\u003e \n\u003cimg src=\"./img/6.png\"\u003e \n\u003cimg src=\"./img/7.png\"\u003e \n\n\n\n\n+ Hystrix Dashboard \n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiejulia%2Fhotelbooking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiejulia%2Fhotelbooking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiejulia%2Fhotelbooking/lists"}