# Understanding the structure of projects

**URL:** <https://discourse.julialang.org/t/understanding-the-structure-of-projects/35814>\
**Category:** New to Julia\
**Created:** [March 10, 2020, 10:26pm UTC](https://discourse.julialang.org/t/understanding-the-structure-of-projects/35814 "2020-03-10T22:26:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lorenzo](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Lorenzo](https://discourse.julialang.org/u/Lorenzo)\
**Post date:** [March 10, 2020, 10:26pm UTC](https://discourse.julialang.org/t/understanding-the-structure-of-projects/35814/1 "2020-03-10T22:26:56Z")

</div>

Hi! This is my second super-newbie question, I hope you’re so kind to help me since this will be quite a broad one.  
A little background:  
I’m at my first year (of probably 5) of a CS degree and I have been programming for a few months in Java; never seen code before. Then I discovered this language like few weeks ago since I would like to do anything related to Mathematics and Scientific Computing in the future. I learned a good part of the syntax and stuff through ThinkJulia and similar resources. Therefore I’ve no particular background in this field.  
The problem:  
I’d like to create some projects, like the ones from “Julia programming projects”, or simple apps, or in general pieces of organized code that I can publish on github etc. In other words, I’m learning how to program (really, not just exercises on syntax) for the first time with this language.  
However, I have no idea how projects are structured, with which criteria I should create src, test, utils, assets and those kind of folders and what they should do specifically and how they should relate to each other. I know almost nothing about this. Therefore, when I read the docs of Pkg, which are involved in creating these “projects”, I don’t have the background which is assumed to know when you read such stuff.  
My question:  
Where I can find some resources about this? There is a guide or book on how to structure a project? How should an average Julia project look like? What is the smoothest path in order to be able to understand such docs?

I know they are broad questions, but I hope you could give me some insights for this huge amount of information I should learn in my journey to become a computer scientist (I hope).  
Thanks again!

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 10, 2020, 10:45pm UTC](https://discourse.julialang.org/t/understanding-the-structure-of-projects/35814/2 "2020-03-10T22:45:42Z")

</div>

Welcome.

Have a look at the following thread for instance [Generating a package with PkgTemplate for existing code - #15 by ffevotte](https://discourse.julialang.org/t/generating-a-package-with-pkgtemplate-for-existing-code/25163/15)  
This package might be the answer to your question: [GitHub - tpapp/PkgSkeleton.jl: Generate Julia package skeletons using a simple template system](https://github.com/tpapp/PkgSkeleton.jl)

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [March 11, 2020, 12:56am UTC](https://discourse.julialang.org/t/understanding-the-structure-of-projects/35814/3 "2020-03-11T00:56:48Z")

</div>

The real answer is that they can be structured pretty much however you want. But there is somewhat of a “standard” structure which can be seen by looking at almost any Julia package.

For this structure, the `src` folder should contain the code that implements whatever functionality you want. The inside of the `src` folder can look pretty much however you like but you do need to have a top-level file that defines the `module`. That file would look something like

```julia
module YourModule
# here you "using" the packages that your code needs, such as
using Statistics, Dates

# you can also "include" the other files inside your src folder, such as
include("utilityfunctions.jl")
end

```

My suggestion would be to actually ignore this for now. Just work on writing code that does what you want. Ignore the stuff about environments, registries, etc. Start with a script that does what you want.

---

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [March 11, 2020, 6:42am UTC](https://discourse.julialang.org/t/understanding-the-structure-of-projects/35814/4 "2020-03-11T06:42:17Z")

</div>

There is nice intro with lots of details: [Developing Julia Packages - Stochastic Lifestyle](https://www.stochasticlifestyle.com/developing-julia-packages/)

---

<div class="post-metadata">

**Author:** ![zierenberg](https://avatars.discourse-cdn.com/v4/letter/z/278dde/32.png) [@zierenberg](https://discourse.julialang.org/u/zierenberg)\
**Post date:** [March 12, 2020, 11:27am UTC](https://discourse.julialang.org/t/understanding-the-structure-of-projects/35814/5 "2020-03-12T11:27:15Z")

</div>

In case you are not only interested in creating a julia package, but really also just in principle in how to _organize_ a (scientific/programming/…) **project** , then you might want to check out the DrWatson.jl package (and its documentation):

> **[GitHub - JuliaDynamics/DrWatson.jl: The perfect sidekick to your scientific...](https://github.com/JuliaDynamics/DrWatson.jl)**
>
> The perfect sidekick to your scientific inquiries. Contribute to JuliaDynamics/DrWatson.jl development by creating an account on GitHub.

For an example how such projects could be structured, see for example [here](https://juliadynamics.github.io/DrWatson.jl/dev/project/)

---

<div class="post-metadata">

**Author:** ![Lorenzo](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Lorenzo](https://discourse.julialang.org/u/Lorenzo)\
**Post date:** [March 12, 2020, 2:22pm UTC](https://discourse.julialang.org/t/understanding-the-structure-of-projects/35814/6 "2020-03-12T14:22:50Z")

</div>

Here I am! I’m sorry If I’m replying a bit late to you all.  
First, thanks to everyone who has answered my question.  
In particular @Skoffer, I’ve just finished watching this video and it was exactly what I needed in order to get started.  
@zierenberg I would also look after what you suggested me! At the moment though I need to digest all the information I received already.  
Thanks again to everyone!
