Software file structures are always a pain when it comes to setting up a development environment. Different projects have their own file structures that constitutes some learning curve. The steepness of the curve depends entirely on the intuitiveness understanding of the structure design and compatibility across known practices.
Hence, this section merges a large numbers of file structures together for forming a common pattern to use. That way, it reduces the needs to remember so many file structure patterns.
Among the file structures I analyzed and already merged are:
Here are the file structure patterns I present to everyone. I will list out the compulsory usage across different systems.
Stands for root directory of a project. It is compulsory for all projects and systems.
Compulsory for ALL projects and will be used as a reference.
Holds initial configurations for development environment such as pre-processors variable definitions, and etc.
Compulsory for:
Holds application protocol designs. It should be structured with its own type.
Compulsory for:
Holds supportive materials like images, logo, Javscript, CSS, and etc.
Compulsory for:
For holding essential executable binaries. It has:
For Operating System, this should only holds operating system critical system binaries. If you need to add yours, you should use /usr/local/bin
instead.
For Project, this should be your compiled binary outputs ready for packaging.
Compulsory for:
For holding static files for bootloading.
Compulsory for:
For holding build packaged artifacts ready for distribution, build configurations, build recipes, and more.
Compulsory for:
For holding the version control changes documentation.
Compulsory for:
For holding codes to compile the application (e.g. main.c
or main.go
). The output can be stored to project bin/
directory as the directory name.
Compulsory for:
For holding the first-step documentations to contribute back to the project.
Compulsory for:
Holds modular components.
Compulsory for:
Holds project level configuration files.
Compulsory for:
Holds project level configuration files when the /configs
is intrusive for the project tools.
Compulsory for:
For holding device IO files.
Compulsory for:
For holding documentations.
Compulsory for:
For holding device specific system configurations.
Compulsory for:
For holding Git version control data.
Compulsory for:
Project level C-headers directory.
Compulsory for:
Private directory for project internal usage.
Compulsory for:
For holding shared libraries.
Compulsory for:
For declaring the Licenses of the projects.
Compulsory for:
For mount point of removable media.
Compulsory for:
For holding the instructions in order to make the project.
Compulsory for:
Temporary mounting point.
Compulsory for:
Adds-on software packages. Pathing inside /opt must complies to the original structure. If /opt/<software>/bin
is available, for execution, it should be linked, not copy over to /bin
or /sbin
.
Compulsory for:
For static website generator artifact ready to be published.
Compulsory for:
For organizing library codes for inline code distributions.
Compulsory for:
known to hold root account data. This is optionally created by developer.
Compulsory for:
known for rendering README.md for a version control repository.
Compulsory for:
data relevant running processes.
Compulsory for:
System-level essential binaries only for administrators.
This should only holds operating system critical system binaries. If you need to add yours, you should use /usr/local/sbin
instead.
Compulsory for:
Project level automation scripts for simplifying projects.
Compulsory for:
Project level automation scripts for simplifying projects when /scripts
is intrusive for the project tools.
Compulsory for:
Data for services provided by this system.
Compulsory for:
Holds project source codes.
Compulsory for:
Prohibited for:
Project level test files.
Compulsory for:
Temporary directory.
Compulsory for:
Known as UNIX source directory for holding read-only contents
Compulsory for:
Primary location of holding software executable.
Compulsory for:
Primary location of holding C programming language headers.
Compulsory for:
Primary location of holding compiled library object files.
Compulsory for:
Localized system. All locally installed software should be placed inside this directory in accordingly. It has its sub-directory like:
bin
- local binariesetc
- host specific system configurations for local binariesgames
- game binariesinclude
- C header fileslib
- compiled library codesman
- manualssbin
- system binariesshare
- architecture independent hierarchy contentssrc
- source codesCompulsory for:
known to hold variable data.
Compulsory for:
temporary file preserved between system reboot.
Compulsory for:
That's all for the merged file structures across multiple projects. Please feel free to explore more or contact me to merge more file structures pattern into a single compatible pattern across all of them.