Skip to content

Folder / directory structure options and naming conventions for software projects

License

Notifications You must be signed in to change notification settings

kdidenko/Folder-Structure-Conventions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

📁 Folder Structure Conventions

Folder structure options and naming conventions for software projects


A typical top-level directory layout

..
├─/📂build/                   # Compiled files (alternatively `dist`)
├─/📂docs/                    # Documentation files (alternatively `doc`)
├─/📂src/                     # Source files (alternatively `lib` or `app`)
├─/📂test/                    # Automated tests (alternatively `spec` or `tests`)
├─/📂tools/                   # Tools and utilities
├─📄LICENSE
└─📃README.md

Use short lowercase names at least for the top-level files and folders except LICENSE, README.md

Source files

The actual source files of a software project are usually stored inside the src folder. Alternatively, you can put them into the lib (if you're developing a library), or into the app folder (if your application's source files are not supposed to be compiled).

Samples:

  1. jQuery src,
  2. Node.js lib and src,
  3. D3.js src,
  4. AngularJS src,
  5. Adobe Brackets src,
  6. three.js src,
  7. Express lib,
  8. Socket.IO lib,
  9. Less.js lib,
  10. Redis src,
  11. Ace lib,
  12. Semantic UI src,
  13. Zepto.js src,
  14. Emscripten src,
  15. RethinkDB src,
  16. Bitcoin src,
  17. MongoDB src,
  18. Facebook React src,
  19. Rust src,
  20. ASP.NET src,
  21. SignalR src,
  22. libgit2 src

Automated tests

Automated tests are usually placed into the test or, less commonly, into the spec or tests folder.

Q: Why tests are placed into a separate folder, as opposed to having them closer to the code under test?

A: Because you don't want to test the code, you want to test the program.

.
├── ...
├── test                    # Test files (alternatively `spec` or `tests`)
│   ├── benchmarks          # Load and stress tests
│   ├── integration         # End-to-end, integration tests (alternatively `e2e`)
│   └── unit                # Unit tests
└── ...

Samples:

  1. jQuery
  2. Node.js
  3. D3.js
  4. AngularJS
  5. Adobe Brackets
  6. three.js
  7. Express
  8. Socket.IO
  9. Less.js
  10. Bower
  11. Mozilla PDF.js
  12. Grunt
  13. Gulp
  14. Semantic UI
  15. Zepto.js
  16. Jade
  17. RethinkDB
  18. Vagrant
  19. Sails.js
  20. GitHub Hubot
  21. Facebook React
  22. Ansible
  23. ASP.NET
  24. browserify
  25. Paper.js
  26. Julia
  27. Karma

Documentation files

Often it is beneficial to include some reference data into the project, such as Rich Text Format (RTF) documentation, which is usually stored into the docs or, less commonly, into the doc folder.

.
├── ...
├── docs                    # Documentation files (alternatively `doc`)
│   ├── TOC.md              # Table of contents
│   ├── faq.md              # Frequently asked questions
│   ├── misc.md             # Miscellaneous information
│   ├── usage.md            # Getting started guide
│   └── ...                 # etc.
└── ...

Samples:

  1. HTML5 Boilerplate doc,
  2. Backbone docs
  3. three.js docs
  4. GitLab doc
  5. Underscore.js docs
  6. Discourse docs
  7. Grunt docs
  8. Emscripten docs
  9. RethinkDB docs
  10. RequireJS docs
  11. GitHub Hubot docs
  12. Twitter Flight doc
  13. Video.js docs
  14. Bitcoin doc
  15. MongoDB docs
  16. Facebook React docs
  17. libgit2 docs
  18. Stylus docs
  19. Gulp docs
  20. Brunch docs

Scripts

...

Tools and utilities

...

Compiled files

...

3rd party libraries

...

License information

If you want to share your work with others, please consider choosing an open source license and include the text of the license into your project. The text of a license is usually stored in the LICENSE (or LICENSE.txt, LICENSE.md) file in the root of the project.

You’re under no obligation to choose a license and it’s your right not to include one with your code or project. But please note that opting out of open source licenses doesn’t mean you’re opting out of copyright law.

You’ll have to check with your own legal counsel regarding your particular project, but generally speaking, the absence of a license means that default copyright laws apply. This means that you retain all rights to your source code and that nobody else may reproduce, distribute, or create derivative works from your work. This might not be what you intend.

Even in the absence of a license file, you may grant some rights in cases where you publish your source code to a site that requires accepting terms of service. For example, if you publish your source code in a public repository on GitHub, you have accepted the Terms of Service which do allow other GitHub users some rights. Specifically, you allow others to view and fork your repository.

For more info on how to choose a license for an open source project, please refer to http://choosealicense.com

About

Folder / directory structure options and naming conventions for software projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published