This is template for creating Serverless application with Ruby backend.
node,yarn- to installserverlessterraform 0.12ruby 2.7.1direnv(optional) - to set env variables in development automatically for youdocker+ optionaldocker-compose- for running DynamoDB Local
serverless is used for managing and deploying client & backend applications.
It can be used for orchestrating all resources required by application to run
(like DynamoDB tables). Terraform is more mature in managing resources coming
from multiple providers so it is a better fit for managing things like domains
DNS records or S3 buckets creation/configuration.
Assuming you have node, yarn and ruby installed run:
yarn # to install serverless and all dependencies
bundle # to install Ruby Gems
To run tests execute:
rspec
Make sure DynamoDB local is running:
docker-compose up
To verify code style run:
rubocop
npx serverless deploy
terraform apply
yarn build && npx sls client deploy
.env- contains application configuration that can be committed to source code repository, e.g. external API URLs, mappings.env.local- configuration for local development. Use.env.local.templateto create this file. It contains all env variables that are created byserverlessstack - so they aren't available on localhost, for instance DynamoDB table names (DYNAMODB_TABLE_EXAMPLE).envrc- project configuration for running Terraform and Serverless. Use.envrc.templateto create this file. It contains env variables exports to be set before runningterraformorserverlesscommands. You can use tools like direnv to set them automatically for you.