{"id":49443221,"url":"https://github.com/josivantarcio/api-product","last_synced_at":"2026-04-29T21:05:29.699Z","repository":{"id":324936380,"uuid":"1099129644","full_name":"josivantarcio/API-Product","owner":"josivantarcio","description":"A simple RESTful API for managing products, built with Java and SpringBoot.   It supports basic CRUD operations, allowing clients to manage product data through HTTP endpoints.","archived":false,"fork":false,"pushed_at":"2025-11-18T17:59:23.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-18T18:22:16.177Z","etag":null,"topics":["api","java","jwt","postgresql","postman","rest-api","spring-data-jpa","spring-security","springboot"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/josevanoliveira/","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/josivantarcio.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-18T15:51:50.000Z","updated_at":"2025-11-18T17:59:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/josivantarcio/API-Product","commit_stats":null,"previous_names":["josivantarcio/api-product"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/josivantarcio/API-Product","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josivantarcio%2FAPI-Product","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josivantarcio%2FAPI-Product/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josivantarcio%2FAPI-Product/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josivantarcio%2FAPI-Product/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josivantarcio","download_url":"https://codeload.github.com/josivantarcio/API-Product/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josivantarcio%2FAPI-Product/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["api","java","jwt","postgresql","postman","rest-api","spring-data-jpa","spring-security","springboot"],"created_at":"2026-04-29T21:05:28.926Z","updated_at":"2026-04-29T21:05:29.694Z","avatar_url":"https://github.com/josivantarcio.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API-Product\n\nA RESTful API built with **Java** and **Spring Boot** for managing product data.  \nIt provides CRUD operations and supports both **H2 (in-memory)** and **PostgreSQL** databases, making it suitable for development, testing, and production environments.\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Technologies](#technologies)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Running the Application](#running-the-application)\n- [Database Configuration](#database-configuration)\n- [API Endpoints](#api-endpoints)\n- [Data Model](#data-model)\n- [Error Handling](#error-handling)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n\n---\n\n## Features\n\n- Create, update, delete, and retrieve products  \n- Configurable database support (H2 and PostgreSQL)  \n- Input validation using Spring  \n- Global exception handling  \n- Layered architecture following best practices  \n\n---\n\n## Technologies\n\n- Java  \n- Spring Boot  \n- Spring Web  \n- Spring Data JPA  \n- Maven  \n- **H2 Database (Development/Test)**  \n- **PostgreSQL (Production/Local)**  \n\n---\n\n## Getting Started\n\n### Prerequisites\n\nInstall the following before running the project:\n\n- Java JDK (21 or newer)\n- Maven\n- PostgreSQL (if using the production database profile)\n\n### Installation\n\nClone the repository:\n\n```bash\ngit clone https://github.com/josivantarcio/API-Product.git\ncd API-Product\nBuild the project:\n\nbash\nmvn clean install\nRunning the Application\nTo run with the default profile (using H2):\n\nbash\nmvn spring-boot:run\nTo run with PostgreSQL:\n\nbash\nmvn spring-boot:run -Dspring-boot.run.profiles=postgres\nDatabase Configuration\n✔ H2 Database (default)\nLocated in application.properties:\n\nproperties\nspring.datasource.url=jdbc:h2:mem:productsdb\nspring.datasource.driverClassName=org.h2.Driver\nspring.jpa.hibernate.ddl-auto=update\nspring.h2.console.enabled=true\n✔ PostgreSQL Database\nLocated in application-postgres.properties:\n\nproperties\nspring.datasource.url=jdbc:postgresql://localhost:5432/productsdb\nspring.datasource.username=postgres\nspring.datasource.password=your_password\nspring.jpa.hibernate.ddl-auto=update\nspring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect\nAPI Endpoints\nMethod\tEndpoint\tDescription\nGET\t/products\tGet all products\nGET\t/products/{id}\tGet product by ID\nPOST\t/products\tCreate a new product\nPUT\t/products/{id}\tUpdate a product\nDELETE\t/products/{id}\tRemove a product\n\nData Model\njava\npublic class Product {\n    private Long id;\n    private String name;\n    private String description;\n    private BigDecimal price;\n    private Integer stockQuantity;\n}\nError Handling\nThe API returns proper status codes and structured error responses.\n\nExample:\n\njson\n{\n  \"timestamp\": \"2025-11-18T12:40:12\",\n  \"status\": 404,\n  \"message\": \"Product not found\",\n  \"path\": \"/products/10\"\n}\nContributing\nFork the repository\n\nCreate a new branch:\n\nbash\ngit checkout -b feature/new-feature\nCommit your changes\n\nPush your branch\n\nOpen a Pull Request\n\nLicense\nThis project is licensed under the MIT License (or update if you choose another license).\n\nContact\n\nAuthor: Josevan Oliveira\n\nLinkedIn: https://www.linkedin.com/in/josevanoliveira/\nGitHub: https://github.com/josivantarcio\nPortfolio: https://josivantarcio.github.io/my-portfolio/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosivantarcio%2Fapi-product","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosivantarcio%2Fapi-product","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosivantarcio%2Fapi-product/lists"}