This REST API is a robust application designed to provide a RESTful interface following industry best practices. Built with Spring Boot, it offers a comprehensive solution for performing CRUD (Create, Read, Update, Delete) operations on data resources. The API is designed with scalability, security, and ease of use in mind.
- Complete CRUD Operations: Create, read, update, and delete data with well-defined endpoints
- RESTful Architecture: Follows REST principles for predictable and standardized API behavior
- JSON Response Format: All API responses are formatted in JSON for easy integration
- Error Handling: Comprehensive error handling with appropriate HTTP status codes
- Data Validation: Input validation to ensure data integrity
- User Authentication: Secure endpoints with authentication mechanisms
- API Documentation: Detailed documentation for all endpoints
- Docker Support: Easy deployment with Docker containers
- Programming Language: Java 17
- Framework: Spring Boot 3.3.2
- Database: MySQL 8.0
- ORM: Spring Data JPA
- Build Tool: Maven
- Containerization: Docker
Before running the application, ensure you have:
- Java JDK 17 or newer
- MySQL Server 8.0 or newer
- Maven 3.6+ (or use the included Maven wrapper)
- Docker and Docker Compose (for containerized deployment)
-
Clone the Repository
git clone https://github.com/yourbee03/REST_API.git cd REST_API -
Configure Database
Update the database configuration in
src/main/resources/application.propertieswith your MySQL credentials. -
Build the Application
./mvnw clean install
-
Run the Application
./mvnw spring-boot:run
-
Clone the Repository
git clone https://github.com/yourbee03/REST_API.git cd REST_API -
Build and Run with Docker Compose
docker compose up -d
This will start both the Spring Boot application and a MySQL database in containers.
The API provides the following endpoints:
GET /api/resource- Retrieve all resourcesGET /api/resource/{id}- Retrieve a specific resourcePOST /api/resource- Create a new resourcePUT /api/resource/{id}- Update an existing resourceDELETE /api/resource/{id}- Delete a resource
When using Docker, you can configure the application using the following environment variables:
MYSQL_HOST- MySQL database hostMYSQL_PORT- MySQL database portMYSQL_DATABASE- MySQL database nameMYSQL_USER- MySQL usernameMYSQL_PASSWORD- MySQL passwordSERVER_PORT- Application server port
Run the automated tests with:
./mvnw test- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.