Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ivan-1f/phichain/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Project system manages Phichain chart projects, including metadata and file organization. A project consists of a directory containing chart data, music files, illustrations, and metadata.

Types

Project

The main project type that represents an opened chart project.
path
ProjectPath
required
The path to the project directory
meta
ProjectMeta
required
Project metadata including composer, charter, and song information
id
Uuid
required
A unique identifier for this project session, generated when the project is opened

ProjectMeta

Metadata about the chart and song.
composer
String
required
The music composer’s name
charter
String
required
The chart creator’s name
illustrator
String
required
The illustration artist’s name
name
String
required
The song/chart name
level
String
required
The difficulty level (e.g., “EZ”, “HD”, “IN”, “AT”)

ProjectPath

A wrapper around the project directory path.
0
PathBuf
required
The root directory path of the project

Project Structure

A valid Phichain project must have the following structure:
project-folder/
├── chart.json          # Chart data (required)
├── meta.json           # Project metadata (required)
├── music.[ext]         # Audio file (required, .wav/.mp3/.ogg/.flac)
└── illustration.[ext]  # Cover image (optional, .png/.jpg/.jpeg)

Opening Projects

use phichain_chart::project::Project;
use std::path::PathBuf;

// Open a project from a directory
let project = Project::open(PathBuf::from("./my-chart"))?;

println!("Chart: {}", project.meta.name);
println!("Composer: {}", project.meta.composer);
println!("Charter: {}", project.meta.charter);

Working with Project Paths

The ProjectPath type provides helper methods to access project files:
let project = Project::open(PathBuf::from("./my-chart"))?;

// Get standard file paths
let chart_path = project.path.chart_path();           // ./my-chart/chart.json
let meta_path = project.path.meta_path();             // ./my-chart/meta.json
let music_path = project.path.music_path();           // ./my-chart/music.mp3 (if exists)
let illustration_path = project.path.illustration_path(); // ./my-chart/illustration.png (if exists)

// Get custom file paths
let custom = project.path.sub_path("assets/background.png");

JSON Serialization

meta.json Format

{
  "name": "Example Song",
  "composer": "Artist Name",
  "charter": "Charter Name",
  "illustrator": "Illustrator Name",
  "level": "HD"
}

Error Handling

OpenProjectError

Errors that can occur when opening a project:

Notes

  • The id field is generated randomly each time a project is opened and is used to distinguish different sessions of the same project
  • Music files can have any of the following extensions: .wav, .mp3, .ogg, .flac
  • Illustration files can have any of the following extensions: .png, .jpg, .jpeg
  • The illustration file is optional; all other files are required

Build docs developers (and LLMs) love