{"id":30931098,"url":"https://github.com/risixdzn/smit.teste","last_synced_at":"2026-04-29T16:34:45.966Z","repository":{"id":304592479,"uuid":"1018672208","full_name":"risixdzn/smit.teste","owner":"risixdzn","description":"SMIT - Teste técnico Spring","archived":false,"fork":false,"pushed_at":"2025-07-14T03:18:28.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-10T13:31:29.864Z","etag":null,"topics":["crud","mysql","spring","swagger"],"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/risixdzn.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}},"created_at":"2025-07-12T19:17:54.000Z","updated_at":"2025-07-14T03:18:31.000Z","dependencies_parsed_at":"2025-07-14T06:03:57.367Z","dependency_job_id":"467c6a9b-e024-4f2c-a676-a1e6ff10594c","html_url":"https://github.com/risixdzn/smit.teste","commit_stats":null,"previous_names":["risixdzn/smit.teste"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/risixdzn/smit.teste","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risixdzn%2Fsmit.teste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risixdzn%2Fsmit.teste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risixdzn%2Fsmit.teste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risixdzn%2Fsmit.teste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/risixdzn","download_url":"https://codeload.github.com/risixdzn/smit.teste/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risixdzn%2Fsmit.teste/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32435108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"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":["crud","mysql","spring","swagger"],"created_at":"2025-09-10T11:43:13.473Z","updated_at":"2026-04-29T16:34:45.929Z","avatar_url":"https://github.com/risixdzn.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMIT CRUD\n\nAPI REST para gerenciamento de **Produtos** e **Pedidos**.\n\n[![Java](https://img.shields.io/badge/Java-%23ED8B00.svg?logo=openjdk\u0026logoColor=white)](#) [![Spring Boot](https://img.shields.io/badge/Spring%20Boot-6DB33F?logo=springboot\u0026logoColor=fff)](#) [![MySQL](https://img.shields.io/badge/MySQL-4479A1?logo=mysql\u0026logoColor=fff)](#) [![Swagger](https://img.shields.io/badge/Swagger-82e82c?logo=swagger\u0026logoColor=000)](#)\n\n## 🔧 Tecnologias\n\n* Java 17\n* Spring Boot 3.x\n* Spring Data JPA (Hibernate)\n* MapStruct\n* Bean Validation (jakarta.validation)\n* Lombok\n* Swagger/OpenAPI (springdoc)\n* MySQL 8.3\n\n## 🚀 Pré-requisitos\n\n* Docker \u0026 Docker Compose\n* JDK 17+\n* Maven ou Gradle\n\n## 🛠️ Instalação e execução\n\n1. Clone o repositório:\n\n```bash\ngit clone https://github.com/risixdzn/smit.teste.git\ncd smit.teste\n```\n\n2. Renomeie o arquivo de ambiente e configure as variáveis (ou use o `.env.example` como base):\n\n```bash\nmv .env.example .env\n# Edite .env para ajustar DB_ROOT_PASSWORD, DB_DATABASE, DB_USER, DB_PASSWORD\n```\n\n3. Inicie o banco de dados via Docker:\n\n```bash\ndocker-compose up -d\n```\n\n4. Compile e execute a aplicação:\n\n```bash\nmvn spring-boot:run\n# ou\n./mvnw spring-boot:run\n```\n\n- Na IDE (JetBrains): selecione a classe `CrudApplication` e clique em ▶️ Run, ou use a configuração Maven \"\nspring-boot\\:run\".\n\nA API estará disponível em `http://localhost:8080`.\n\n## 📄 Documentação Swagger / OpenAPI\n\nAcesse em:\n\n```\nhttp://localhost:8080/api/reference\n```\n\n## 🍃 Endpoints principais\n\n* **Produtos:** `/api/produtos`\n* **Pedidos:** `/api/pedidos`\n\n## 📝 Regras de negócio\n\n* **Validação de estoque** antes de criar pedido; retorna 422 se insuficiente.\n* **Atualização de estoque** ao confirmar pedido.\n* Cálculo de total do pedido via método `getTotal()`.\n\n## 🐳 Docker Compose\n\nArquivo `docker-compose.yml` utilizado:\n\n```yaml\nversion: '3.8'\n\nservices:\n  db:\n    image: mysql:8.3.0-oraclelinux8\n    container_name: smit_mysql\n    restart: always\n    env_file:\n      - .env\n    environment:\n      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}\n      MYSQL_DATABASE: ${DB_DATABASE}\n      MYSQL_USER: ${DB_USER}\n      MYSQL_PASSWORD: ${DB_PASSWORD}\n    ports:\n      - \"3306:3306\"\n    volumes:\n      - mysql_data:/var/lib/mysql\n\nvolumes:\n  mysql_data:\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frisixdzn%2Fsmit.teste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frisixdzn%2Fsmit.teste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frisixdzn%2Fsmit.teste/lists"}