{"id":22567809,"url":"https://github.com/santialb/productprojectfinal","last_synced_at":"2026-05-19T03:16:37.617Z","repository":{"id":261136941,"uuid":"882149348","full_name":"santialb/ProductProjectFinal","owner":"santialb","description":"Product Finalized Project ","archived":false,"fork":false,"pushed_at":"2024-11-09T02:50:48.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T13:45:40.205Z","etag":null,"topics":["backend","crud","java","spring"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/santialb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-02T02:21:12.000Z","updated_at":"2025-02-11T22:00:42.000Z","dependencies_parsed_at":"2024-11-09T03:29:57.259Z","dependency_job_id":"296bb02d-b906-4cc7-8ec0-b1c9ba108d7f","html_url":"https://github.com/santialb/ProductProjectFinal","commit_stats":null,"previous_names":["santialb/finalexam","santialb/productprojectfinal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/santialb/ProductProjectFinal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santialb%2FProductProjectFinal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santialb%2FProductProjectFinal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santialb%2FProductProjectFinal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santialb%2FProductProjectFinal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santialb","download_url":"https://codeload.github.com/santialb/ProductProjectFinal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santialb%2FProductProjectFinal/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265508168,"owners_count":23779087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","crud","java","spring"],"created_at":"2024-12-08T00:09:15.387Z","updated_at":"2026-05-19T03:16:37.571Z","avatar_url":"https://github.com/santialb.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Final Products API\n\nThis is a Products API built with Spring Boot. It provides CRUD functionality for managing products and categories with JWT-based authentication. \nThe application includes features like caching, profanity filtering, comprehensive error handling, and automated unit testing for key services.\n\n## Table of Contents\n\n- [Technologies Used](#technologies-used)\n- [Project Structure](#project-structure)\n- [Endpoints](#endpoints)\n- [Database Configuration](#database-configuration)\n- [Unit Testing](#unit-testing)\n\n## Technologies Used\n- Java 17\n- Spring Boot 3.3.5\n- Spring Data JPA\n- Hibernate (JPA implementation)\n- MySQL\n- JWT (for authentication)\n- Spring Cache (with ConcurrentMapCacheManager)\n- Maven\n- Lombok\n- JUnit and Mockito (for testing)\n\n## Project Structure \n```\n├── pom.xml                                 # Project dependencies and build configurations\n├── src/\n│   ├── main/\n│   │   ├── java/\n│   │   │   └── com/\n│   │   │       └── example/\n│   │   │           └── finalExam/\n│   │   │               ├── FinalExamApplication.java   # Main application entry point\n│   │   │               ├── cache/                      # Caching configurations\n│   │   │               ├── configuration/              # API key reader configuration\n│   │   │               ├── controllers/                # REST controllers for product and category management\n│   │   │               ├── exceptions/                 # Custom exception classes\n│   │   │               ├── miscellaneous/              # Utility classes and query models\n│   │   │               ├── models/                     # Domain models and DTOs\n│   │   │               ├── repositories/               # Repository interfaces\n│   │   │               ├── security/                   # Security and JWT configurations\n│   │   │               ├── services/                   # Business logic for product management\n│   │   │               └── validators/                 # Validation logic including profanity check\n│   │   └── resources/\n│   │       └── application.properties                 # Application configuration (e.g., database connection)\n│   └── test/\n│       └── java/\n│           └── com/\n│               └── example/\n│                   └── finalExam/\n│                       ├── DeleteProductServiceTest.java\n│                       ├── FinalExamApplicationTests.java\n│                       ├── GetCategoriesServiceTest.java\n│                       ├── GetProductServiceTest.java\n│                       └── GetProductsServiceTest.java\n└── target/\n\n```\n\n## Endpoints\nHere are the main REST API endpoints:\n\n| Method | URL              | Description                  |\n|--------|-------------------|------------------------------|\n| POST   | `/login`         | Authenticate and get JWT     |\n| POST   | `/createNewUser` | Register a new user          |\n| GET    | `/products`      | Retrieve all products        |\n| GET    | `/product/{id}`  | Retrieve a product by ID     |\n| POST   | `/product`       | Create a new product         |\n| PUT    | `/product/{id}`  | Update an existing product   |\n| DELETE | `/product/{id}`  | Delete a product by ID       |\n| GET    | `/categories`    | List all categories          |\n\n### Example of Request/Response\n- **POST /product**\n  - Request Body:\n    ```json\n    {\n      \"name\": \"Example Product\",\n      \"description\": \"A sample product\",\n      \"price\": 29.99,\n      \"manufacturer\": \"Example Corp\",\n      \"category\": \"Electronics\",\n      \"region\": \"US\"\n    }\n    ```\n  - Response Body:\n    ```json\n    {\n      \"id\": \"1\",\n      \"name\": \"Example Product\",\n      \"description\": \"A sample product\",\n      \"price\": 29.99,\n      \"manufacturer\": \"Example Corp\",\n      \"category\": \"Electronics\"\n    }\n    ```\n\n- **GET /products**\n  - Response Body:\n    ```json\n    [\n      {\n        \"id\": \"1\",\n        \"name\": \"Example Product\",\n        \"description\": \"A sample product\",\n        \"price\": 29.99,\n        \"manufacturer\": \"Example Corp\",\n        \"category\": \"Electronics\"\n      },\n      {\n        \"id\": \"2\",\n        \"name\": \"Another Product\",\n        \"description\": \"Another example product\",\n        \"price\": 19.99,\n        \"manufacturer\": \"Another Corp\",\n        \"category\": \"Home Goods\"\n      }\n    ]\n    ```\n\n## Database Configuration\nMake sure to set up your MySQL database and update the `application.properties` file with the correct credentials:\n\n```properties\nspring.datasource.url=jdbc:mysql://localhost:3306/your_database\nspring.datasource.username=your_username\nspring.datasource.password=your_password\nspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver\n  ```\n## Unit Testing\n\nUnit tests are implemented for the service layer using Mockito. Tests include creating, updating, deleting, and retrieving products.\n\nHere are the test classes:\n\n- DeleteProductServiceTest.java\n- GetCategoriesServiceTest.java\n- GetProductServiceTest.java\n- GetProductsServiceTest.java\nTo run the tests, use the following Maven command:\n```\n bash $ mvn test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantialb%2Fproductprojectfinal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsantialb%2Fproductprojectfinal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantialb%2Fproductprojectfinal/lists"}