Setting up SOMOD


Set up SOMOD and start creating Serverless Modules in minutes.

Prerequisites

SOMOD is a CLI toolset developed and distributed using NPM (NodeJs Package Manager). Before working with SOMOD, download and install the NodeJs for your working environment.

Setup

There are two ways to set up a SOMOD Module project.

  1. Use the initialization command.

    npx create-somod

    Running this command creates an npm package called my-module or the supplied module name with all the necessary configurations.

    The readme of create-somod explains the available options for this command

    OR

  2. Manual setup
    Otherwise, the SOMOD Module project can be created manually by following these steps.

    • Init an npm project
      Create a project directory and run npm init inside it.
    • Install somod as a dev dependency
      To install the latest version of somod, run npm install somod --save-dev command
    • Install the required dependencies based on the type of the module
      • for serverless module
        npm install @types/aws-lambda aws-sdk somod-middleware --save-dev
      • for ui module
        npm install @types/react react next react-dom --save-dev
    • Update package.json
      Configure package.json as described in SOMOD's package.json reference
    • Create tsconfig.somod.json
      The source files in a SOMOD are created using typescript. SOMOD requires tsconfig.somod.json to be available in the project root to compile typescript to javascript. SOMOD's tsconfig.somod.json reference provides the details of configuring tsconfig.somod.json
    • Initialize Git
      Initialize the git and ignore everything but source files from the project. The Directory Structure guide explains the directories and files used in SOMOD as source files.

Setup AWS

SOMOD works on the Serverless Platform from AWS. Install AWS SAM CLI and configure it to deploy SOMOD modules into AWS. The Getting Started guide helps you to install and configure AWS SAM.

In the next chapter, let us start developing the SOMOD module. Happy coding.

Does this page need improvements?
Edit This Page in GitHub
Did this page help you?
Provide feedback in the GitHub Discussion Page
Need More help?

Write an email to opensource@sodaru.com

This documentation is built using
Developed and Maintained By
Sodaru Technologies
https://sodaru.com
© 2023