{"id":25821509,"url":"https://github.com/kaikymoura/backend-expensemanager","last_synced_at":"2026-05-10T12:20:58.802Z","repository":{"id":258309784,"uuid":"851775174","full_name":"kaikyMoura/backEnd-ExpenseManager","owner":"kaikyMoura","description":"Back end do projeto de gestão de despesas","archived":false,"fork":false,"pushed_at":"2024-11-25T21:06:26.000Z","size":233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-25T22:22:06.212Z","etag":null,"topics":["banco-de-dados","crud-api","google","google-cloud-platform","google-cloud-run-deployment","google-cloud-storage","java","jwt-authentication","jwt-token","sendgrid","spring-boot","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/kaikyMoura.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-09-03T17:23:33.000Z","updated_at":"2024-11-25T21:06:29.000Z","dependencies_parsed_at":"2024-10-18T11:52:48.956Z","dependency_job_id":"7385a46a-9455-4e2c-a6b6-3c6183f64427","html_url":"https://github.com/kaikyMoura/backEnd-ExpenseManager","commit_stats":null,"previous_names":["kaikymoura/backend-expensemanager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaikyMoura%2FbackEnd-ExpenseManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaikyMoura%2FbackEnd-ExpenseManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaikyMoura%2FbackEnd-ExpenseManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaikyMoura%2FbackEnd-ExpenseManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaikyMoura","download_url":"https://codeload.github.com/kaikyMoura/backEnd-ExpenseManager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241139920,"owners_count":19916466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["banco-de-dados","crud-api","google","google-cloud-platform","google-cloud-run-deployment","google-cloud-storage","java","jwt-authentication","jwt-token","sendgrid","spring-boot","spring-security"],"created_at":"2025-02-28T10:55:52.269Z","updated_at":"2026-05-10T12:20:58.787Z","avatar_url":"https://github.com/kaikyMoura.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003eExpense Manager API - Backend\u003c/h2\u003e\n\u003cp align=\"center\"\u003e\u003ci\u003eRepository for the Expense Manager backend API\u003c/i\u003e\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \n![GitHub top language](https://img.shields.io/github/languages/top/kaikyMoura/backEnd-ExpenseManager)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ce1f958181d743b98107dbc70dfac5ed)](https://app.codacy.com/gh/kaikyMoura/backEnd-ExpenseManager/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n![Repository size](https://img.shields.io/github/repo-size/kaikyMoura/backEnd-ExpenseManager)\n![Github last commit](https://img.shields.io/github/last-commit/kaikyMoura/backEnd-ExpenseManager)\n![License](https://img.shields.io/aur/license/LICENSE)\n![Languages count](https://img.shields.io/github/languages/count/kaikyMoura/backEnd-ExpenseManager)\n\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n### 1. About the Project\nThis project is the backend for the [Expense Manager](https://github.com/kaikyMoura/expense-manager), responsible for user authentication and full CRUD operations for expense management. It is built with Spring Boot 3.2.9 and JDK 21, using PostgreSQL as the main database.\n\nThe application is designed following RESTful principles and implements security and token-based authentication via JWT.\n\n\u003cbr/\u003e\n\n### 2. Key Features\n- User authentication and authorization using JWT.\n- Full expense CRUD (Create, Read, Update, Delete).\n- Role-based access control (e.g., default user role customer).\n- Email notification support via SendGrid.\n- Deployment-ready for Google Cloud Run and file storage with Google Cloud Storage.\n- Monitoring and health checks using Actuator.\n- In-memory H2 Database for development and testing environments.\n\n\u003cbr/\u003e\n\n### 3. Technologies \u0026 Dependencies\n\u003cp display=\"inline-block\"\u003e \u003cimg alt=\"java-logo\" width=\"48\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/java/java-original.svg\" /\u003e \u003cimg alt=\"spring-logo\" width=\"48\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/spring/spring-original-wordmark.svg\" /\u003e \u003cimg alt=\"postgres-logo\" width=\"48\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/postgresql/postgresql-original.svg\" /\u003e \u003cimg alt=\"google-cloud-logo\" width=\"48\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/googlecloud/googlecloud-original.svg\" /\u003e \u003cimg alt=\"docker-logo\" width=\"48\" src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/docker/docker-original.svg\" /\u003e \u003c/p\u003e\n\n#### Main Dependencies:\n\n- [spring-boot-starter-actuator](https://spring.io/guides/gs/actuator-service):\n  \u003cbr/\u003eProvides monitoring and management features for the Spring Boot application, including HTTP endpoints for health checks, metrics, and application info.\n\n- [spring-boot-starter-data-jpa](https://spring.io/projects/spring-data-jpa/):\n  \u003cbr/\u003eSimplifies the use of Java Persistence API (JPA) in Spring Boot, providing configurations, JPA entities, and repository support for easy CRUD operations.\n\n- [h2-database](https://www.h2database.com/html/main.html): \n  \u003cbr/\u003eAn in-memory relational database used for development and testing, with a web console for database management.\n  \n- [spring-boot-starter-security](https://spring.io/projects/spring-security): \n  \u003cbr/\u003eProvides authentication and authorization support, including protection against CSRF and XSS attacks.\n\n- [java-jwt](https://github.com/auth0/java-jwt):\n  \u003cbr/\u003eA library for creating and validating JWT tokens, used for authentication and authorization in web apps and RESTful APIs.\n\n- [spring-boot-starter-oauth2-resource-server](https://docs.spring.io/spring-security/reference/servlet/oauth2/resource-server/index.html) : Resource protection.\n  \u003cbr/\u003eAdds support for implementing OAuth 2.0 resource servers in Spring Boot apps, protecting APIs via OAuth 2.0.\n  \n- [lombok](https://projectlombok.org):\n  \u003cbr/\u003eReduces boilerplate code using annotations for generating getters, setters, constructors, and more during compile time.\n\n- [SendgridApi](https://sendgrid.com/en-us):\n \u003cbr/\u003e A platform for transactional and marketing email services with an easy-to-integrate API. Offers features like email tracking, analytics, and automation.\n\n- [Google Cloud run](https://cloud.google.com/run) / [Google Cloud Build](https://cloud.google.com/build) :\n \u003cbr/\u003eA fully managed platform to build, deploy, and run containers with automatic scaling — without the need to manage servers or infrastructure.\n  Cloud Build enables serverless CI/CD pipelines, making it easy to automate deployments to Cloud Run and other Google Cloud services.\n\n- [Google Cloud Storage](https://cloud.google.com/storage?hl=pt_br) :\n  \u003cbr/\u003e A secure, scalable cloud storage solution by Google.\n  \u003cbr/\u003e[Code exemples](https://cloud.google.com/storage/docs/samples/)\n\n\u003cbr/\u003e\n\n### 4. Architecture\n\nThe project follows RESTful architecture, with a clear separation of services and controllers.\n\nTest endpoints require proper credentials and roles.\n\n⚙️ Account Creation \u0026 Authentication Flow:\n- To create an account, send a POST request to **/user** with an email and password.\n- Passwords are securely encrypted before being stored.\n- Upon account creation, a JWT token is generated for authentication and authorization.\n- By default, new users are assigned the \"customer\" role.\n- Token validation and role-based access control are handled automatically in the background.\n\n\u003cbr/\u003e\n  \n### 5. Installation and Setup\n\n#### Prerequisites:\nBefore running the project, ensure that Java is installed on your machine. If not, you can download it from the [official Oracle website](https://www.oracle.com/java/technologies/downloads) (version 17 or later is recommended).\n\u003cbr/\u003eTo verify your Java installation, run:\n\n```bash\njava -version\n```\n\n#### Clone the repository to your local machine:\nClone the repository to your local machine:\n\n```console\ngit clone https://github.com/kaikyMoura/backEnd-ExpenseManager.git\n```\n\nNavigate to the project's root directory:\n\n```console\ncd backEnd-ExpenseManager\n```\n\n#### Building the Project\nUse Maven to clean and package the application:\n\n```console\nmvn clean package\n```\n\n#### Running the Application\nOnce the build is complete, you can start the application with:\n\n```console\njava -jar target/expenseManager-0.0.1-SNAPSHOT.jar\n```\n\nOr you can run directly in your IDE.\n\n#### The API will be available on:\n\n```console\nhttp://localhost:8080\n```\n\n\u003cbr/\u003e\n\n### 6. 🚀 Deploy\n### Deployment on Google Cloud Run with Continuous Integration via Cloud Build and GitHub\n\u003cbr/\u003e The deployment of the project is done on Google Cloud Run, leveraging Cloud Build for continuous integration. This setup ensures that any changes pushed to the repository on GitHub are automatically built and deployed to Cloud Run.\n\n- Key Steps:\n  - Cloud Build: Automatically builds the Docker image from the GitHub repository and pushes it to Google Container Registry.\n  - Cloud Run Deployment: After the image is built, Cloud Run deploys the application using the newly created image.\n  - Service Account: A service account with appropriate permissions (such as access to Google Cloud Storage) is used to ensure the application can interact with required   resources securely.\n\nThis setup enables automated and seamless deployment, reducing manual intervention and ensuring continuous delivery of updates to the production environment.\n\n\u003cbr/\u003e\n\n### 7. API Documentation\nThe API follows RESTful patterns, and endpoints include:\n\n|  Method  |\tEndpoint |  Description |  Auth Required  |\n| --- | --- | --- | --- |\n|   **POST**   |\t `/user`\t |  Register new user  |  No  | \n|   **POST**\t |  `/auth/login`  |\tAuthenticate and get token | \tNo  |\n|  **CRUD**\t   |  `/expense`  |  Manage user expenses  |  Yes  |\n\n\u003cbr/\u003e\n\n### 8. Terms of Use\n- **Non-commercial** project.\n- All rights related to user data and privacy are respected.\n- External services (e.g., SendGrid, Google Cloud) follow their own Terms of Use.\n- This project aims to serve as a learning and portfolio tool.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaikymoura%2Fbackend-expensemanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaikymoura%2Fbackend-expensemanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaikymoura%2Fbackend-expensemanager/lists"}