Fractal — Nodejs app structure

Deepak Gupta
codeburst
Published in
6 min readJun 30, 2018

--

This article about structuring the backend for REST API’s which can be extend to Graphql.

Note: The article give an overview of structuring and here is the code base for detailed understanding.

After working with many backend projects, I realized that structuring the app is equally important as the choice of tech stack and fractal app structure is always my choice.

Fractal pattern conveys that similar patterns recur progressively and the same thought process is applied to the structuring of codebase i.e All units repeat themselves.

Note: To code a fractal pattern and see it visually, check here and don’t forget to follow me on Github.

Now, let's start with the crux,

App Root Structure

The root folder always remains the same in any case of API’s structuring.

So, At root level we have -:

1. app is where our main app code goes and will discus in depth under the app structure below.

2. docs(optional) is for documentation purpose.

--

--

COO @Steer Protocol| Write about Blockchain & Javascript | Take it easy