Skip to content

Reorganize#97

Open
adrian-brady wants to merge 7 commits intomainfrom
reorganize
Open

Reorganize#97
adrian-brady wants to merge 7 commits intomainfrom
reorganize

Conversation

@adrian-brady
Copy link
Contributor

@adrian-brady adrian-brady commented May 7, 2025

Codebase Reorganization

Aims to reorganize significant portions of the codebase to establish a clearer distinction between internal implementation components and public-facing, reusable components.

The primary structural change involves the addition of the internal directory for all non-public code, while the pkg directory is reserved for components designed for external use or reuse.

Changes

internal Directory

The internal directory now serves as the primary location for all code that is not to be imported or used directly by external projects or consumers - realistically none of this codebase is designed with external use in mind but still

  • internal/application/ (formerly services):
    • Purpose: Intended for services that orchestrate and manage core business logic and application-specific workflows, acting as an intermediary between the domain layer and infrastructure/ui layers.
    • Benefit: Centralize application-level operations, making the flow of control easier to understand and manage.
  • internal/domain
    • Purpose: Hold core business entities, objects, and abstractions.
    • Benefit/Goal: Provides a clear and isolated representation of business structures, independent of application or infrastructure
  • internal/infra/ (Infrastructure)
    • Purpose: Consolidation of all infrastructure related code. This includes implementations for interacting with external systems, databases, cloud services, etc.
    • Benefit: Isolate external dependencies
    • Subdirectories:
      • internal/infra/aws/: Implementations for AWS clients, services, and data models.
      • internal/infra/database/: Houses all database-related components. This is practically just a directory move from the previous implementation.
      • internal/infra/http/: Includes HTTP request handlers, API routes, middleware, and other components related to the HTTP interface.

pkg Directory

The pkg directory is now, in theory, more purposely used, holding public-facing, reusable libraries and components.

@adrian-brady adrian-brady force-pushed the reorganize branch 13 times, most recently from 11ea3b6 to 0289c44 Compare May 7, 2025 21:38
@adrian-brady adrian-brady marked this pull request as ready for review May 8, 2025 02:03
- name: "db"
path: "./pkg/db/generated"
queries: "./pkg/db/queries"
path: "./internal/infrastructure/database/sqlc/generated"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean internal/infra?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants