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

# Wearable API Quickstart

> Make your first wearable API call in 5 minutes. Covers Docker setup, environment config, and your first authenticated health data request.

## Get started in three steps

Get Open Wearables running locally and start integrating wearable device data.

### Step 1: Set up your environment

> [accordion] Clone the repository
>
> Clone the Open Wearables repository to your local machine:
>
> ```bash theme={null}
> git clone https://github.com/the-momentum/open-wearables.git
> cd open-wearables
> ```

> [accordion] Configure environment variables
>
> Create environment files for both backend and frontend and generate their secrets:
>
> ```bash theme={null}
> make init
> ```
>
> This copies both `.env.example` files to `.env` and generates `SECRET_KEY`; running it again keeps the key. Without `make`, copy the files yourself and set `SECRET_KEY` to the output of `openssl rand -hex 32` (at least 32 characters, or the backend does not start).
>
> **Backend configuration:**
>
> Edit `./backend/config/.env` with your configuration. You'll need to set up:
>
> * Database credentials
> * Redis/Celery broker settings
> * OAuth credentials for wearable providers (Garmin, Fitbit, etc.)
>
> **Frontend configuration:**
>
> Edit `./frontend/.env` with your frontend configuration:
>
> * `VITE_API_URL` - Backend API URL (default: `http://localhost:8000`)
>
> > [!TIP]
> >
> > Default credentials are provided in the `.env.example` files for local development.
>
> > [!TIP]
> >
> > Outgoing webhooks are disabled by default. Set `OUTGOING_WEBHOOKS_ENABLED=true` to enable
> > real-time event delivery — see the [webhooks guide](https://openwearables.io/docs/api-reference/guides/webhooks.md).

### Step 2: Start the application

> [accordion] Using Docker (Recommended)
>
> The easiest way to get started is with Docker Compose:
>
> ```bash theme={null}
> docker compose up -d
> ```
>
> For development with hot-reloading, use the `--watch` flag:
>
> ```bash theme={null}
> docker compose watch
> ```
>
> The `--watch` flag enables automatic file synchronization and service restarts:
>
> * **Backend**: Automatically syncs code changes and restarts services on file updates
> * **Frontend**: Hot-reloads on source file changes
> * **Migrations**: Restarts backend when migration files change
> * **Dependencies**: Rebuilds containers when package files change
>
> This will start all required services:
>
> * PostgreSQL database
> * Redis
> * FastAPI backend
> * Celery worker
> * Celery beat (scheduler)
> * Frontend development server
>
> Once started, access:
>
> * 🌐 **API**: [http://localhost:8000](http://localhost:8000)
>
> * 📚 **Swagger UI**: [http://localhost:8000/docs](http://localhost:8000/docs)
>
> * 🔐 **Developer Portal**: [http://localhost:3000](http://localhost:3000)
>
> > [!TIP]
> >
> > Use `docker compose logs -f` to view logs from all services.

> [accordion] Local development setup
>
> For local development without Docker:
>
> **Backend setup:**
>
> 1. Install dependencies using `uv` (recommended) or `pip`:
>    ```bash theme={null}
>    cd backend
>    uv sync
>    ```
>
> 2. Set up PostgreSQL and Redis locally
>
> 3. Run database migrations:
>    ```bash theme={null}
>    alembic upgrade head
>    ```
>
> 4. Start the FastAPI server:
>    ```bash theme={null}
>    uvicorn app.main:api --reload
>    ```
>
> **Frontend setup:**
>
> 5. Install frontend dependencies using [Bun](https://bun.sh):
>    ```bash theme={null}
>    cd frontend
>    bun install
>    ```
>
> 6. Start the frontend development server:
>    ```bash theme={null}
>    bun run dev
>    ```
>
> The frontend will be available at [http://localhost:3000](http://localhost:3000)

### Step 3: Make your first API call

> [accordion] Test the API
>
> Once the application is running, you can test it:
>
> 1. **Check server status**:
>    ```bash theme={null}
>    curl http://localhost:8000/
>    ```
>    Should return: `{"message": "Server is running!"}`
>
> 2. **Create an API key**:
>    An admin account is created on first startup from the `ADMIN_EMAIL` and `ADMIN_PASSWORD` environment variables (defaults: `admin@admin.com` / `your-secure-password`), only while the developer table is empty. After that, changing `ADMIN_PASSWORD` does not update the account - **set your own `ADMIN_PASSWORD` before the first start, or change the default password from the developer portal right after your first login**. With `ENVIRONMENT=production` the default password is refused: a fresh deployment does not start until `ADMIN_PASSWORD` is set, and an admin that still has the default cannot sign in until you set `ADMIN_PASSWORD` (with `ADMIN_EMAIL` matching that account's email) and restart the backend, which then changes that account's password to it. To add further accounts, invite them from **Settings → Team**. All developer accounts have the same permissions, see [Team](https://openwearables.io/docs/developer-portal/settings/team.md#access-model).
>
>    Use the [developer portal](https://openwearables.io/docs/developer-portal.md) at [http://localhost:3000/](http://localhost:3000/) to log in and generate API keys. Copy the key right away - it is shown only once and cannot be retrieved later.
>
> 3. **Seed sample data** (optional):
>    If you want test users and sample activity data:
>    ```bash theme={null}
>    make seed
>    ```
>
> 4. **View API documentation**:
>    Open [http://localhost:8000/docs](http://localhost:8000/docs) in your browser to explore the interactive Swagger UI.
>
> 5. **Make requests**:
>    ```bash theme={null}
>    # Use the API key to make authenticated requests
>    curl http://localhost:8000/api/v1/users \
>      -H "X-Open-Wearables-API-Key: YOUR_API_KEY"
>    ```

## Next steps

> [card] [API Reference](https://openwearables.io/docs/api-reference/introduction.md)
>
> Explore all available API endpoints.

> [card] [GitHub](https://github.com/the-momentum/open-wearables)
>
> View source code and contribute.

> [!NOTE]
>
> **Need help?** Check out our [GitHub Discussions](https://github.com/the-momentum/open-wearables/discussions) or open an issue on GitHub.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.