{"id":48726975,"url":"https://github.com/budget-buddy-org/budget-buddy-api","last_synced_at":"2026-05-07T07:03:40.212Z","repository":{"id":341447849,"uuid":"1170139526","full_name":"budget-buddy-org/budget-buddy-api","owner":"budget-buddy-org","description":"API for Budget Buddy App","archived":false,"fork":false,"pushed_at":"2026-05-03T19:24:16.000Z","size":557,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-03T19:27:51.923Z","etag":null,"topics":["java","openapi-specification","rest-api","semantic-release","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/budget-buddy-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-01T18:57:58.000Z","updated_at":"2026-05-03T19:22:08.000Z","dependencies_parsed_at":"2026-04-03T17:02:15.707Z","dependency_job_id":null,"html_url":"https://github.com/budget-buddy-org/budget-buddy-api","commit_stats":null,"previous_names":["glebremniov/budget-buddy-api","budget-buddy-org/budget-buddy-api"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/budget-buddy-org/budget-buddy-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budget-buddy-org%2Fbudget-buddy-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budget-buddy-org%2Fbudget-buddy-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budget-buddy-org%2Fbudget-buddy-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budget-buddy-org%2Fbudget-buddy-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/budget-buddy-org","download_url":"https://codeload.github.com/budget-buddy-org/budget-buddy-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budget-buddy-org%2Fbudget-buddy-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32726687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","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","openapi-specification","rest-api","semantic-release","spring-boot"],"created_at":"2026-04-11T23:07:11.079Z","updated_at":"2026-05-07T07:03:40.201Z","avatar_url":"https://github.com/budget-buddy-org.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Budget Buddy API\n\n[![CI](https://github.com/budget-buddy-org/budget-buddy-api/actions/workflows/ci.yaml/badge.svg)](https://github.com/budget-buddy-org/budget-buddy-api/actions/workflows/ci.yaml)\n[![Release](https://img.shields.io/github/v/release/budget-buddy-org/budget-buddy-api)](https://github.com/budget-buddy-org/budget-buddy-api/releases)\n\nREST API for personal budget management. Built with Spring Boot 4 and PostgreSQL.\n\n## Tech Stack\n\n- **Java 25** / Spring Boot 4.0.5\n- **Spring Data JDBC** + PostgreSQL\n- **Spring Security** — stateless OIDC resource server with JWT validation\n- **Liquibase** — database migrations\n- **Budget Buddy Contracts** — external OpenAPI-based contracts\n- **Testcontainers** — integration tests\n- **Docker** — containerized deployment\n\n## Prerequisites\n\n- Java 25\n- Docker \u0026 Docker Compose\n- GitHub Packages authentication (see [Building](#building))\n\n## Running Locally\n\nThe project uses Spring Docker Compose — PostgreSQL starts automatically when you run the app.\n\n```bash\n# Clone the repository\ngit clone https://github.com/budget-buddy-org/budget-buddy-api.git\ncd budget-buddy-api\n\n# Set OIDC configuration (required for JWT validation)\nexport OIDC_ISSUER_URI=https://\u003cyour-auth-server-host\u003e\nexport OIDC_AUDIENCES=https://\u003cyour-oidc-audiences\u003e\n\n# Run with dev profile\n./gradlew bootRun --args='--spring.profiles.active=dev'\n```\n\nThe API will be available at `http://localhost:8080`.\n\n## Running with Docker Compose\n\n```bash\n# Copy and fill in environment variables\ncp .env.example .env\n\n# Start all services\ndocker compose up -d\n\n# View logs\ndocker compose logs -f app\n```\n\n### Environment Variables\n\n| Variable                 | Description                                                            |\n|--------------------------|------------------------------------------------------------------------|\n| `BUDGET_BUDDY_API_IMAGE` | Docker image (e.g. `ghcr.io/username/budget-buddy-api:latest`)         |\n| `SPRING_PROFILES_ACTIVE` | Spring profile (`prod`)                                                |\n| `DB_NAME`                | PostgreSQL database name                                               |\n| `DB_USER`                | PostgreSQL username                                                    |\n| `DB_PASSWORD`            | PostgreSQL password                                                    |\n| `OIDC_ISSUER_URI`        | OIDC issuer URI for JWT validation (e.g. `https://\u003cauth-server-host\u003e`) |\n| `OIDC_AUDIENCES`         | Expected JWT audience(s) (e.g. `https://\u003cyour-oidc-audiences\u003e`)        |\n\n## API\n\n### Authentication\n\nAuthentication is handled by an external OIDC provider. The API is a stateless resource server that validates JWTs using the JWKS endpoint discovered from `OIDC_ISSUER_URI`.\n\n- **Issuer \u0026 audience validation** — JWTs are verified against the configured issuer and must contain an expected audience (`OIDC_AUDIENCES`).\n- **Multi-issuer support** — The same `sub` claim from different issuers is treated as separate users (composite unique constraint on `oidc_subject + oidc_issuer`).\n- **JIT provisioning** — On first authenticated request, a local user is automatically created by mapping the JWT `sub` and `iss` claims to a local user record.\n\n### Categories\n\n| Method   | Endpoint                      | Description                      |\n|----------|-------------------------------|----------------------------------|\n| `GET`    | `/v1/categories`              | List categories                  |\n| `POST`   | `/v1/categories`              | Create category                  |\n| `GET`    | `/v1/categories/{categoryId}` | Get category                     |\n| `PUT`    | `/v1/categories/{categoryId}` | Replace category (full update)   |\n| `PATCH`  | `/v1/categories/{categoryId}` | Update category (partial update) |\n| `DELETE` | `/v1/categories/{categoryId}` | Delete category                  |\n\n### Transactions\n\n| Method   | Endpoint                           | Description                         |\n|----------|------------------------------------|-------------------------------------|\n| `GET`    | `/v1/transactions`                 | List transactions (with filters)    |\n| `POST`   | `/v1/transactions`                 | Create transaction                  |\n| `GET`    | `/v1/transactions/{transactionId}` | Get transaction                     |\n| `PUT`    | `/v1/transactions/{transactionId}` | Replace transaction (full update)   |\n| `PATCH`  | `/v1/transactions/{transactionId}` | Update transaction (partial update) |\n| `DELETE` | `/v1/transactions/{transactionId}` | Delete transaction                  |\n\nAll endpoints require `Authorization: Bearer \u003caccess_token\u003e` (JWT issued by the OIDC provider).\n\n## Building\n\nTo build the project, you need to provide GitHub credentials to access the `budget-buddy-contracts` package. You can set `GITHUB_ACTOR` and `GITHUB_TOKEN` environment variables, or provide them via `gradle.properties`:\n\n```bash\n# Build and run tests\n./gradlew build -Pgpr.user=YOUR_USERNAME -Pgpr.key=YOUR_TOKEN\n```\n\n### Build Docker image\n\n```bash\n./gradlew bootBuildImage --imageName=ghcr.io/your-username/budget-buddy-api:latest\n```\n\n## Tests\n\n```bash\n./gradlew test                  # Run all tests (unit + integration)\n./gradlew integrationTest       # Run integration tests (requires Docker)\n./gradlew check                 # Run all tests + quality checks\n```\n\n## Health Check\n\n```\nGET /actuator/health\n```\n\n### PATCH Behavior\n\nThe API supports JSON Merge Patch semantics for fields that can be cleared:\n- **Provided value**: Updates the field to the new value.\n- **Explicit `null`**: Sets the field to `null` in the database.\n- **Omitted field**: Leaves the existing value unchanged.\n\nThis is implemented using MapStruct with `JsonNullable` support in the `BaseEntityMapper`.\n\n### Error Responses (RFC 9457)\n\nThe API uses standardized Problem Details for HTTP APIs (RFC 9457) for all error responses.\nWhen `type` is `about:blank`, the `title` field corresponds to the standard HTTP status phrase.\n\nFor validation errors (`400 Bad Request`), the response is extended with an `errors` array containing field-level details:\n\n```json\n{\n  \"type\": \"about:blank\",\n  \"title\": \"Bad Request\",\n  \"status\": 400,\n  \"detail\": \"One or more fields are invalid\",\n  \"instance\": \"/v1/transactions\",\n  \"errors\": [\n    { \"field\": \"amount\", \"message\": \"must be greater than 0\" }\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudget-buddy-org%2Fbudget-buddy-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbudget-buddy-org%2Fbudget-buddy-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudget-buddy-org%2Fbudget-buddy-api/lists"}