Coder Social home page Coder Social logo

consuming-rest-api-with-springboot's Introduction

Consuming REST API with Spring Boot

This project demonstrates how to consume data from a REST API using Spring Boot. The application fetches post data from jsonplaceholder.typicode.com and displays it on both a JavaFX GUI and a web page.

Features

  • Fetches post data from the jsonplaceholder API
  • Displays fetched data on a JavaFX GUI
  • Displays fetched data on a web page
  • Supports both desktop application and web application launch modes

Getting Started

To run this project, follow these steps:

  1. Clone the repository to your local machine using the following command:

    git clone https://github.com/your-username/Consuming-REST-API-with-SpringBoot.git
  2. Navigate to the project directory:

    cd Consuming-REST-API-with-SpringBoot
  3. Depending on your preferred launch mode:

    • For Desktop Application:

      • Uncomment the line Application.launch(PostApp.class, args); in the JavaFxAppLauncher class.
      • Comment out the line SpringApplication.run(ConsumingRestApiApplication.class, args); in the JavafxSpringBootApplication class.
      • Run the Spring Boot application.
    • For Web Application:

      • Comment out the line Application.launch(PostApp.class, args); in the JavaFxAppLauncher class.
      • Uncomment the line SpringApplication.run(ConsumingRestApiApplication.class, args); in the JavafxSpringBootApplication class.
      • Run the Spring Boot application.
      • Access the web page at http://localhost:8080.

Technologies Used

  • Spring Boot
  • JavaFX
  • REST API
  • Thymeleaf (for web page rendering)

Directory Structure

|-- src
|   |-- main
|       |-- java
|       |   |-- com
|       |       |-- campipal
|       |           |-- campipal
|       |               |-- controller
|       |               |   |-- PostController.java
|       |               |-- model
|       |               |   |-- Post.java
|       |               |-- service
|       |               |   |-- PostService.java
|       |               |-- CampipalApplication.java
|       |               |-- PostApp.java
|       |               
|       |               
|       |-- resources
|           |-- templates
|           |   |-- post.html

Contributing

Contributions are welcome! If you find any issues or want to improve the project, feel free to create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Feel free to copy and paste this Markdown code into your README file. Make sure to replace placeholders like `[your-username]` with the actual values and adjust any URLs as needed.

consuming-rest-api-with-springboot's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.