# Organizing modules. Is it OK to organize a project using several modules in Julia?

**URL:** <https://discourse.julialang.org/t/organizing-modules-is-it-ok-to-organize-a-project-using-several-modules-in-julia/34535>\
**Category:** New to Julia\
**Created:** [February 12, 2020, 7:47pm UTC](https://discourse.julialang.org/t/organizing-modules-is-it-ok-to-organize-a-project-using-several-modules-in-julia/34535 "2020-02-12T19:47:29Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Pbellive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbellive/32/3604_2.png) [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Post date:** [February 12, 2020, 10:16pm UTC](https://discourse.julialang.org/t/organizing-modules-is-it-ok-to-organize-a-project-using-several-modules-in-julia/34535/16 "2020-02-12T22:16:19Z")

</div>

Wow, my post was pretty sloppy. Sorry about that. @improbable22 is right, you have to dev, not add if you are just using a local path without a git repo. dev from the pkg repl mode is of course equivalent to `Pkg.develop`

Additionally, the directory structure I set up was just flat wrong. I guess that’s what happens when I rush and don’t actually test what I’m suggesting. The following directory structure works:

```julia
├── Project.toml
└── src
    ├── BoardModule
    │ └── BoardModule.jl
    ├── gameProject.jl
    ├── GameRunner
    │ └── GameRunner.jl
    └── PlayerModule
        └── PlayerModule.jl

```

Note that if you’re doing one parent module with submodules only the parent module needs a Project.toml.

Then `gameProject.jl` can contain

```julia
module gameProject

include("BoardModule/BoardModule.jl")
include("PlayerModule/PlayerModule.jl")
include("GameRunner/GameRunner.jl")

end # module

plus any other code you want in the top level. Then, say BoardModule. jl is

```

module BoardModule

export board\_greeter

board\_greeter() = “Hello World! I’m a game board”

end # module

```julia

Then GameRunner.jl could be 

```

module GameRunner

export game\_greeter

import …BoardModule: board\_greeter

game\_greeter() = println(“Hi, I’m a game. My board also says hello: $(board\_greeter())”)

end

```julia

This setup I actually implemented on my local machine and tested that it works.
```

---

_[View the full topic](https://discourse.julialang.org/t/organizing-modules-is-it-ok-to-organize-a-project-using-several-modules-in-julia/34535)._
