Skip to content

Backend : Setup Dependency Injection with Inversify #103

@hashim6789

Description

@hashim6789

Implement and Configure Dependency Injection using Inversify Module with Decorators

Problem Statement

Currently, our project lacks a robust dependency injection mechanism, making it difficult to manage dependencies and perform testing effectively. This results in tightly coupled code, making the project hard to maintain and scale.

Solution

To address this issue, we will implement and configure the inversify library for dependency injection. The solution includes:

  • Installing the inversify library.
  • Configuring the project to use inversify for dependency injection.
  • Replacing existing manual dependency management with inversify using decorators.

Alternatives Considered

We have considered the following alternatives:

  • Manually managing dependencies within the project.
  • Using another dependency injection library.

Additional Context

Add any other context or screenshots related to the feature request here:

  • Link to inversify documentation: Inversify Docs
  • Relevant project files and code snippets, if any.

Acceptance Criteria

  • The inversify library is installed and configured.
  • Existing dependencies are registered with inversify.
  • The project can resolve dependencies using inversify.
  • Unit tests are updated to leverage inversify for dependency injection.

Tasks

  • Install inversify and reflect-metadata libraries.
  • Configure inversify in the project setup.
  • Register existing dependencies with inversify.
  • Refactor existing code to use inversify with decorators.
  • Update unit tests to use inversify.

Additional Information

Provide any additional information that can help with the implementation:

  • Ensure that all dependencies are properly registered and resolved.
  • Update the documentation to reflect the new dependency injection setup.

Assignees

Add the appropriate assignees for this issue.

Labels

Add any relevant labels for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend requiredenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions