# How to Deploy Your First Serverless App in 10 Minutes

### Updates

### January 31, 2025

**Deploy your first serverless app in just 10 minutes with** [**Movestax**](/content/site-root.html) **.** This guide walks you through the entire process - from setup to testing - so you can focus on writing code without worrying about server management. Here's what you'll do:

- **Create a Movestax account** and install the CLI.
- **Prepare your code** with supported runtimes like [Node.js](https://nodejs.org/en), Python, or Go.
- **Deploy your app** using simple CLI commands.
- **Test and monitor** your app with built-in tools.

Movestax handles scaling, security, and maintenance automatically, so you only pay for what you use. Whether you're a beginner or experienced developer, this step-by-step guide will get your app live quickly and efficiently.

## Deployment Prerequisites

Before you deploy your serverless app on Movestax, make sure you have everything in place. A solid setup can save you from common headaches and make the process much smoother.

### Setting Up a [Movestax](/content/site-root.html) Account

Start by creating a Movestax account at **movestax.com**. You can begin with the Free plan for testing purposes or opt for the Pro plan if you're handling production workloads. Once you’ve signed up, you’ll need the Movestax CLI to manage deployments.

### Installing the Movestax CLI

To install the Movestax CLI, use the following commands based on your operating system:

For MacOS/Linux:

```bash
curl -fsSL https://cli.movestax.com/install.sh | sh
```

For Windows:

```bash
winget install movestax-cli
```

After installation, confirm it’s working by checking the version:

```bash
movestax --version
```

With the CLI ready to go, it’s time to prepare your application for deployment.

### Preparing Your Code

Your code needs to align with Movestax’s deployment guidelines. Supported runtimes include:

- **Node.js**
- **Python**
- **Go**

Organize your project with a clear root directory. Include essential files like `package.json` for Node.js or `requirements.txt` for Python. Keep your deployment package size under 250MB and use a `.env.example` file for environment variables. Avoid hardcoding server configurations; rely on environment variables instead.

Movestax also offers templates to simplify setup. Use the following command to initialize a project with the right configurations:

```bash
movestax init --template <language>
```

## Configuring Your Movestax Environment

Now that you've got everything you need, let’s set up your Movestax environment for deployment.

### Logging Into Movestax

Start by logging in through the CLI. Run the following command, which will open a browser window for authentication:

```bash
movestax login
```

### Setting Up Your Project

Next, initialize your project. Head to your project directory and execute:

```bash
movestax init --name your-project-name
```

This step sets up key elements for your configuration:

- **Region Selection**: Pick the region closest to your users to keep latency low.
- **Project Structure**: Movestax will create a `.movestax` directory and generate a `.env` template to help you configure your project.

### Selecting a Plan

Movestax provides several plans: Free, Starter, Basic, and Pro. These options are designed for everything from personal projects to full-scale production workloads. You can begin with the Free plan and upgrade as your needs grow.

To ensure everything is set up correctly, run:

```bash
movestax config verify
```

This command checks your settings and confirms you're ready for deployment. Once verified, you're all set to upload and deploy your application.

## Deploying Your Serverless Application

With your Movestax environment ready, it's time to deploy your application. The steps are simple and quick.

### Uploading Your Code

From your project directory, use the Movestax CLI to upload your application files:

```bash
movestax deploy --path ./
```

This command handles everything for you:

- Scans your project structure
- Packages your application files
- Uploads them to the Movestax cloud

For larger projects, the CLI provides real-time upload progress. On average, deploying a Node.js application takes about 30 seconds.

### Configuring Functions

Head to the **Functions** tab in your Project Dashboard. Click **Create Function** and fill in the following details:

| Setting | Description | Example |
| --- | --- | --- |
| Function Details | Choose runtime and entry point | Node.js 18, src/handler.main |
| Memory | Allocate RAM for your function | 128MB - 1GB |
| Timeout | Set maximum execution time | 10s - 300s |

For HTTP-triggered functions, Movestax automatically creates a unique endpoint URL like this:

https://<your-function-name>.<region>.movestax.app

### Setting Environment Variables

To securely configure your application, define environment variables using the CLI:

```bash
movestax env set --name DATABASE_URL --value "postgresql://user:password@host:port/dbname"
```

**Security Tip**: Movestax encrypts environment variables end-to-end, ensuring decryption happens only during function execution. This guarantees the security of your sensitive data.

Once deployed, you can start testing and monitoring your application to ensure it's running as expected.

## Testing and Monitoring Your Application

Once you've deployed your serverless app on Movestax, it's crucial to test its functionality and set up monitoring to keep things running smoothly.

### Confirming Deployment

Start by checking your app's public URL to ensure everything works as expected. Test its features and confirm that response times are between 200-500ms. If you notice delays, consider adjusting the memory allocation. After confirming the deployment, take advantage of Movestax's built-in monitoring tools to track performance and tackle any potential issues.

### Using Monitoring Tools

Movestax offers a dashboard packed with useful metrics to help you keep tabs on your app. Here's a quick breakdown:

| Metric Type | What to Monitor | Normal Range |
| --- | --- | --- |
| **Performance & Memory** | Execution time, RAM usage | 100ms-1000ms, 25-75% of allocated |
| **Errors** | Error rate | Less than 1% of requests |
| **Requests** | Invocation count | Depends on app usage |

To view these metrics:

- Go to the **Monitoring** tab in your Movestax dashboard.
- Select your function from the dropdown menu.
- Review real-time metrics and historical data.

You can also set up alerts for key thresholds:

- Error rates exceeding 1%.
- Response times going over 1000ms.
- Memory usage approaching 90%.

For troubleshooting, check the **Logs** section, which includes timestamps, request IDs, and error messages. If you need more detailed logs, set the `LOG_LEVEL` environment variable to `DEBUG`.

## Conclusion and Next Steps

### Deployment Recap

Congrats on successfully deploying your first serverless application with Movestax! You've set up monitoring and ensured everything is running smoothly - great work.

### Optimization and Advanced Features

To boost your app's performance, consider these optimization strategies:

| Area | Strategy |
| --- | --- |
| **Memory & Caching** | Allocate 512MB-1GB and use [Redis](https://redis.io/) to achieve response times under 100ms. |
| **Concurrency** | Enable parallel data fetching to cut latency by up to 60%. |
| **Monitoring** | Use custom [CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html) metrics to catch potential issues early. |

With your app live, Movestax offers tools to help you grow and add features as needed:

- **Workflow Automation**: Use [n8n](https://n8n.io/) to automate repetitive tasks.
- **Database Management**: Take advantage of Movestax's managed database services.
- **AI-Powered Tools**: Experiment with the Movestax AI Agent for natural language-based infrastructure management.

If you're looking to scale further, the Pro plan ($105/month) is worth exploring. It includes:

- Support for up to 6 apps
- A 5GB [PostgreSQL](https://www.postgresql.org/) database
- [MongoDB](https://www.mongodb.com/) integration
- Priority support

You'll also get access to features like built-in authentication, object storage, and fully managed PostgreSQL, MongoDB, and Redis instances. Storage options range from 500MB to 5GB, depending on your plan.

Once your app is optimized, these tools can help you expand its functionality and maintain strong performance as your project grows.
