The Waste Sorting App is a RESTful web application designed to promote proper waste management and recycling by providing users with comprehensive disposal guidelines and categorization. This application simplifies waste sorting and encourages environmentally friendly habits.
- Disposal Guidelines: View, create, update, and delete disposal guidelines for different waste types.
- Waste Categories: Manage waste categories and their properties such as recyclability.
- Category-Based Guidelines: Fetch disposal guidelines for specific waste categories.
- Recycling Tips: Provides general tips to improve recycling efficiency.
- RESTful API: Fully implemented RESTful API for integration with other systems or front-end applications.
- Validation: Ensures data consistency with robust validation rules.
- Java: Application logic and API development.
- Spring Boot: For rapid application development and RESTful API implementation.
- H2 Database: Lightweight in-memory database for development and testing.
- Maven: Dependency management and build automation.
- JUnit 5: For writing unit and integration tests.
- Mockito: Mocking framework for test isolation.
- JDK 17 or higher
- Maven 3.6 or higher
- IDE (e.g., IntelliJ IDEA or Eclipse)
- Postman (optional, for testing API endpoints)
-
Clone the Repository:
git clone https://github.com/ray-cod/waste-sorting-app.git cd waste-sorting-app -
Build the Application:
mvn clean install
-
Run the Application:
mvn spring-boot:run
-
Access the API:
- Base URL: http://localhost:8080/api
- Get All Guidelines:
GET /api/disposal-guidelines - Create Guideline:
POST /api/disposal-guidelines - Update Guideline:
PUT /api/disposal-guidelines/{id} - Delete Guideline:
DELETE /api/disposal-guidelines/{id} - Get Guidelines by Category:
GET /api/disposal-guidelines/category/{wasteCategoryId}
- Get All Categories:
GET /api/waste-categories - Create Category:
POST /api/waste-categories - Update Category:
PUT /api/waste-categories/{id} - Delete Category:
DELETE /api/waste-categories/{id} - Get Categories by Name:
Get /api/waste-categories/search?name=...
- Get All Tips:
GET /api/recycling-tips - Create Tip:
POST /api/recycling-tips - Update Tip:
PUT /api/recycling-tips/{id} - Delete Tip:
DELETE /api/recycling-tips/{id} - Get Tips by Material:
Get /api/recycling-tips/material/{material}