# Overview
[EN] Source: https://mastra.ai/reference/templates/overview

This reference provides comprehensive information about Mastra templates, including how to use existing templates, create your own, and contribute to the community ecosystem.

Mastra templates are pre-built project structures that demonstrate specific use cases and patterns. They provide:

- **Working examples** - Complete, functional Mastra applications
- **Best practices** - Proper project structure and coding conventions
- **Educational resources** - Learn Mastra patterns through real implementations
- **Quick starts** - Bootstrap projects faster than building from scratch

## Using Templates

### Installation

Install a template using the `create-mastra` command:

```bash copy
npx create-mastra@latest --template template-name
```

This creates a complete project with all necessary code and configuration.

### Setup Process

After installation:

1. **Navigate to project directory**:

   ```bash copy
   cd your-project-name
   ```

2. **Configure environment variables**:

   ```bash copy
   cp .env.example .env
   ```

   Edit `.env` with required API keys as documented in the template's README.

3. **Install dependencies** (if not done automatically):

   ```bash copy
   npm install
   ```

4. **Start development server**:

   ```bash copy
   npm run dev
   ```

### Template Structure

All templates follow this standardized structure:

## Creating Templates

### Requirements

Templates must meet these technical requirements:

#### Project Structure

- **Mastra code location**: All Mastra code must be in `src/mastra/` directory
- **Component organization**:
  - Agents: `src/mastra/agents/`
  - Tools: `src/mastra/tools/`
  - Workflows: `src/mastra/workflows/`
  - Main config: `src/mastra/index.ts`

#### TypeScript Configuration

Use the standard Mastra TypeScript configuration:

```json title="tsconfig.json"
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ES2022",
    "moduleResolution": "bundler",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true,
    "noEmit": true,
    "outDir": "dist"
  },
  "include": ["src/**/*"]
}
```

#### Environment Configuration

Include a `.env.example` file with all required environment variables:

```bash title=".env.example"