{"id":19865946,"url":"https://github.com/jessicatarra/refactoring-greenlight","last_synced_at":"2025-05-02T05:32:11.822Z","repository":{"id":210779819,"uuid":"726131487","full_name":"jessicatarra/refactoring-greenlight","owner":"jessicatarra","description":"Refactor Greenlight application by implementing clean architecture and SOLID principles","archived":false,"fork":false,"pushed_at":"2024-01-02T19:09:13.000Z","size":6841,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-01T17:41:30.343Z","etag":null,"topics":["clean-architecture","go","lets-go","lets-go-further","refactoring","solid-principles"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jessicatarra.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-12-01T15:46:22.000Z","updated_at":"2024-04-02T14:32:33.000Z","dependencies_parsed_at":"2024-11-12T15:32:05.635Z","dependency_job_id":"32408bdd-e806-4c59-a4f6-77e1236ca9b3","html_url":"https://github.com/jessicatarra/refactoring-greenlight","commit_stats":null,"previous_names":["jessicatarra/refactoring-greenlight"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessicatarra%2Frefactoring-greenlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessicatarra%2Frefactoring-greenlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessicatarra%2Frefactoring-greenlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessicatarra%2Frefactoring-greenlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jessicatarra","download_url":"https://codeload.github.com/jessicatarra/refactoring-greenlight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251992993,"owners_count":21677022,"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":["clean-architecture","go","lets-go","lets-go-further","refactoring","solid-principles"],"created_at":"2024-11-12T15:24:36.822Z","updated_at":"2025-05-02T05:32:06.813Z","avatar_url":"https://github.com/jessicatarra.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\n[![Go Coverage](https://github.com/jessicatarra/refactoring-greenlight/wiki/coverage.svg)](https://raw.githack.com/wiki/jessicatarra/refactoring-greenlight/coverage.html)\n\n## Refactoring Greenlight application \n\nThis project aims to refactor the Greenlight application by implementing clean architecture and SOLID principles. The goal is to improve the codebase's maintainability, scalability, and testability while increasing test coverage.\n\nTo understand the initial state of the project, please refer to the [previous README file](https://github.com/jessicatarra/greenlight/blob/main/README.md) or check the [API Docs](https://greenlight.tarralva.com/swagger/index.html) from V1 application version.\n\n\n### Diagram\n```mermaid\ngraph LR\n  subgraph ModularMonolith\n    subgraph AuthModule\n      subgraph DomainLayer\n        D1[Entities]\n        D2[Value Objects]\n      end\n      subgraph ApplicationLayer\n        A1[Use Cases]\n      end\n      subgraph InfrastructureLayer\n        I1[Repositories]\n        I2[REST API External Services]\n        I3[GRPC Internal Service]\n      end\n    end\n    subgraph Legacy Module\n      subgraph RestServer\n        RS1[Controllers]\n        RS2[Handlers]\n        subgraph Middleware\n          RS3[Auth GRPC Client]\n        end\n      end\n      subgraph Data Models\n      end\n    end\n  end\n```\nThe diagram represents the initial phase of the refactor process, focusing on separating the auth module from the existing codebase and applying a clean architecture to enhance its maintainability to each new module. The main objective is to isolate the auth module's functionality and ensure that other modules access user-related information and authentication through the internal GRPC auth service.\n\n### TODO\n- [x] Implement a modular monolith architecture style\n- [ ] Refactor initial implementation into separate modules \n  - [x] Add an authentication module\n    - [x] Implement the create user feature\n    - [x] Implement the activate user feature\n    - [x] Implement the create authentication token feature\n    - [x] Create auth gRPC methods\n  - [ ] Add a movies module\n  - [ ] Add a healthcheck module\n- [x] Refactor multiple functionalities into internal packages\n  - [x] Add support for background tasks\n  - [x] Add `log/slog` package\n  - [x] Add `mailer` package\n  - [x] Add utils package\n    - [x] Add validator `v2` package\n    - [x] Add validator helpers utilities\n    - [x] Add general helpers utilities\n  - [x] Add response package\n  - [x] Add request package\n  - [x] Add errors package\n  - [x] Add config package\n  - [x] Add shared middleware package\n        \n### References\n\n- https://github.com/golang-standards/project-layout\n- https://autostrada.dev/\n- https://github.com/qiangxue/go-rest-api/\n- https://github.com/powerman/go-service-example/\n- https://github.com/powerman/go-monolith-example\n- https://github.com/amitshekhariitbhu/go-backend-clean-architecture\n- https://github.com/evrone/go-clean-template/\n- https://github.com/booscaaa/clean-go/\n- https://github.com/bxcodec/go-clean-arch/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessicatarra%2Frefactoring-greenlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjessicatarra%2Frefactoring-greenlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessicatarra%2Frefactoring-greenlight/lists"}