# Onboarding

This guide gets a new engineer from clone to working auth requests.

## 1) Clone and prerequisites

Required:

- Rust `>=1.93.1`
- Docker Desktop
- PostgreSQL client tooling (`psql`) if you want manual schema checks

Commands:

```bash
git clone https://github.com/xylex-group/athena-auth.git
cd athena-auth
rustup update stable
```

## 2) Environment file

Create local env:

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

Minimum required values in `.env`:

```env
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/athena_auth
JWT_SECRET=replace_with_at_least_32_chars
BASE_URL=http://localhost:3000
AUTH_BASE_PATH=/api/auth
PORT=3000
```

## 3) Start dependencies and server

```bash
docker compose up -d postgres
cargo run --bin server --features server
```

On startup you should see lines like:

- `Athena Auth server booted`
- `Hosting now on http://localhost:3000`
- `Auth routes: http://localhost:3000/api/auth`

## 4) Validate service health

```bash
curl http://localhost:3000/api/auth/health
```

Expected: HTTP `200` JSON status.

## 5) Quick auth smoke test

```bash
curl -X POST http://localhost:3000/api/auth/sign-up/email \
  -H "content-type: application/json" \
  -d '{"name":"Demo","email":"demo@example.com","password":"password123"}'
```

If successful, response includes `token` + `user`.

## 6) Optional: run Next demo client

```bash
cd apps/demo
npm install
npm run dev
```

Open `http://localhost:3001/login`.

## 7) Where to go next

- Local setup details: `runbooks/LOCAL_DEVELOPMENT.md`
- Operational runbook: `runbooks/OPERATIONS.md`
- Troubleshooting: `runbooks/TROUBLESHOOTING.md`
