{"id":24773935,"url":"https://github.com/gabrielferreira02/expenses-manager-api","last_synced_at":"2026-04-17T10:31:17.124Z","repository":{"id":272328108,"uuid":"912906978","full_name":"gabrielferreira02/expenses-manager-api","owner":"gabrielferreira02","description":"Simple API that provides an expense manager with JWT authentication","archived":false,"fork":false,"pushed_at":"2025-01-13T17:33:35.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T12:59:04.095Z","etag":null,"topics":["java","jwt","postgresql","spring","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/gabrielferreira02.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":"2025-01-06T16:29:09.000Z","updated_at":"2025-01-13T17:33:39.000Z","dependencies_parsed_at":"2025-01-13T18:42:03.330Z","dependency_job_id":"3e38e0ce-e5fd-4aec-b68f-745e3640aee1","html_url":"https://github.com/gabrielferreira02/expenses-manager-api","commit_stats":null,"previous_names":["gabrielferreira02/expenses-manager-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gabrielferreira02/expenses-manager-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielferreira02%2Fexpenses-manager-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielferreira02%2Fexpenses-manager-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielferreira02%2Fexpenses-manager-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielferreira02%2Fexpenses-manager-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielferreira02","download_url":"https://codeload.github.com/gabrielferreira02/expenses-manager-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielferreira02%2Fexpenses-manager-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31925285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T10:19:20.377Z","status":"ssl_error","status_checked_at":"2026-04-17T10:19:18.682Z","response_time":62,"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":["java","jwt","postgresql","spring","spring-security"],"created_at":"2025-01-29T05:19:59.298Z","updated_at":"2026-04-17T10:31:17.105Z","avatar_url":"https://github.com/gabrielferreira02.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expenses-manager-api\n\n![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)\n![Spring](https://img.shields.io/badge/spring-%236DB33F.svg?style=for-the-badge\u0026logo=spring\u0026logoColor=white)\n![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n\n\nThis is a repository with the implementation of an expense management API that uses jwt authorization, automated tests with JUnit and Mockito, and migration control.\n\nTo use this repository you need to clone the project using:\n  ```bash\n  git clone https://github.com/gabrielferreira02/expenses-manager-api.git\n  ```\nNow ropen the project with your IDE and start the application.\n\nTo access the application's resources, you must be authenticated with a user registered in the database. So, to register a user, the correct endpoint is:\n  ```\n  POST http://localhost:8080/auth/register\n  ```\nAnd in the body of this request, put the following code as a json format in postman, imnsonia or any other.\n  ```\n  {\n    \"username\": \"user\",\n    \"password\": \"1234\"\n  }\n  ```\n\nYou should receive status code 200 with the following response.\n  ```\n  {\n    \"id\": \"some id\",\n    \"username\": \"user\",\n    \"password\": \"$2a$10$8IrJdLelPQYLTago7jfoaeIJ2qtG4N4g.rE4kpwrps7GtVsdN7JeS\"\n  }\n  ```\nYou need to store the user id to use it in other endpoints.\n\nWith the user registered on the database, now you can use the same data in the body of the request to login in the application with the following endpoint:\n  ```\n  POST http://localhost:8080/auth/login\n  ```\nYou should received a 200 status code and in the body of the request have the following code:\n  ```\n  {\n    \"token\": \"your jwt token\"\n  }\n  ```\nThis token is the key to access all the other resourcers in the application and it is used as a Bearer token authentication and in every request that you will make, is neccessary to put this token.\n\nTo create a new transaction use the following endpoint\n  ```\n  POST http://localhost:8080/transactions\n  ```\nIn the body of the request as a json put this:\n  ```\n  {\n    \"id\": \"your user id\",\n    \"value\": 200.0,\n    \"type\": \"RECEIVED\"\n  }\n  ```\nAn important point is that the type of transaction is validate with a Enum like this:\n  ```\n  {\n    RECEIVED,\n    PAID\n  }\n  ```\nOnly this two values can be registered on the transaction's type\n\nYou can create as many transactions as you want\n\nTo edit any transaction:\n  ```\n  PATCH http://localhost:8080/transactions\n  ```\n  ```\n  {\n    \"id\": \"transaction id\",\n    \"value\": 250.0,\n    \"type\": \"RECEIVED\"\n  }\n  ```\nTo delete any transaction:\n  ```\n  DELETE http://localhost:8080/transactions/{transaction_id}\n  ```\nTo return a list of the transactions you have made\n  ```\n  GET http://localhost:8080/transactions/{user_id}\n  ```\nAnd to return a report with the total received in the current month:\n  ```\n  GET http://localhost:8080/transactions/report/{user_id}\n  ```\nThis will return the following response: \n```\n  {\n    \"total\": 100.0\n  }\n  ```\nThe total is calculated subtracting the sum of the received transactions by the sum of the paid transactions.\n\nAnd also, you can run the automated tests using mvn test in the terminal or using the maven manager of your IDE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielferreira02%2Fexpenses-manager-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielferreira02%2Fexpenses-manager-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielferreira02%2Fexpenses-manager-api/lists"}