{"id":18447888,"url":"https://github.com/tascigorkem/flight-booking-api","last_synced_at":"2026-04-12T17:06:02.764Z","repository":{"id":52289753,"uuid":"343880217","full_name":"tascigorkem/flight-booking-api","owner":"tascigorkem","description":"HATEOAS Driven Rest Api - Microservice Architecture with Spring Cloud, Docker, Kafka and ELK.","archived":false,"fork":false,"pushed_at":"2021-05-01T12:29:39.000Z","size":4349,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T21:55:51.154Z","etag":null,"topics":["docker","elk-stack","eureka","hibernate","java","java-11","kafka","microservices","postgresql","spring-cloud-netflix","spring-data-jpa","springboot"],"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/tascigorkem.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}},"created_at":"2021-03-02T18:55:53.000Z","updated_at":"2024-01-23T12:59:53.000Z","dependencies_parsed_at":"2022-09-07T05:11:52.164Z","dependency_job_id":null,"html_url":"https://github.com/tascigorkem/flight-booking-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tascigorkem/flight-booking-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tascigorkem%2Fflight-booking-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tascigorkem%2Fflight-booking-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tascigorkem%2Fflight-booking-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tascigorkem%2Fflight-booking-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tascigorkem","download_url":"https://codeload.github.com/tascigorkem/flight-booking-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tascigorkem%2Fflight-booking-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268240441,"owners_count":24218357,"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-01T02:00:08.611Z","response_time":67,"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":["docker","elk-stack","eureka","hibernate","java","java-11","kafka","microservices","postgresql","spring-cloud-netflix","spring-data-jpa","springboot"],"created_at":"2024-11-06T07:14:39.094Z","updated_at":"2026-04-12T17:06:02.721Z","avatar_url":"https://github.com/tascigorkem.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Flight Booking System\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Java-v1.11-orange.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Spring%20Boot-v2.3.9-brightgreen.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/contributions-welcome-orange.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/tascigorkem/flight-booking-api\"\u003e\n\u003c/p\u003e\n\nHATEOAS Driven Rest Api - Microservice Architecture with Spring Cloud, Docker, Kafka and ELK.\n\n### Project Structure\n\n\u003cimg src=\"./docs/project-structure.jpg\" alt=\"\" width=\"800\"\u003e\n\nThis is a project structure.\n\nAll applications in the project are dockerized.\n\nIn the center of this schema, you can see Eureka Discovery Server from Spring Cloud Netflix and 2 Spring Boot microservices registered to this server. The first microservice is Restful CRUD API, and it is uses PostgreSQL as a database. The second microservice is a mail sending service, and it is uses MailHog for SMTP testing.\n\n\u003cimg src=\"./docs/eureka.jpg\" alt=\"\" width=\"600\"\u003e\n\nIn addition to these, 2 microservices communicate with each other with Apache Kafka and Zookeeper. API service sends message to Kafka and mail sending service receives this message and sends it by e-mail.\n\nAlso, elastic stack used for log-analysis solution. Filebeats binds the dockerized container logs and ships these to ElasticSearch. Then, Kibana visualize these logs.\n\n\n### HATEOAS Driven REST API\n\nHATEOAS (Hypermedia as the Engine of Application State) is a constraint of the REST application architecture that lets us use the hypermedia links in the response contents. It allows the client can dynamically navigate to the appropriate resources by traversing the hypermedia links.\n\nJSON Hypermedia API Language (HAL) is a response's content-type: application/hal+json with pagination.\n\n\u003cimg src=\"./docs/hateoas-1.jpg\" alt=\"\" width=\"600\"\u003e\n\n\u003cimg src=\"./docs/hateoas-2.jpg\" alt=\"\" width=\"600\"\u003e\n\n\n### Docker\n\nAll applications in this project are dockerized. To achieve this, 3 docker-compose files are created.\n\nThen, all applications can be started with a single docker-compose command:\n\n`\ndocker-compose -f docker-compose-app.yml -f docker-compose-elk.yml -f docker-compose-kafka.yml up --build -d\n`\n\n\u003cimg src=\"./docs/docker-compose.jpg\" alt=\"\" width=\"600\"\u003e\n\nPS: For local development, up docker-compose-kafka-local.yml, then start microservices.\n\n`\ndocker-compose -f docker-compose-kafka-local.yml up -d\n`\n\n### Test \u0026 Validation\n\nJUnit5, Mockito and Github-Faker are used in this project.\n\nThis snippet shows that unit test for Get by id request and usage of Arrange-Act-Assert (3A) pattern. Additionally, checks status of response.\n\n\u003cimg src=\"./docs/code-snippet-test-get-by-id.jpg\" alt=\"\" width=\"600\"\u003e\n\nThis snippet checks whether expected and returned objects are equal according to the fields.\n\n\u003cimg src=\"./docs/code-snippet-test-fields.jpg\" alt=\"\" width=\"600\"\u003e\n\nThis snippet checks whether invalid request returns the HTTP status 400 Bad Request.\n\n\u003cimg src=\"./docs/code-snippet-test-400-bad-request.jpg\" alt=\"\" width=\"600\"\u003e\n\n\u003cimg src=\"./docs/400-bad-request-postman.jpg\" alt=\"\" width=\"600\"\u003e\n\n\u003cimg src=\"./docs/code-snippet-test-404-not-found.jpg\" alt=\"\" width=\"600\"\u003e\n\n### Actuator \u0026 Health Check\n\nUsed Spring Actuator for health check.\n\n`http://localhost:8081/actuator/health`\n\n`{ \"status\": \"UP\" }`\n\n### Database\n\nUsed PostgreSQL as database.\n\nDB Diagram:\n\n\u003cimg src=\"./docs/db-diagram.jpg\" alt=\"\" width=\"800\"\u003e\n\n\n`spring.datasource.initialization-mode:always` for database initialization from schema.sql\n\nDatabase Schema Generation - Sql: `./flight-booking-service/src/main/resources/schema.sql`\n\nDatabase Inserts - Sql: ./flight-booking-service/src/main/resources/db-inserts.sql`\n\nBaseEntity class with `@MappedSuperClass` annotation and is used by all entity classes as a super class. BaseEntity consists of id, creationTimestamp, updateTimestamp and deletionTimestamp fields.\n\nAdditionally, there are ManyToOne and OneToMany relations between entities.\n\n\u003cimg src=\"./docs/flight-entity-1.jpg\" alt=\"\" width=\"600\"\u003e\n\u003cimg src=\"./docs/flight-entity-2.jpg\" alt=\"\" width=\"600\"\u003e\n\n\n### Kafka \u0026 ElasticSearch\n\n**Kafka Producer** in microservice 1(flight-booking-service), that sends the email message  to Kafka.\n\n\u003cimg src=\"./docs/kafka-producer.jpg\" alt=\"\" width=\"600\"\u003e\n\n**Kafka Consumer** in microservice 2(mail-service), that receives the published email message from Kafka and sends it by e-mail.\n\n\u003cimg src=\"./docs/kafka-consumer.jpg\" alt=\"\" width=\"600\"\u003e\n\nMailHog, that catches e-mail was sent by microservice 2(mail-service).\n\n\u003cimg src=\"./docs/mailhog.jpg\" alt=\"\" width=\"600\"\u003e\n\nAdditionally, this whole process can be monitored and analyzed through Kibana with Elasticsearch.\n\n\u003cimg src=\"./docs/kibana.jpg\" alt=\"\" width=\"800\"\u003e\n\n\n### Docs\n\nDocs located `./docs` folder in the main project folder.\n\n\n#### Javadoc\n\nUsed javadoc standards for method comments.\n\nRun `mvn javadoc:javadoc` for create javadocs.\n\n\u003cimg src=\"./docs/javadoc-code-snippet.jpg\" alt=\"\" width=\"600\"\u003e\n\n\n#### Swagger \u0026 Api-Docs\n\nUsed Swagger and Api-Docs for RestAPI endpoints.\n\n`http://localhost:8081/swagger-ui/index.html?configUrl=/api-docs/swagger-config`\n\n\u003cimg src=\"./docs/swagger-ui.jpg\" alt=\"\" width=\"600\"\u003e\n\n\n### Notes\n\n- **MapStruct** is used for mapping between DTOs.\n- **Lombok** is used for autogenerate boilerplate zero-value codes.\n\n### Scenario\n\n**Scenario 1:** Create a new customer, create a new flight and customer books this flight\n\n... TO DO ...\n\n\n## References\n\n...\n\n\n## License\nFlight Booking API is developed under the [MIT License](LICENSE).\n\n\n**Görkem Taşçı**, 2021\n\nLinkedIn: https://www.linkedin.com/in/tascigorkem/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftascigorkem%2Fflight-booking-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftascigorkem%2Fflight-booking-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftascigorkem%2Fflight-booking-api/lists"}