# Sharing code across apps

**URL:** <https://forum.elixirforum.com/t/sharing-code-across-apps/65935>\
**Category:** Questions\
**Tags:** dependencies, sparse\
**Created:** [September 8, 2024, 9:09am UTC](https://forum.elixirforum.com/t/sharing-code-across-apps/65935 "2024-09-08T09:09:53Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![D4no0](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/d4no0/32/33624_2.png) [@D4no0](https://forum.elixirforum.com/u/D4no0)\
**Post date:** [September 8, 2024, 11:36am UTC](https://forum.elixirforum.com/t/sharing-code-across-apps/65935/3 "2024-09-08T11:36:42Z")

</div>

> [@ream88](#):
>
> • I’m considering using **git sparse-checkout** to manage only the parts of the codebase I need in the back office app, but I’m not sure if this is the best approach. I know that mix has support for it, however while testing my back office app wasn’t able to find modules defined in the other app.

I don’t know if you want to introduce complexity from git into your codebase, I personally wouldn’t consider this as a viable option.

Depending on how your projects are organized, I would recommend to have the shared code separated in a library, but in the same repo (a monorepo that hosts both the projects and the library). In this way you can use the option of [local dependency](https://hexdocs.pm/mix/1.12/Mix.Tasks.Deps.html#module-path-options-pathl) and not worry about maintaining separate variants for the library codebase and version them:

```elixir
defp deps do
  [
    {:local_dependency, path: "path/to/local_dependency"}
  ]
end

```

---

_[View the full topic](https://forum.elixirforum.com/t/sharing-code-across-apps/65935)._
