GithubHelp home page GithubHelp logo

doytsujin / directory-structure Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drassil/directory-structure

0.0 1.0 0.0 30 KB

Ideal directory structure for each kind of component / module / project

Home Page: http://drassil.github.io/directory-structure/

License: MIT License

HTML 100.00%

directory-structure's Introduction

Directory Structure 2.0.1 ( DIRS 2 )

This folder contains the ideal directory structure for each kind of system, app or project. It has been freely inspired by Filesystem Hierarchy Standard (FHS) and various other projects. It can be used for all kind of projects and languages (PHP, Java, C++, Nodejs etc.) but even for Operating Systems. Of course, depending on the purposes, some directories can be avoided/changed (e.g. some frameworks can force you to use some directories not expected by this standard).

Feel free to use our issue tracker to send suggestions and opinions.

Architecture

  • Awareness level: it defines which components can access to others. Components with equal or higher level (top) can access to components with equal or lower level (bottom).   Not following this rules can probably cause a bad and no modular software architecture.

  • Allocation: there are 3 kinds of directory/file allocation    

    1. Static: contains files that should change only after a system update. In some case it's set with read-only permissions.
    2. Variable: subdirectories and files that are writeable and created by the system at runtime.
    3. Mixed: used by directories with both static and variable content. For example in conf folder you can have the default read-only configuration file (static) and the writeable version (variable)
  • Structure: Childs directories of components with a quadrangle shape (pictrue above) can eventually re-use this structure standards.   Components with Disk shape instead have a more specific structure.

Directories

  • / : root context. This is the first layer of your system/application.

Core

  • bin: contains compiled executable

  • lib: search path for compiled libraries

  • conf: configuration files

  • src: sources files to be compiled/interpreted

    • includes
    • tests
    • app
    • [...] NOTE: src folder should not re-use the directory-structure standards, but in some cases you must put conf/ and data/ folders under src because of compiling tools limitations.
  • data: static data

    • database
    • docs
    • languages
    • media
    • [...]
  • var: volatile data

    • build: used by projects that must be built
    • cache
    • logs
    • temp
    • uploads
    • proc
    • [...]
  • srv: data and scripts served by the system (e.g., over network)

Components:

  • apps: Utilities and applications with an higher level of awareness compared to modules.

  • modules: A module can be everything you need to compose a "system". Such as an addon,plugin,framework etc. Normally this folder should be handled by a package manager or git submodule.

  • deps: Static dependencies, instead of modules they are pre-installed (eventually can be handled by git subtree). If you don't need this kind of separation you can use modules folder for both essential dependencies and addons.

Note: plural form of folder above is used to emphasize the modular purpose.

Sub Environments:

  • env: container of sub environments

    • <name of your system/app> : you could create an extra environment for your app creating extra levels of awareness.

    • users: folder that can be used by user for its workspace files or second level context

    • sys: could be used and standardized by an operating system to handle directories related to hardware devices etc.

    • [...]

Subset examples

Since DIRS 2.0 can be used for a simple application package, a developing workspace or even an operating system, You can use varius subsets of this standard that follow your needs. Read some example HERE

Differences with version 1.x

First version of this standard was limited to offer directories where store files and components for each kind of needed situations.

Version 2 instead adds multiple specifications to improve modular software design. Introducing concepts such as:

  • Awareness level
  • Files allocation type
  • Directory sub-structure
  • Context layers (scope)

Read how to upgrade from 1.x

directory-structure's People

Contributors

yehonal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.