What you'll learn
  • how to do local development in Webiny
  • working with team on a Webiny project

Overview
anchor

Serverless development has slightly different principles from traditional application development. In the traditional development process, developers typically develop and test their project locally before deploying it to a server. However, in the serverless world, this process is slightly different.

In this article, we will look at how to do local development in Webiny, a serverless CMS. If you are absolutely beginner to serverless, we will recommend you to read this articleexternal link.

Webiny is a serverless application, which means that it uses serverless services like AWS Lambda, Amazon DynamoDB, Amazon S3, etc. to run. For the sake of simplifying the understanding, in context of development, we can devide Webiny code into two parts: the API & Infrastructure (backend) and the User Interface (frontend).

To do local development in Webiny, the API or any infrastructure changes must be deployed in the cloud. However, we have built various CLI tools that make the experience seamless, so when you make a change to the code and save it, it will be deployed to the cloud simultaneously, and you can see the changes in no time. For the frontend development, you can develop and test locally, and if everything looks good, you can deploy it to the cloud later.

In summary, changes made to API and infrastructure must be deployed to the cloud during local development. However, for changes made to only UI, deploying to the cloud is not necessary. Once the UI changes are finalised, these changes can be pushed to the cloud.

If you’re wondering how to push changes to the cloud during development, don’t worry. As previously mentioned, we have developed various CLI tools, such as the watch command command, to make deploying changes to the cloud during development easy. The command allows you to continuously rebuild and redeploy your code, making the development process seamless.

Now let’s learn more about local development with the frequently asked questions related to Webiny development.

Is It Possible to Perform Local Development in Webiny Without Deploying Any Changes to the Cloud?
anchor

As previously mentioned, for the API and infrastructure related portion of the development, deployment to the cloud is necessary as it is powered by various serverless services such as AWS Lambda, Amazon DynamoDB, Amazon, etc. However, for frontend development, it is possible to develop and test locally and only deploy to the cloud once everything is looking good.

Can I Use a Tool Like LocalStack as Cloud Service Emulator for Development?
anchor

Webiny utilizes a variety of AWS serverless services, such as AWS Lambda, Amazon DynamoDB, Amazon S3, etc.

And while simulating Lambda locally is not that hard (although it’s still not trivial), it’s still hard to emulate cloud native mechanisms, like reacting to Amazon S3 objects-related events, Amazon Event Bridge events, emulating services like Amazon Cognito, Amazon SQS, and more.

With that in mind, we don’t recommend using tools like LocalStackexternal link. Still, if you find it challenging to work with any part of local development, get in touch with us on our Community Slackexternal link. It will help us offer some advice or improve the local development experience.

What Is the Potential Cost Associated With Using an AWS Account for Development?
anchor

Webiny supports two database setups at the moment:

  1. Amazon DynamoDB
  2. Amazon DynamoDB + Amazon OpenSearch

The Amazon DynamoDB database setup fully utilizes serverless services, which means it fully follows pay-per-use pricing. This means that for development, the cost is typically minimal or free.

On the other hand, with the Amazon DynamoDB + Amazon OpenSearch version, Amazon OpenSearch Serviceexternal link is the only non-serverless service used by Webiny, which is not priced on a pay-per-use basis. This means that you will be charged for the time the service is running, regardless of whether you are using it or not.

To mitigate costs, you can have one Amazon OpenSearch Service domain that’s used by the entire team. This way, you can share the cost of the service among the team members. For more information on how to set this up, please refer to the Using a Shared Amazon OpenSearch Service Domain article.

Working With Team on a Webiny Project
anchor

Our recommended approach is for each developer to have their own isolated environment in which they deploy and work. This approach also involves each developer having their own AWS account. Once changes are ready, they are then merged into a shared environment, such as the dev environment. For more information on this approach, including branches, environments, state files, and more, please refer to the CI/CD section. If cost is your concern, please refer to the section above, which states that when using the DynamoDB-only flavor of Webiny, all services utilized are serverless, which typically results in minimal or no cost during development.