{"id":26906753,"url":"https://github.com/vitor-reck/product-api","last_synced_at":"2026-04-04T20:32:53.606Z","repository":{"id":284664455,"uuid":"952595697","full_name":"vitor-reck/product-api","owner":"vitor-reck","description":"RESTFul API for inventory management with Java and Spring Boot","archived":false,"fork":false,"pushed_at":"2025-03-27T23:20:23.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T19:34:07.259Z","etag":null,"topics":["docker","docker-compose","java","junit5","log4j2","mapstruct","mockito","mongodb","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitor-reck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-03-21T14:44:36.000Z","updated_at":"2025-03-27T23:28:08.000Z","dependencies_parsed_at":"2025-03-28T00:36:30.574Z","dependency_job_id":null,"html_url":"https://github.com/vitor-reck/product-api","commit_stats":null,"previous_names":["vitor-reck/saw-backend","vitor-reck/product-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vitor-reck/product-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitor-reck%2Fproduct-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitor-reck%2Fproduct-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitor-reck%2Fproduct-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitor-reck%2Fproduct-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitor-reck","download_url":"https://codeload.github.com/vitor-reck/product-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitor-reck%2Fproduct-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31413269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","docker-compose","java","junit5","log4j2","mapstruct","mockito","mongodb","spring-boot"],"created_at":"2025-04-01T11:18:34.245Z","updated_at":"2026-04-04T20:32:53.584Z","avatar_url":"https://github.com/vitor-reck.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Products API\nThe Products API is a Spring Boot-based RESTful service for inventory management, featuring role-based user authentication.\n- **Architecture**: Implements a service-layer architecture with a repository pattern\n- **Testability**: Layer separation enhances testability\n- **Maintainability**: A clean and structured codebase for easy management\n\n## Technologies Stack\n- Java 21\n- Spring Framework\n  - Spring Boot, Spring Data MongoDB, Spring Web, Spring Security, Bean Validation, Lombok\n- JUnit and Mockito\n- MapStructs\n- Log4j2\n- MongoDB\n- Docker\n\n## Build and Run\nFollow these steps to build and run the application:\n\n```shell\n# Open a terminal (Command Prompt or PowerShell for Windows, Terminal for macOS or Linux)\n\n# Ensure Git is installed\n# Visit https://git-scm.com to download and install console Git if not already installed\n\n# Clone the repository\ngit clone https://github.com/vitor-reck/product-api.git\n\n# Navigate to the Docker-compose directory\ncd product-api/docker-compose\n\n# Check if Docker and Docker-compose are installed\ndocker -v  # Check the Docker version\ndocker-compose -v  # Check Docker-compose version\n# Visit the official Docker website to install or update it if necessary\n\n# Start the Services\ndocker-compose up -d  # Starts the Products API and MongoDB\n\n# Managing Containers\ndocker-compose start  # Start stopped containers \ndocker-compose stop   # Stop running containers \ndocker-compose down --volumes   # Stop and remove containers, network, and MongoDB volume  \n```\n\n## Preloaded Users and Categories\nUser and category data are automatically seeded via the \u003cem\u003emongo-init.js\u003c/em\u003e script.\n```shell\n# Open a terminal (Command Prompt or PowerShell for Windows, Terminal for macOS or Linux)\n\n# List running containers\ndocker ps\n\n# Access the MongoDB container\ndocker exec -it *Container ID* bash\n\n# Open the MongoDB shell\nmongosh\n\n# Retrieve data\ndb.users.find()  # View all users\ndb.categories.find()  # View all categories \n\n# Exit MongoDB and the container\nexit  # Run twice to exit both MongoDB and the container\n```\n\n## API Endpoints (Postman Collection)\nThe following endpoints can be tested using Postman\n| Action               | HTTP Method | Resource           | Roles       |\n|----------------------|-------------|--------------------|-------------|\n| Authentication       | POST        | /api/auth          | None        |\n| List products        | GET         | /api/products      | ADMIN, USER |\n| Get product by id    | GET         | /api/products/{id} | ADMIN, USER |\n| Create product       | POST        | /api/products      | ADMIN       |\n| Update product by id | PUT         | /api/products/{id} | ADMIN       |\n| Delete product by id | DELETE      | /api/products/{id} | ADMIN       |\n| List categories      | GET         | /api/categories    | ADMIN, USER |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitor-reck%2Fproduct-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitor-reck%2Fproduct-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitor-reck%2Fproduct-api/lists"}