{"id":28325906,"url":"https://github.com/coder-shankar/virtual-power-plant-system","last_synced_at":"2025-06-24T04:31:10.263Z","repository":{"id":296762590,"uuid":"986493604","full_name":"coder-shankar/virtual-power-plant-system","owner":"coder-shankar","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-21T14:19:29.000Z","size":302,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T07:26:37.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/coder-shankar.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-05-19T17:35:50.000Z","updated_at":"2025-05-21T14:19:32.000Z","dependencies_parsed_at":"2025-06-02T07:26:40.995Z","dependency_job_id":"3411303a-002b-4b30-8aa1-3d6e7f66d4e4","html_url":"https://github.com/coder-shankar/virtual-power-plant-system","commit_stats":null,"previous_names":["coder-shankar/virtual-power-plant-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coder-shankar/virtual-power-plant-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder-shankar%2Fvirtual-power-plant-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder-shankar%2Fvirtual-power-plant-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder-shankar%2Fvirtual-power-plant-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder-shankar%2Fvirtual-power-plant-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coder-shankar","download_url":"https://codeload.github.com/coder-shankar/virtual-power-plant-system/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder-shankar%2Fvirtual-power-plant-system/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261603958,"owners_count":23183569,"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":[],"created_at":"2025-05-25T22:08:54.581Z","updated_at":"2025-06-24T04:31:10.251Z","avatar_url":"https://github.com/coder-shankar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virtual Power Plant System\n\n## Overview\n\nThis project implements a Virtual Power Plant (VPP) system that manages a network of batteries. It\nprovides REST APIs for battery registration and statistical analysis of battery capacities within\nspecified ranges.\n\n## Technical Stack\n\n- Java 21 (with Virtual Threads support)\n- Spring Boot\n- Spring Data JPA\n- TestContainers\n- REST Assured\n- JUnit 5\n- Mockito\n- Lombok\n- PostgreSQL\n\n## Architecture Decisions\n\n1. A layered architecture using Spring Boot with clear separation between:\n    - REST Controllers (API layer)\n    - Service layer (business logic)\n    - Repository layer (data access)\n    - DTOs for request/response handling\n2. MapStruct for object mapping between entities and DTOs\n3. Spring Data JPA for data persistence\n4. Virtual threads for handling concurrent operations\n5. Validation using Jakarta validation framework\n\n## Testing Strategy\n\n- Unit Tests: Testing service layer with Mockito\n- Integration Tests: Using TestContainers for database integration tests\n- API Tests: Using REST Assured for endpoint testing\n- Concurrent Testing: Implementation of virtual threads for load testing\n\n## Performance Considerations\n\n- Utilized Virtual Threads for handling concurrent requests efficiently\n- Implemented batch processing for battery registration\n- Used JPA batch operations for database performance\n\n## Local Development Setup Guide\n\n## Prerequisites\n\n- JDK 21 or later\n- Docker and Docker Compose\n- Gradle 8.5 or later (or use the included Gradle wrapper)\n- Git\n\n## Clone Repository\n\n```bash\n  git clone https://github.com/coder-shankar/virtual-power-plant-system\n  cd virtual-power-plant-system\n```\n\n## Option 1: Gradle Setup (Direct)\n\n### Build and Test\n\n## Using Gradle wrapper\n\n```bash\n  ./gradlew clean build\n````\n\n## Run tests\n\n```bash\n  ./gradlew test\n````\n\n## Run application\n\n```bash\n  ./gradlew bootRun\n```\n\n### Configuration\n\nCreate `application-local.yml` in `src/main/resources\n\n### Database Setup (PostgreSQL)\n\n```bash\n  docker run --name postgres-battery\n   -e POSTGRES_DB=vpp_db\n   -e POSTGRES_USER=postgres\n   -e POSTGRES_PASSWORD=postgres\n   -p 5432:5432\n   -d postgres:16-alpine\n```\n\n## Option 2: Docker Setup\n\n## Build an application\n\n```bash\n  ./gradlew clean build\n```\n\n## Docker compose\n\n```bash\n  docker-compose up --build\n```\n\n## Health API\n```bash\n  curl http://localhost:8080/actuator/health\n```\n\n## Testing Coverage\n\n```bash\n  ./gradlew test jacocoMergedReport\n  \n```\n\n1. **Unit Tests**\n    - Battery registration\n    - Statistics calculation\n    - Edge cases and validation\n\n2. **Integration Tests**\n    - API endpoint testing\n    - Request/Response validation\n    - Concurrent request handling\n    - Database integration\n\n\n\n![jacoco-report.png](jacoco-report.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder-shankar%2Fvirtual-power-plant-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoder-shankar%2Fvirtual-power-plant-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder-shankar%2Fvirtual-power-plant-system/lists"}