Skip to content

Standard File Organization

Su Ho edited this page Nov 25, 2020 · 11 revisions

Goal πŸ†

The goal is to standardize the file organization in a project. In order to keep all projects in alignment, please arrange the folder structure similar to the following organization.

Standard file organization πŸ—‚

ROOT
β”œβ”€ README.md
β”œβ”€ Sources
   β”œβ”€ Application
     β”œβ”€ AppDelegate
     β”œβ”€ Constants
     β”œβ”€ Entitlements
     β”œβ”€ Localizations
     β”œβ”€ Resources
   β”œβ”€ Extensions
   β”œβ”€ Models
   β”œβ”€ Modules
   β”œβ”€ Protocols
   β”œβ”€ Services
      β”œβ”€ Network
      β”œβ”€ ...
   β”œβ”€ Utilities
      β”œβ”€ Logger
      β”œβ”€ ...
   β”œβ”€ Views
β”œβ”€ Tests
   β”œβ”€ Unit Tests
   β”œβ”€ UI Tests

README.md

README.md file is supposed to be the first file that is opened when opening the project.

It is nice to provide developers an overview of the whole project.

For example:
- What we do
- What is the main feature of the project
- How to set up the project
- ...

This README.md file is optional.

Sources

This folder contains the main source code of the project.

Tests

This folder contains the testing code of the project.

There are two main types of testing:

  • Unit Testing
  • UI Testing.

Note: In terms of the detailed implementation inside Unit Tests and UI Tests folders, you can define a specific way for your project. In this wiki, we just generalize the top lever folder structure.

For example: I create subfolders to test for `Modules`, `Services`, etc. as same as what I have in `Sources` folder.
β”œβ”€ Tests
   β”œβ”€ Unit Tests
      β”œβ”€ Modules
      β”œβ”€ Services
      β”œβ”€ ...
For example: I try to split the testing flow and the test usecases into `Testing flow` and `Testing usecases` folder.
β”œβ”€ Tests
   β”œβ”€ UI Tests
      β”œβ”€ Testing flows
      β”œβ”€ Testing usecases
      β”œβ”€ ...

Where to go from here πŸš₯