Skip to content

MaxStevenson632/Spring-Boot-REST-API-tutorial

Repository files navigation

Spring Boot tutorial

I completed an introductory YouTube tutorial created by Amigoscode. The tutorial demonstrated how to build a REST API using Spring Boot, Docker and PostgreSQL.

Tech stack and concepts covered:

  • Controllers - Used @RestController to mark a class as a web handler
  • Mappings - Used @GetMapping to retrieve data and @PostMapping to send new data
  • Entity - Used @Entity to represent a class as a table in a database
  • Repository - Used @Repository to access the data from the database
  • Service - Used @Service to implement logic and rules for the application
  • Containerization - Used Docker Compose to manage the database environment
  • Port mapping - Mapped the internal Postgres port to the port that the Docker container mapped to
  • Database configuration - linked the Spring Boot app to the Docker container
  • POST requests - Used @RequestBody to capture JSON data and save it to the database
  • Get by a specific attribute - Used @PathVariable to create dynamic URLs and fetch records from the database

Running the application:

To run locally, ensure you have Docker installed, then:

  • Clone the repository
  • Run docker-compose up -d to start the PostgreSQL instance
  • Run the application via your IDE

Link to tutorial: https://www.youtube.com/watch?v=Cw0J6jYJtzw&t=1606s

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages