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

# Supported Frameworks

> Frameworks and languages supported by Lightfold

## Frontend Frameworks

### Next.js

Full support with automatic detection and optimized builds.

**Detection:**

* `next.config.js` or `next.config.mjs`
* `"next"` in package.json dependencies

**Package Managers:** bun, pnpm, yarn, npm (auto-detected)

**Build Process:**

* Auto-detects package manager
* Runs `npm install` (or equivalent)
* Executes `npm run build`
* Serves with `npm start`

### Astro

Full support for static and SSR builds.

**Detection:**

* `astro.config.mjs`
* `"astro"` in package.json dependencies

**Package Managers:** bun, pnpm, yarn, npm

### Gatsby

Static site generation support.

**Detection:**

* `gatsby-config.js`
* `"gatsby"` in package.json dependencies

**Package Managers:** bun, pnpm, yarn, npm

### Svelte / SvelteKit

Full support for Svelte applications.

**Detection:**

* `svelte.config.js`
* `"svelte"` or `"@sveltejs/kit"` in dependencies

**Package Managers:** bun, pnpm, yarn, npm

### Vue.js

Support for Vue 2 and Vue 3 applications.

**Detection:**

* `vue.config.js`
* `"vue"` in package.json dependencies

**Package Managers:** bun, pnpm, yarn, npm

### Angular

Full support for Angular applications.

**Detection:**

* `angular.json`
* `"@angular/core"` in dependencies

**Package Managers:** bun, pnpm, yarn, npm

## Backend Frameworks

### Django (Python)

Full support for Django web applications.

**Detection:**

* `manage.py`
* `requirements.txt` or `pyproject.toml` with Django

**Package Managers:** uv, poetry, pipenv, pip (auto-detected)

**Build Process:**

* Auto-detects package manager
* Installs dependencies
* Runs migrations
* Collects static files
* Serves with Gunicorn

### Flask (Python)

Lightweight Python web framework support.

**Detection:**

* `app.py` or `wsgi.py`
* `"Flask"` in requirements.txt

**Package Managers:** uv, poetry, pipenv, pip

### FastAPI (Python)

Modern Python async framework support.

**Detection:**

* `"fastapi"` in requirements.txt or pyproject.toml
* `main.py` with FastAPI imports

**Package Managers:** uv, poetry, pipenv, pip

**Runtime:** Uvicorn ASGI server

### Express.js (Node.js)

Minimal Node.js web framework support.

**Detection:**

* `"express"` in package.json dependencies
* `app.js` or `server.js`

**Package Managers:** bun, pnpm, yarn, npm

### NestJS (Node.js)

Progressive Node.js framework support.

**Detection:**

* `nest-cli.json`
* `"@nestjs/core"` in dependencies

**Package Managers:** bun, pnpm, yarn, npm

### tRPC (Node.js)

End-to-end typesafe API support.

**Detection:**

* `"@trpc/server"` in dependencies

**Package Managers:** bun, pnpm, yarn, npm

### Laravel (PHP)

PHP web framework support.

**Detection:**

* `artisan` file
* `composer.json` with Laravel

**Package Manager:** Composer

**Build Process:**

* Installs dependencies with Composer
* Runs migrations
* Optimizes routes and config
* Serves with PHP-FPM + Nginx

### Rails (Ruby)

Ruby on Rails framework support.

**Detection:**

* `Gemfile` with Rails
* `config/application.rb`

**Package Manager:** Bundler

**Build Process:**

* Installs gems with Bundler
* Runs database migrations
* Precompiles assets
* Serves with Puma

### Spring Boot (Java)

Java enterprise framework support (coming soon).

**Detection:**

* `pom.xml` or `build.gradle`
* Spring Boot dependencies

### ASP.NET Core (C#)

Microsoft .NET framework support (coming soon).

**Detection:**

* `.csproj` files
* ASP.NET Core dependencies

### Phoenix (Elixir)

Elixir web framework support (coming soon).

**Detection:**

* `mix.exs`
* Phoenix dependencies

## Language Support

| Language              | Package Managers        | Status |
| --------------------- | ----------------------- | ------ |
| JavaScript/TypeScript | bun, pnpm, yarn, npm    | ✅      |
| Python                | uv, poetry, pipenv, pip | ✅      |
| PHP                   | composer                | ✅      |
| Ruby                  | bundler                 | ✅      |
| Go                    | go modules              | 🚧     |
| Java                  | maven, gradle           | 🚧     |
| C#                    | dotnet                  | 🚧     |
| Elixir                | mix                     | 🚧     |

## Package Manager Detection

### JavaScript/TypeScript

Auto-detected in priority order:

1. `bun.lockb` → bun
2. `pnpm-lock.yaml` → pnpm
3. `yarn.lock` → yarn
4. Default → npm

### Python

Auto-detected in priority order:

1. `uv.lock` → uv
2. `poetry.lock` → poetry
3. `Pipfile.lock` → pipenv
4. Default → pip

## Framework Detection

Lightfold uses a scoring system to identify frameworks:

**High Priority (3+ points):**

* Framework-specific config files

**Medium Priority (2-2.5 points):**

* Package dependencies
* Build tools

**Low Priority (0.5-1 points):**

* Directory structure
* File patterns

Run standalone detection:

```bash theme={null}
lightfold detect
```

JSON output:

```bash theme={null}
lightfold detect --json
```

## Custom Build Commands

Override detected build commands in config:

```json theme={null}
{
  "targets": {
    "myapp": {
      "deploy": {
        "build_command": "npm run custom-build",
        "run_command": "npm run start:prod"
      }
    }
  }
}
```

## Environment Variables

Framework-specific environment variables are automatically suggested:

**Next.js:**

* `NODE_ENV=production`
* `NEXT_PUBLIC_API_URL`

**Django:**

* `DJANGO_SETTINGS_MODULE`
* `SECRET_KEY`
* `DATABASE_URL`

**Rails:**

* `RAILS_ENV=production`
* `SECRET_KEY_BASE`
* `DATABASE_URL`

Set in config or use `.env` file in project root.

## Health Checks

Framework-specific health check endpoints:

| Framework | Default Health Check |
| --------- | -------------------- |
| Next.js   | `GET /` (200 OK)     |
| Django    | `GET /` (200-399)    |
| Rails     | `GET /` (200-399)    |
| Express   | `GET /health` or `/` |
| FastAPI   | `GET /docs` or `/`   |

Custom health checks in config:

```json theme={null}
{
  "targets": {
    "myapp": {
      "deploy": {
        "health_check": {
          "path": "/api/health",
          "expect": 200,
          "timeout_seconds": 30
        }
      }
    }
  }
}
```

## Adding New Frameworks

Lightfold is extensible. New frameworks can be added to the detection engine.

See [AGENTS.md](https://github.com/theognis1002/lightfold-cli/blob/main/AGENTS.md) for contribution guidelines.
