---
# Auto-generated by mem8 ports
# Last updated: 2025-10-07 01:28:43
# Project: mem8
# Port Range: 20000-20004

project_name: mem8
project_path: 'C:\Users\vaski\projects\mem8'
start_port: 20000
port_count: 5
leased_at: '2025-10-07 01:28:43'
---

# Port Range: 20000-20004

This project has leased ports **20000-20004** from the global mem8 port registry.

## Usage Instructions for AI Agents

**ALWAYS use ports within this range (20000-20004) for all services in this project.**

### Port Assignment Strategy

You have **5 ports** available. Assign them as needed:

- Port 20000: Main frontend (Next.js, React, Vue, etc)
- Port 20001: Backend API
- Port 20002: Database
- Port 20003: Cache/Redis
- Port 20004: Additional services

### Examples

**Next.js Frontend:**
```bash
# Force specific port (prevents auto-increment to 3001)
PORT=20000 npm run dev
# OR
next dev -p 20000
```

**Backend API:**
```bash
# FastAPI
uvicorn main:app --port 20001 --reload

# Flask
flask run --port 20001

# Express
PORT=20001 npm start
```

**Docker Compose:**
```yaml
services:
  frontend:
    ports:
      - "20000:3000"
  backend:
    ports:
      - "20001:8000"
  database:
    ports:
      - "20002:5432"
```

## Killing Processes on Ports

### Safe Kill (Only Ports in Project Range)
```bash
mem8 ports --kill 20000
```

This will only kill processes on ports 20000-20004 (your project's range).

### Force Kill (Any Port - Use with Caution)
```bash
mem8 ports --kill <port> --force
```

### Alternative Methods
```bash
# Cross-platform with npx
npx kill-port 20000

# Windows
netstat -ano | findstr :20000
taskkill /PID <pid> /F

# Unix/Linux/Mac
lsof -ti :20000 | xargs kill -9
```

## Important Notes

1. **Next.js Auto-Increment:** Next.js will use 3001, 3002 if 3000 is taken. Always force the port with `PORT=` or `-p` flag.

2. **Docker Port Mapping:** Map container ports to your assigned range:
   ```yaml
   ports:
     - "20000:3000"  # External:Internal
   ```

3. **Environment Variables:** Set `PORT` env var before starting services:
   ```bash
   export PORT=20000  # Unix
   set PORT=20000      # Windows cmd
   $env:PORT=20000     # Windows PowerShell
   ```

## Global Registry

View all projects and their port assignments:
```bash
mem8 ports --list-all
```

Check for conflicts across projects:
```bash
mem8 ports --check-conflicts
```

Release ports when project is complete:
```bash
mem8 ports --release
```

Registry location: `~/.mem8/port_leases.yaml`

## Project Notes

Add project-specific port configuration notes here. This section is preserved when regenerating.
