This repo takes an example of multi tenant ecommerce application to show the structure.
Architectural pattern some are taken by Serverless Doc.
Note: This repo not with code complete, but shown with somehow to show the pattern can be followed for best approach.
Implemented with basic authentication(custom cognito authorizer function), user signup, signin, seller signup and signin.
To get started you can simply clone this serverless-nodejs-example repository and install the dependencies.
Clone the serverless-nodejs-example repository using git:
git clone git@github.com:sandeep9738/serverless-nodejs-example.git
cd serverless-nodejs-exampleInstall dependencies with this command:
npm installRun the application in offline:
sls offline start --noAuthTo know about more command line options refer: Serverless Command Line Options.
To deploy
sls deploy --aws-profile ${aws profile} --stage ${stage(dev, prod, devsandeep etc)} --config ${filename}.ymlAlways maintain AWS profiles as specified in the document AWS profiles maintaining guide.
Since there multiple yml files makes sure, before deploying if there are any deplendencies for the current deployment yml file, those are deployed before this one.
For clear understanding read docs :
Serverless First Deployment.
-> scroll down to First deployment
- Nodejs 12.x
- Serverless-framework