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

# Local Development

> Set up and run Usertour in your local development environment

## Getting Started

This guide will help you set up Usertour for local development. Follow these steps to get your development environment running:

### 1. Fork and Clone

1. Fork the [Usertour repository](https://github.com/usertour/usertour)
2. Clone your fork to your local machine:

```shell theme={null}
git clone git@github.com:<your-github-username>/usertour.git
cd usertour
```

### 2. System Requirements

Before proceeding, ensure you have the following installed:

* [Redis](https://redis.io/) - For caching and session management
* [PostgreSQL](https://www.postgresql.org/) - For data storage
* [pnpm](https://pnpm.io/) - For package management

### 3. Project Structure

Usertour is a monorepo containing multiple packages:

```text theme={null}
apps/
├── server/        # Backend API server
├── web/           # Frontend web application
├── sdk/           # Usertour.js SDK
│
packages/          # Shared packages
├── components/    # Reusable UI components
├── radix/         # Radix UI components
└── shared/        # Shared utilities and types
```

### 4. Setup Steps

1. **Install Dependencies**

```bash theme={null}
pnpm install
```

2. **Configure Environment**

Set up environment variables for each component:

```bash theme={null}
# Web application
cp apps/web/.env.example apps/web/.env

# API server
cp apps/server/.env.example apps/server/.env
# Update Redis and PostgreSQL configuration in apps/server/.env

# SDK
cp apps/sdk/.env.example apps/sdk/.env
```

3. **Start Development Servers**

You can run each component separately:

```bash theme={null}
# Start the backend API server
pnpm dev:server

# Start the web application
pnpm dev:web

# Start the SDK development server
pnpm dev:sdk
```

Once running, you can access the web application at [http://localhost:5174](http://localhost:5174/).

## Contributing

### Development Workflow

1. Create a new branch for your feature or bug fix
2. Make your changes following our style guidelines
3. Add tests for new features
4. Update documentation as needed
5. Submit a pull request

### Branch Strategy

* `main` - Production-ready code
* `develop` - Integration branch for new features
* Feature branches - Created from `develop` for new features

### Getting Help

If you need assistance:

* Join our [Discord community](https://discord.gg/WPVJPX8fJh)
* Check our [Documentation](https://docs.usertour.io)
* Ask in [GitHub Discussions](https://github.com/usertour/usertour/discussions)
* Follow us on [Twitter](https://x.com/usertourio)

### Recognition

Contributors are featured in our [README](https://github.com/usertour/usertour/blob/main/README.md). We appreciate your help in making Usertour better!
