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
- Host: GitHub
- URL: https://github.com/brunamark/api-restful
- Owner: Brunamark
- Created: 2024-09-23T18:33:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-20T19:46:41.000Z (over 1 year ago)
- Last Synced: 2025-06-02T07:23:15.031Z (11 months ago)
- Topics: api-rest, java, spring-boot, sql
- Language: Java
- Homepage:
- Size: 37.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
- Technologies Used
- Getting Started
- API Endpoints
- Authentication
- Error Handling
- 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
- Clone the repository:
- Navigate into the project directory:
- Build the project:
```bash
$ git clone https://github.com/Brunamark/API-RESTful.git
````
```bash
$ cd
````
```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.