<commit_before>DEEP Microservice
=================

Structure
---------

- `DeepHelloWorld`/
    - `Frontend`/ # @see [structure](structure/frontend.md)
        - `.deepignore` # @see [docs](config/.deepignore.md)
        - `_build` # If exists, DEEP uses this folder by default and ignores everything else in `Frontend`
        - `bootstrap.js` # **required**
        - `index.html` # **required** for root microservice
        - `css`/
        - `js`/
        - `images`/
        - ...
    - `Backend`/ 
        - `resources.json` # **required**
        - `src`/
            - `SayHello`/
                - `package.json` # **required**
                - `bootstrap.js` # **required**
                - `Handler.js`
                - ...
    - `Models`/
        - `User.json`
        - `Property.json`
        - ...
    - `Docs`/
        - `index.md`
        - ...
    - `Tests`/ # @see [structure](test/unit_testing.md)
        - Backend
        - Frontend
        - ...
    - `deepkg.json` # **required**
    - `parameters.json`

Configuration file (`deepkg.json`)
----------------------------------

```javascript
{
  "identifier": "deep.microservices.helloworld", // unique across the DEEP, used to retrieve certain microservices in framework and system wise
  "name": "HelloWorld", // non unique, human readable microservice name
  "description": "Say hello to the world...", // optional microservice description
  "version": "0.0.1", // microservice version compatible with semantical versioning syntax (same as NPM)
  "propertyRoot": true, // flag that indicates that microservice is treated a a root one (must contain an `Frontend/index.html` file)
  "author": { // the list of authors
    "name": "<NAME>",
    "email": "<EMAIL>",
    "website": "www.mitocgroup.com"
  },
  "contributors": [ // the list of contributors
    {
      "name": "DEEP Dev Team",
      "email": "<EMAIL>",
      "website": "www.deep.mg"
    }
  ],
  "tags": [
    "DEEP", "sample"
  ],
  "frontendEngine": ["angular"], // The engine used in frontend. Optional, default ["angular"]
  "dependencies": { // a list of other microservices that the current one depends on
    "deep.microservices.helloworld": "~1.0.*"
  },
  "autoload": { // optional override path of the microservice components
    "frontend": "Frontend/",
    "backend": "Backend/",
    "models": "Models/",
    "docs": "Docs/"
  }
}
```

Resources file (`resources.json`)
---------------------------------

> Be aware that `resource` and `action` names have to be LOWERCASE (use dashes for delimiting things)!

```javascript
{
    "user": {
        "retrieve": {
            "description": "Retrieves a user", // description of the functionality
            "type": "lambda", // resource type (supported: `lambda`, `external`)
            "methods": ["GET"], // supported HTTP methods
            "source": "src/User/Retrieve", // the source of the resource (ex. for external type: http://example.com/api/v1/users)
            "engine": { // only available for `"type": "lambda"`
                "memory": 512, // max. amount of RAM allocated to a lambda (default 128, max. 1536) 
                "timeout": 30, // timeout Lambda runs within, (max. 60)
                "runtime": "nodejs" // Lambda runtime engine (default nodejs)
            }
        },
        "other-action": {
            ...
        }
    },
    "other-resource": {
        "other-action": {
            ...
        }
    }
}
```

> Note that only `nodejs` Lambda runtime is currently supported by the dev server
<commit_msg>update resources config documentation<commit_after>DEEP Microservice
=================

Structure
---------

- `DeepHelloWorld`/
    - `Frontend`/ # @see [structure](structure/frontend.md)
        - `.deepignore` # @see [docs](config/.deepignore.md)
        - `_build` # If exists, DEEP uses this folder by default and ignores everything else in `Frontend`
        - `bootstrap.js` # **required**
        - `index.html` # **required** for root microservice
        - `css`/
        - `js`/
        - `images`/
        - ...
    - `Backend`/ 
        - `resources.json` # **required**
        - `src`/
            - `SayHello`/
                - `package.json` # **required**
                - `bootstrap.js` # **required**
                - `Handler.js`
                - ...
    - `Models`/
        - `User.json`
        - `Property.json`
        - ...
    - `Docs`/
        - `index.md`
        - ...
    - `Tests`/ # @see [structure](test/unit_testing.md)
        - Backend
        - Frontend
        - ...
    - `deepkg.json` # **required**
    - `parameters.json`

Configuration file (`deepkg.json`)
----------------------------------

```javascript
{
  "identifier": "deep.microservices.helloworld", // unique across the DEEP, used to retrieve certain microservices in framework and system wise
  "name": "HelloWorld", // non unique, human readable microservice name
  "description": "Say hello to the world...", // optional microservice description
  "version": "0.0.1", // microservice version compatible with semantical versioning syntax (same as NPM)
  "propertyRoot": true, // flag that indicates that microservice is treated a a root one (must contain an `Frontend/index.html` file)
  "author": { // the list of authors
    "name": "<NAME>",
    "email": "<EMAIL>",
    "website": "www.mitocgroup.com"
  },
  "contributors": [ // the list of contributors
    {
      "name": "DEEP Dev Team",
      "email": "<EMAIL>",
      "website": "www.deep.mg"
    }
  ],
  "tags": [
    "DEEP", "sample"
  ],
  "frontendEngine": ["angular"], // The engine used in frontend. Optional, default ["angular"]
  "dependencies": { // a list of other microservices that the current one depends on
    "deep.microservices.helloworld": "~1.0.*"
  },
  "autoload": { // optional override path of the microservice components
    "frontend": "Frontend/",
    "backend": "Backend/",
    "models": "Models/",
    "docs": "Docs/"
  }
}
```

Resources file (`resources.json`)
---------------------------------

> Be aware that `resource` and `action` names have to be LOWERCASE (use dashes for delimiting things)!

```javascript
{
    "user": {
        "retrieve": {
            "description": "Retrieves a user", // description of the functionality
            "type": "lambda", // resource type (supported: `lambda`, `external`)
            "methods": ["GET"], // supported HTTP methods
            "cacheTtl": -1, // cache TTL in seconds applied to "GET" method only (default -1 means no cache, 0 cache permanently, 1...*). On the lowest level caching is managed by AWS ApiGateway.
            "source": "src/User/Retrieve", // the source of the resource (ex. for external type: http://example.com/api/v1/users)
            "engine": { // only available for `"type": "lambda"`
                "memory": 512, // max. amount of RAM allocated to a lambda (default 128, max. 1536) 
                "timeout": 30, // timeout Lambda runs within, (max. 60)
                "runtime": "nodejs" // Lambda runtime engine (default nodejs)
            }
        },
        "other-action": {
            ...
        }
    },
    "other-resource": {
        "other-action": {
            ...
        }
    }
}
```

> Note that only `nodejs` Lambda runtime is currently supported by the dev server

{'fraction_non_alphanumeric': 0.1778688524590164, 'fraction_numerical': 0.006010928961748634, 'mean_word_length': 2.000409836065574, 'pattern_counts': {'":': 73, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2716573', 'n_tokens_mistral': 2179, 'n_tokens_neox': 2095, 'n_words': 627}