Tezda interview task
A social platform mobile app.
Login credentials: username: mor_2314 password: 83r5^_
This project follows the clean architecture design pattern for structuring the folders and packages. The purpose of clean architecture is to provide a clear separation of concerns and to make the codebase scalable, testable, and maintainable.
This application uses a feature driven folder structure to separate related functionality into individual features
- (lib/features)
- │
- ├── feature0
- | ├── data
- │ │ ├── data_sources
- │ │ ├── models
- │ │ └── repositories(implementation)
- │ ├── domain
- │ │ ├── entities
- │ │ ├── repositories(abstract)
- │ │ └── use_cases
- │ └── presentation
- │ │ ├── blocs
- │ │ ├── pages
- │ │ └── widgets
- │ │
The project is structured into different layers, each with its own responsibility:
This layer handles the user interface components, including widgets, screens, and UI-related logic. It consists of:
page: Contains the main screens of the application.widgets: Contains reusable widgets used across screens.blocs: Implements the BLoC pattern for state management.
The domain layer defines the business logic and the application's use cases. It is independent of any external frameworks or implementations. It consists of:
entities: Contains the domain models/entities.usecases: Implements the application's use cases.repositories: Abstract interfaces for data operations.
The data layer handles data access and persistence. It also communicates with external services, such as APIs or databases. It consists of:
models: Includes data models used in the data layer.repositories: Implements the interfaces defined in the domain layer.datasources: Handles data access and external service communication.
The core layer includes infrastructure code that is shared across different layers. It consists of:
constants: Contains application-level constants.errors: Implements custom error handling.utils: Includes utility functions and helpers.di: Implements dependency injection for module setup.
Following guidelines should be considered while using this clean architecture folder structure:
- Each layer should only depend on the layer directly beneath it.
- The domain layer should not have any dependencies on external frameworks or libraries.
- Each layer must have its own set of tests to ensure independence and maintainability.
- Use dependency injection to wire up dependencies between layers.