Skip to content

Configuration

Ilyes BEN BRIK edited this page Jul 18, 2026 · 1 revision

Configuration

All configuration is done through the .env file in the project root.

Environment Variables

Application

Variable Default Description
APP_ENV production Environment (production or development)
APP_DEBUG false Show debug errors (never true in production)
APP_KEY required Application encryption key (base64 encoded)

Database

Variable Default Description
DB_HOST db Database hostname (use db for Docker)
DB_PORT 5432 PostgreSQL port
DB_DATABASE home_library Database name
DB_USERNAME library_user Database username
DB_PASSWORD required Database password

Authentication

Variable Default Description
JWT_SECRET required Secret for JWT token signing (min 48 chars)

CORS & Networking

Variable Default Description
CORS_ORIGIN http://localhost:3000 Allowed frontend origin
BACKEND_PORT 8080 Backend port exposed on host
FRONTEND_PORT 3000 Frontend port exposed on host
API_URL http://localhost:8080/api API URL as seen by the browser

AI Book Scanner

Variable Default Description
GEMINI_API_KEY (empty) Google Gemini API key for AI scanning
GEMINI_MODEL gemini-2.0-flash Gemini model to use

If GEMINI_API_KEY is empty, the scanner falls back to Tesseract OCR (lower quality).

Accessing from Other Devices (LAN)

To use the app from your phone or other devices on the same network:

  1. Find your computer's IP:

    # macOS
    ipconfig getifaddr en0
    # Linux
    hostname -I | awk '{print $1}'
  2. Update .env:

    API_URL=http://192.168.1.x:8080/api
    CORS_ORIGIN=http://192.168.1.x:3000
  3. Rebuild frontend:

    docker compose up -d --build frontend
  4. Access from phone: http://192.168.1.x:3000

Port Conflicts

If ports 3000 or 8080 are already in use:

BACKEND_PORT=9090
FRONTEND_PORT=4000
API_URL=http://localhost:9090/api

Language Configuration

The UI language is selected per-user in the interface. Default is English. Available:

  • πŸ‡¬πŸ‡§ English (en)
  • πŸ‡ΈπŸ‡¦ Arabic (ar) β€” full RTL support
  • πŸ‡«πŸ‡· French (fr)

Next: Getting Started

Clone this wiki locally