Files
ffxi-trusts/README.md
2025-07-12 23:10:19 +01:00

3.3 KiB

FFXI Trust Characters Web App

A web application for browsing and managing Final Fantasy XI Trust characters.

Features

  • Browse characters by role
  • Search characters by name, role, job, abilities, or spells
  • View detailed character information
  • Track which characters you have acquired
  • Explore synergy sets between characters

Deployment with Docker

This application can be easily deployed using Docker and Docker Compose.

Prerequisites

Quick Start

  1. Clone the repository:

    git clone <repository-url>
    cd TRUSTS
    
  2. Install dependencies:

    npm install
    
  3. Start the application:

    docker-compose up -d
    
  4. Test the Docker setup:

    ./test-docker.sh
    
  5. Access the application:

Building and Pushing the Docker Image

If you want to build and push the Docker image to a registry:

  1. Build the image:

    docker build -t your-username/ffxi-trusts:latest .
    
  2. Push the image to a registry:

    docker push your-username/ffxi-trusts:latest
    
  3. Pull and run the image on your server:

    docker pull your-username/ffxi-trusts:latest
    docker run -d -p 3000:3000 \
      -e PSQL_HOST=your-db-host \
      -e PSQL_PORT=5432 \
      -e PSQL_USER=postgres \
      -e PSQL_PASSWORD=your-password \
      -e PSQL_DBNAME=ffxi_items \
      your-username/ffxi-trusts:latest
    

Configuration

The application connects to an existing PostgreSQL database for storing character data. The default configuration in the docker-compose.yml file is:

  • Database host: 10.0.0.199
  • Database port: 5432
  • Database name: ffxi_items
  • Database user: postgres
  • Database password: DP3Wv*QM#t8bY*N

You can modify these settings in the docker-compose.yml file if your database connection details are different.

Database Requirements

The application expects a PostgreSQL database with a trusts table that has the following schema:

CREATE TABLE trusts (
    id SERIAL PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    alt_name VARCHAR(255),
    role VARCHAR(100),
    job TEXT,
    spells TEXT,
    abilities TEXT,
    weapon_skills TEXT,
    invincible BOOLEAN DEFAULT FALSE,
    acquisition TEXT,
    special_features TEXT,
    trust_synergy TEXT,
    trust_synergy_names TEXT[],
    acquired BOOLEAN DEFAULT FALSE
);

If your database doesn't have this schema, you can use the provided init.sql script to create it.

Development

For development purposes, you can run the application without Docker:

  1. Install dependencies:

    npm install
    
  2. Configure the database connection in db.conf

  3. Start the server:

    node server.js
    

API Endpoints

  • GET /api/trusts - Get all characters
  • GET /api/trusts/:id - Get a specific character by ID
  • GET /api/trusts/role/:role - Get characters by role
  • GET /api/trusts/search/:query - Search characters
  • PUT /api/trusts/:id/toggle-acquired - Toggle the acquired status of a character
  • GET /health - Health check endpoint for monitoring the application status

License

This project is licensed under the MIT License - see the LICENSE file for details.