Repository to practice Spring Boot knowledge.
This project is part of Module 6 of the eCamp course, focusing on backend application development using Spring Boot. The goal is to consolidate skills in building RESTful APIs, managing dependencies with Maven, and configuring Spring applications.
- RESTful API: Implementation of CRUD operations endpoints.
- Persistence: Integration with a database using Spring Data JPA.
- Validation: Handling input data validation.
- Exception Handling: Centralized error and exception management.
- Documentation: Interactive API documentation with Swagger.
- Java 17 or higher
- Maven 3.6 or higher
- Spring Boot 2.5.4 or higher
- Database: PostgreSQL/MySQL (configurable)
-
Clone the repository:
git clone https://github.com/PakoAraya/ecamp-springboot-m6.git cd ecamp-springboot-m6
-
Set up the database:
-
Create a database in PostgreSQL or MySQL.
-
Update the credentials in
src/main/resources/application.properties
:spring.datasource.url=jdbc:postgresql://localhost:5432/your_database spring.datasource.username=your_username spring.datasource.password=your_password
-
-
Build and run the application:
mvn clean install mvn spring-boot:run
-
Access the application:
- API available at:
http://localhost:8080/api
- Swagger documentation:
http://localhost:8080/swagger-ui.html
- API available at:
-
Get all resources:
GET /api/resources
-
Create a new resource:
POST /api/resources Content-Type: application/json { "name": "New Resource", "description": "Resource description" }
-
Update an existing resource:
PUT /api/resources/{id} Content-Type: application/json { "name": "Updated Resource", "description": "Updated description" }
-
Delete a resource:
DELETE /api/resources/{id}
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/new-feature
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push your changes (
git push origin feature/new-feature
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
Francisco Javier Araya Hernández
[email protected]
LinkedIn