> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shardcloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Elixir Hosting Guide

> Learn how to deploy Elixir applications on ShardCloud platform.

# Getting Started with Elixir Hosting

Deploy your Elixir applications on ShardCloud with minimal configuration and maximum performance.

<Info>
  ShardCloud supports Elixir applications with automatic dependency management via Mix and OTP support.
</Info>

## Prerequisites

Before uploading your Elixir application, ensure you have the following project structure ready.

<CardGroup cols={2}>
  <Card title="Required Files" icon="circle">
    Essential files for deployment
  </Card>

  <Card title="Excluded Files" icon="x">
    Files to exclude before upload
  </Card>
</CardGroup>

## Required Files

Your Elixir application must include these essential files:

### 1. Entry Point File

* **File**: `lib/your_app.ex` or main module file
* **Purpose**: Main application entry point
* **Requirements**: Must contain your application's main module

### 2. Dependencies Configuration

* **File**: `mix.exs`
* **Purpose**: Defines project dependencies, configuration, and application metadata
* **Requirements**: Valid Mix project file with all dependencies listed

### 3. ShardCloud Configuration

* **File**: `.shardcloud`
* **Purpose**: Platform-specific deployment settings
* **Requirements**: Plain text configuration file in root directory

<Warning>
  All three files are mandatory. Missing any of these files will prevent successful deployment.
</Warning>

## Files to Exclude

Remove these files/folders before creating your deployment archive:

* `_build/`
* `deps/`
* `.elixir_ls/`
* `*.beam` (compiled files)

## ShardCloud Configuration

The [.shardcloud](/config) file configures your application deployment settings.

### Configuration Example

```bash theme={null}
DISPLAY_NAME=myfirstelixirproject
DESCRIPTION=a simple Elixir application
MAIN=lib/my_app.ex
MEMORY=512
VERSION=recommended
```

<Note>
  Elixir applications benefit from the BEAM VM's efficiency. Choose memory based on your application's concurrent workload.
</Note>

## Deployment Process

<Steps>
  <Step title="Prepare Application">
    Ensure all required files are present and configured
  </Step>

  <Step title="Verify mix.exs">
    Confirm all dependencies are listed in your mix.exs file
  </Step>

  <Step title="Exclude Unnecessary Files">
    Remove `_build/`, `deps/`, and `.elixir_ls/` folders
  </Step>

  <Step title="Create Archive">
    Zip or RAR your project
  </Step>

  <Step title="Upload via Dashboard">
    Use [ShardCloud dashboard](https://shardcloud.app/dash) to upload your archive
  </Step>

  <Step title="Deploy & Monitor">
    Application automatically builds dependencies and deploys
  </Step>
</Steps>

## Common Configuration Examples

### Phoenix Web Application

```bash theme={null}
DISPLAY_NAME=phoenix-app
DESCRIPTION=Web application with Phoenix Framework
MAIN=mix.exs
MEMORY=1024
VERSION=recommended
SUBDOMAIN=phoenix
CUSTOM_COMMAND=mix phx.server
```

### GenServer Background Worker

```bash theme={null}
DISPLAY_NAME=elixir-worker
DESCRIPTION=Background worker with GenServer
MAIN=lib/worker.ex
MEMORY=256
VERSION=LATEST
```
