Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dreancaste/TriviaPP/llms.txt

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

TriviaPP uses a set of small, focused TypeScript interfaces to keep data shapes consistent across services, components, and storage layers. Four core models — TriviaQuestion, Profile, RankingItem, and HistoryItem — represent the primary game data that flows through the app. Two additional configuration interfaces — WikiSectionConfig and WikiAssetConfig — drive the Star Wars wiki feature, controlling which entity types are shown, how they are labeled, and which supplemental image assets are attached to each detail page. All interfaces are defined in src/app/models/ or src/app/data/ and are imported directly wherever their shape is needed.

TriviaQuestion

Source: src/app/models/trivia-question.model.ts Represents a single trivia question as it is loaded from the app’s question bank and displayed during a game session.
export interface TriviaQuestion {
  question: string;
  options: string[];
  correctAnswer: string;
  category: string;
}
FieldTypeDescription
questionstringThe question text, written in Spanish.
optionsstring[]Array of four answer strings, shuffled before display so the correct answer appears in a random position each time.
correctAnswerstringThe correct answer. Must match one of the strings in options exactly (case-sensitive) for answer validation to work.
categorystringThematic grouping for the question. Valid values in the current question bank are 'Lore', 'Personajes', 'Planetas', and 'Películas'.
correctAnswer is compared directly against the selected option string. Ensure question data does not introduce leading/trailing whitespace that would cause the comparison to fail.

Profile

Source: src/app/models/profile.model.ts Stores the local player profile that is persisted to device storage and surfaced in the ranking list and settings screen.
export interface Profile {
  displayName: string;
  avatar: string;
  vibrateOnError: boolean;
}
FieldTypeDescription
displayNamestringThe player’s chosen name, displayed in the ranking leaderboard and on the profile page.
avatarstringA Base64-encoded dataUrl string produced by the Capacitor Camera plugin when the player selects or captures a profile photo.
vibrateOnErrorbooleanWhen true, the device triggers haptic feedback via Capacitor Haptics whenever the player selects a wrong answer during a trivia session.

RankingItem

Source: src/app/models/ranking-item.model.ts Represents a single entry in the daily leaderboard, used both when writing scores to Firestore and when reading them back to render the ranking list.
export interface RankingItem {
  name: string;
  score: number;
  date?: string;
}
FieldTypeDescription
namestringThe player’s display name, copied from Profile.displayName at the time the score is submitted.
scorenumberThe total score accumulated during the trivia session.
datestring (optional)ISO date string in YYYY-MM-DD format. Optional on the client — populated by Firestore when scores are written so the leaderboard can be filtered by day.

HistoryItem

Source: src/app/models/history-item.model.ts Records the outcome of a completed trivia session and is persisted locally so players can review their match history and cumulative statistics.
export interface HistoryItem {
  date: string;
  score: number;
  correctAnswers: number;
  totalQuestions: number;
}
FieldTypeDescription
datestringHuman-readable timestamp produced by new Date().toLocaleString() at the moment the session ends. Locale and format depend on the device’s regional settings.
scorenumberThe score earned during the session.
correctAnswersnumberThe count of questions the player answered correctly in the session.
totalQuestionsnumberThe total number of questions in a session. Always 10 in the current game configuration.

WikiSectionConfig

Source: src/app/data/wiki-content.ts Configures the three top-level wiki sections displayed on the wiki home page. Each entry maps an entity type to its display metadata and navigation route. The WIKI_SECTIONS constant exports an array of three WikiSectionConfig objects — one for characters, films, and planets respectively.
export type WikiEntityType = "characters" | "films" | "planets";

export interface WikiSectionConfig {
  type: WikiEntityType;
  title: string;
  description: string;
  route: string;
  image: string;
}
FieldTypeDescription
typeWikiEntityTypeIdentifies the SWAPI entity category. One of "characters", "films", or "planets".
titlestringLocalized section heading shown on the wiki home card (e.g. "Personajes", "Peliculas", "Planetas").
descriptionstringShort subtitle displayed beneath the section title on the wiki home card.
routestringAbsolute Angular router path used when the player taps the section card (e.g. "/wiki/characters").
imagestringPath to the SVG illustration rendered on the section card (e.g. "assets/wiki/wiki-characters.svg").

WikiAssetConfig

Source: src/app/data/wiki-content.ts Attaches supplemental image assets to a specific wiki entity detail page. Stored in the WIKI_ASSETS record keyed by WikiEntityType and then by entity ID. All fields are optional — an entity with no configured assets simply renders without the gallery or map sections.
export interface WikiAssetConfig {
  images?: string[];
  map?: string;
  mobileMap?: string;
}
FieldTypeDescription
imagesstring[] (optional)Array of asset paths for the image gallery shown on the detail page.
mapstring (optional)Asset path to a full-size map image (used on larger screens).
mobileMapstring (optional)Asset path to a mobile-optimised map image rendered on smaller viewports.
In the current release, WikiAssetConfig entries exist only for the planet Tatooine (planets["1"]). Characters and films do not yet have configured asset entries, so their detail pages omit the gallery and map sections.

Summary Table

InterfaceSource FileUsed By
TriviaQuestionsrc/app/models/trivia-question.model.tsTriviaService, TriviaPage
Profilesrc/app/models/profile.model.tsStorageService, ProfilePage
RankingItemsrc/app/models/ranking-item.model.tsRankingService, StorageService, RankingPage
HistoryItemsrc/app/models/history-item.model.tsStorageService, HistoryPage
WikiSectionConfigsrc/app/data/wiki-content.tsWikiPage, WIKI_SECTIONS constant
WikiAssetConfigsrc/app/data/wiki-content.tsWikiDetailPage, WIKI_ASSETS constant

Build docs developers (and LLMs) love