An open API service indexing awesome lists of open source software.

https://github.com/brunamark/api-restful

API RESTful with Spring Boot
https://github.com/brunamark/api-restful

api-rest java spring-boot sql

Last synced: 6 days ago
JSON representation

API RESTful with Spring Boot

Awesome Lists containing this project

README

          

# API RESTful

## Overview
This RESTful API follows the Model-View-Controller (MVC) architecture, which structures the application in a clear and manageable way.



  • Model : Manages the data and business logic. It interacts with the database to fetch and manipulate data.


  • View : In the context of a RESTful API, the "view" is the data representation (usually JSON) sent back to the client.


  • Controller : Handles incoming requests from clients, processes them by invoking the appropriate methods on the Model, and returns the data response to the client.

## Table of Contents


  1. Technologies Used

  2. Getting Started

  3. API Endpoints

  4. Authentication

  5. Error Handling

  6. Running the Application

### 1. Technologies Used


  • Java 22

  • Spring Boot 3.3.4

  • Maven 3.9.9

  • MySQL database

### 2. Getting started

### Prerequisites


  • Java JDK 17+

  • Maven

### Instalation


  1. Clone the repository:


  2. ```bash
    $ git clone https://github.com/Brunamark/API-RESTful.git
    ````
  3. Navigate into the project directory:
  4. ```bash
    $ cd
    ````

  5. Build the project:
  6. ```bash
    $ mvn install
    ````

### API Endpoints


  • GET /user/{id}

  • Response:


    [
    {
    id: 2,
    username: "pedro",
    password: "strongpassword"
    }
    ]




  • GET /task/{id}

  • Response:


    [
    {
    id: 1,
    user_id: 2,
    description: "this is a description writed by pedro"
    }
    ]



  • POST /user

  • Response:

    Status Code: 201 Created
    Location Header: he URL of the newly created user resource (e.g., `/user/{id}`).



  • POST /task

  • Response:

    Status Code: 201 Created
    Location Header: he URL of the newly created user resource (e.g., `/task/{id}`).



  • PUT /user/{id}

  • Response:


    [
    {
    id: 2,
    username: "pedro",
    password: "newpassword"
    }
    ]



  • PUT /task/{id}

  • Response:


    [
    {
    id: 1,
    user_id: 2,
    description: "this is a new description writed by pedro"
    }
    ]


  • DELTE /user/{id}

  • Response:


    Status Code: 204 No Content


  • DELTE /task/{id}

  • Response:


    Status Code: 204 No Content

### 4. Authentication

Not yet implemented. In the future it will be implemented JWT Auth.

### 5. Error Handling

Not yet implemented.

### 6. Running the Application

As soon as the project finishes, it will be available.