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

140 lines
3.3 KiB
Markdown

# 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
- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)
### Quick Start
1. Clone the repository:
```bash
git clone <repository-url>
cd TRUSTS
```
2. Install dependencies:
```bash
npm install
```
3. Start the application:
```bash
docker-compose up -d
```
4. Test the Docker setup:
```bash
./test-docker.sh
```
5. Access the application:
- Web app: http://localhost:3000
- API: http://localhost:3000/api/trusts
### Building and Pushing the Docker Image
If you want to build and push the Docker image to a registry:
1. Build the image:
```bash
docker build -t your-username/ffxi-trusts:latest .
```
2. Push the image to a registry:
```bash
docker push your-username/ffxi-trusts:latest
```
3. Pull and run the image on your server:
```bash
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:
```sql
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:
```bash
npm install
```
2. Configure the database connection in `db.conf`
3. Start the server:
```bash
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.