Skip to content

Instantly share code, notes, and snippets.

@luizlealdev
Last active October 8, 2025 21:55
Show Gist options
  • Select an option

  • Save luizlealdev/acf910e375aa234d3a74c66f7b818b11 to your computer and use it in GitHub Desktop.

Select an option

Save luizlealdev/acf910e375aa234d3a74c66f7b818b11 to your computer and use it in GitHub Desktop.
Clean Architecture Folder Structure (Android)

πŸ‡ΊπŸ‡Έ English

app/
└── src/
    └── main/
        └── java/com/exemplo/app/
            β”œβ”€β”€ presentation/          πŸ‘ˆ Presentation layer (UI)
            β”‚    β”œβ”€β”€ components/      -> Reusable Composables
            β”‚    β”œβ”€β”€ screens/         -> Screens (each with its ViewModel)
            β”‚    β”‚    β”œβ”€β”€ home/
            β”‚    β”‚    β”œβ”€β”€ login/
            β”‚    β”‚    └── settings/
            β”‚    └── navigation/      -> Routes, NavHost
            β”‚
            β”œβ”€β”€ domain/              πŸ‘ˆ Domain layer (Business rules)
            β”‚    β”œβ”€β”€ model/          -> Domain entities
            β”‚    β”œβ”€β”€ repository/     -> Interfaces (repository contracts)
            β”‚    └── usecase/        -> Use cases (business logic)
            β”‚
            β”œβ”€β”€ persistence/         πŸ‘ˆ Data layer (Actual implementations)
            β”‚    β”œβ”€β”€ entity/         -> Database entities (Room)
            β”‚    β”œβ”€β”€ repository/     -> Concrete repository implementations
            β”‚    β”œβ”€β”€ remote/         -> APIs, DTOs, Retrofit
            β”‚    └── local/          -> DAOs, DataStore, SharedPrefs
            β”‚
            β”œβ”€β”€ di/                  πŸ‘ˆ Dependency Injection (Hilt/Koin)
            β”‚
            β”œβ”€β”€ util/                πŸ‘ˆ Helper functions, extensions, constants
            β”‚    β”œβ”€β”€ Constants.kt    -> Global constants
            β”‚    └── Extensions.kt
            β”‚
            └── core/ (optional)     πŸ‘ˆ Common layer, if multi-module

πŸ‡§πŸ‡· PortuguΓͺs

app/
 └── src/
      └── main/
           └── java/com/exemplo/app/
                β”œβ”€β”€ presentation/        πŸ‘ˆ Camada de apresentaΓ§Γ£o (UI)
                β”‚    β”œβ”€β”€ components/     -> Composables reutilizΓ‘veis
                β”‚    β”œβ”€β”€ screens/        -> Telas (cada uma com seu ViewModel)
                β”‚    β”‚    β”œβ”€β”€ home/
                β”‚    β”‚    β”œβ”€β”€ login/
                β”‚    β”‚    └── settings/
                β”‚    └── navigation/     -> Rotas, NavHost
                β”‚
                β”œβ”€β”€ domain/              πŸ‘ˆ Camada de domΓ­nio (regras de negΓ³cio)
                β”‚    β”œβ”€β”€ model/          -> Entidades de domΓ­nio
                β”‚    β”œβ”€β”€ repository/     -> Interfaces (contratos dos repositΓ³rios)
                β”‚    └── usecase/        -> Casos de uso (lΓ³gica de negΓ³cio)
                β”‚
                β”œβ”€β”€ persistence/         πŸ‘ˆ Camada de dados (implementaΓ§Γ΅es reais)
                β”‚    β”œβ”€β”€ entity/         -> Entidades do banco de dados (Room)
                β”‚    β”œβ”€β”€ repository/     -> ImplementaΓ§Γ΅es concretas dos repositΓ³rios
                β”‚    β”œβ”€β”€ remote/         -> APIs, DTOs, Retrofit
                β”‚    └── local/          -> DAOs, DataStore, SharedPrefs
                β”‚
                β”œβ”€β”€ di/                  πŸ‘ˆ InjeΓ§Γ£o de dependΓͺncia (Hilt/Koin)
                β”‚
                β”œβ”€β”€ util/                πŸ‘ˆ FunΓ§Γ΅es de ajuda, extensΓ΅es, constants
                β”‚    β”œβ”€β”€ Constants.kt    -> Constantes globais
                β”‚    └── Extensions.kt
                β”‚
                └── core/ (opcional)     πŸ‘ˆ Camada comum, se for multi-mΓ³dulo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment