{"id":20103610,"url":"https://github.com/mmjck/backend_challenge_carbigdata","last_synced_at":"2026-04-11T17:03:13.098Z","repository":{"id":250586455,"uuid":"834260032","full_name":"mmjck/backend_challenge_carbigdata","owner":"mmjck","description":"Technical Test - Java Developer","archived":false,"fork":false,"pushed_at":"2024-07-31T20:11:46.000Z","size":159,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T17:31:28.002Z","etag":null,"topics":["java17","minio","postgresql","spring","spring-boot","spring-data-jpa","spring-security"],"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/mmjck.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-07-26T19:31:39.000Z","updated_at":"2024-07-29T03:45:53.000Z","dependencies_parsed_at":"2024-07-31T23:24:33.726Z","dependency_job_id":null,"html_url":"https://github.com/mmjck/backend_challenge_carbigdata","commit_stats":null,"previous_names":["mmjck/backend_challenge_carbigdata"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mmjck/backend_challenge_carbigdata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmjck%2Fbackend_challenge_carbigdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmjck%2Fbackend_challenge_carbigdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmjck%2Fbackend_challenge_carbigdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmjck%2Fbackend_challenge_carbigdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmjck","download_url":"https://codeload.github.com/mmjck/backend_challenge_carbigdata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmjck%2Fbackend_challenge_carbigdata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31687882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["java17","minio","postgresql","spring","spring-boot","spring-data-jpa","spring-security"],"created_at":"2024-11-13T17:37:20.709Z","updated_at":"2026-04-11T17:03:13.064Z","avatar_url":"https://github.com/mmjck.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003e\nBackend Challenge Carbigdata\n\u003c/h2\u003e\n\n\n\n# :rocket: Technologies used\n\n* [Docker](https://docs.docker.com/engine/install/)\n* [PostgreSql](https://www.postgresql.org/)\n* [Java 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) \n* [Spring Boot](https://spring.io/projects/spring-boot)\n* [Maven](https://maven.apache.org/)\n* [JUnit](https://junit.org/junit5/)\n* [MinIo](https://min.io/)\n* [Flyway](https://flywaydb.org/)\n\n\n\n# How to run\n\n- Clone the repository\n```\ngit clone https://github.com/mmjck/backend_challenge_carbigdata.git\n```\n\n\n- Build **Application** image on Docker\n\n```\ndocker-compose build -d\n```\n\nApplication will be running  `http://localhost:8080/` ✅   \n\n\n\nSee [file](https://github.com/mmjck/backend_challenge_carbigdata/blob/main/case.md)\nto example of how to use api\n \n:warning:\n\n- It is necessary create a bucket first to upload images\n- Access http://localhost:9001/login with and input this credentiais\n\t- username: username\n\t- password: password\n\nCreate bucket with this name\n`occurrences-images`\n\n\n\n# Endpoints \n\nThe REST API app is described below.\n\n\n## Auth module\n\n### 1. Create new Client\n`POST /api/v1/auth/register`\n\n```json\n{\n\t\"name\": \"Joao das silva\",\n\t\"birth_date\": \"2000-01-01T10:00:00\",\n\t\"cpf\": \"00000000000\",\n\t\"password\": \"teste123\"\n}\n```\n\n### 2. Login \n\n`POST /api/v1/auth/login`\n\n```json\n{\n\t\"cpf\": \"00000000000\",\n\t\"password\": \"teste123\"\n}\n```\n----\n:warning:\nBoth cases return a json with token generated. Ex: \n```json\n{\n\t\"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtcy1zZXJ2aWNlIiwic3ViIjoiMDI2ODMxMDkyMDIiLCJleHAiOjE3MjIyMDMxODZ9.oDNyay6YTZokNIavC5l_O0DjjElUQ14fU7pUMWoqb5s\"\n}\n```\n\n----\n\n\n\n## Clients\n\n### 1. Update client\n`PUT /api/v1/client/{id}`\n\n```json\n{\n\t\"name\": \"Joao das silva\",\n\t\"birth_date\": \"2000-01-01T10:00:00\",\n\t\"cpf\": \"00000000000\",\n\t\n}\n```\n\n### 2. Get client by id\n`GET /api/v1/client/{id}`\n\nExample os response \n```json\n{\n\t\"id\": 1,\n\t\"fullName\": \"Maria das silva\",\n\t\"cpf\": \"00000000000\",\n\t\"birthDate\": \"2000-01-01T10:00:00\",\n\t\"createdAt\": \"2024-07-28T14:46:26.450442\"\n}\n```\n\n### 3. Delete client\n`DELETE /api/v1/client/{id}`\n\n\n## Address Module\n\n### 1. Create address\n`POST /api/v1/address`\n\n```json\n{\n\t\"zip_code\": \"123123\",\n\t\"steet\": \"street\",\n\t\"city\": \"city\",\n\t\"state\": \"State\",\n\t\"district\": \"district\"\n}\n\n```\n\n### 2. Update address\n\n`PUT /api/v1/address`\n\nbody: \n\n```\n{\n\t\"zip_code\": \"123123\",\n\t\"steet\": \"street\",\n\t\"city\": \"city\",\n\t\"state\": \"State\",\n\t\"district\": \"district\"\n}\n\n```\n\n### 3. Get adddress by id\n\n`GET /api/v1/address/{id}`\n\n\nExample of response:\n```json\n{\n\t\"id\": 2,\n\t\"state\": \"state\",\n\t\"city\": \"city\",\n\t\"zipCode\": \"zipCode\",\n\t\"district\": \"district\",\n\t\"createdAt\": \"2024-07-28T13:41:34.976314\"\n}\n\n```\n\n### 4. Delete address\n`DELETE /api/v1/address/{id}`\n\n\n\n\n## Occurrence images Module\n\n### 1. Create occurrence image\n`POST /api/v1/occurrence-images`\n\nThis is `multipart/form-data` request \nYou need includ some fields:\noccurrence_id: {occurrenceId}\nfiles: array of images\n\n\n\n### 2. Update occurrence image \n- Only can update images\n\n`POST /api/v1/occurrence-images/{id}`\n\nThis is `multipart/form-data` request \nYou need includ some fields:\noccurrence_id: {occurrenceId}\nfiles: array of images\n\n\n\n### 3. Get by occurrence image id\n`GET /api/v1/occurrence-images/{id}`\n\n\nExample of response\n\n```json\n{\n\t\"id\": 4,\n\t\"occurrenceId\": 4,\n\t\"hash\": \"\u003cpath\u003e\",\n\t\"path\": \"\u003curl\u003e\",\n\t\"createdAt\": \"2024-07-28T15:35:19.153032\"\n}\n```\n\n\n### 4. Delete\n`DELETE /api/v1/occurrence-images/{id}`\n\n## Occurrences Module\n### 1. Create Occurrence\n`POST api/v1/occurrence`\n\n\nThis is `multipart/form-data` request \nYou need includ some fields:\nbody: \n```json\n{\n\t\"zip_code\": \"\u003czipcode\u003e\",\n\t\"steet\": \"\u003csteet\u003e\",\n\t\"city\": \"\u003ccity\u003e\",\n\t\"state\": \"\u003cstate\u003e\",\n\t\"district\": \"\u003cdistrict\u003e\",\n\t\"cpf\": \"\u003ccpf\u003e\",\n\t\"full_name\": \"\u003cfull_name\u003e\"\n}\n```\nfiles: array of images\n\n### 2. Get All\n`GET /api/v1/occurrence/list`\n\n```json\n[\n\t{\n\t\t\"id\": \"4\",\n\t\t\"state\": \"\u003cstate\u003e\",\n\t\t\"createdAt\": \"2024-07-28 15:35:19.134404\",\n\t\t\"status\": \"ACTIVE\",\n\t\t\"cpf\": \"\u003ccpf\u003e\",\n\t\t\"district\": \"\u003cdistrict\u003e\",\n\t\t\"city\": \"\u003ccity\u003e\",\n\t\t\"fullName\": \"\u003cfullname\u003e\",\n\t\t\"zipCode\": \"\u003czicode\u003e\",\n\t\t\"clientId\": 1,\n\t\t\"images\": [\n\t\t\t{\n\t\t\t\t\"hash\": \"\u003chash\u003e\",\n\t\t\t\t\"path\": \"\u003chash\u003e\"\n\t\t\t},\n\t\t\t\n\t\t]\n\t}\n]\n```\n\n\n### 3. Finish occurrence\n`GET /api/v1/occurrence/finish/{id}`\n\n\n\n\n\n\n\n# Missing requirements\n\n- Ordering the list of occurrences by creation date  \n    - ASC\n    - DESC   \n\n\n- Ordering the list of occurrences by city name\n    - ASC\n    - DESC\n\n- Update field occurrence_id by endpoint api/v1/occurrence-images\n\n\n- Update related fields from  api/v1/occurrence\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmjck%2Fbackend_challenge_carbigdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmjck%2Fbackend_challenge_carbigdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmjck%2Fbackend_challenge_carbigdata/lists"}