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;
}
| Field | Type | Description |
|---|
question | string | The question text, written in Spanish. |
options | string[] | Array of four answer strings, shuffled before display so the correct answer appears in a random position each time. |
correctAnswer | string | The correct answer. Must match one of the strings in options exactly (case-sensitive) for answer validation to work. |
category | string | Thematic 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;
}
| Field | Type | Description |
|---|
displayName | string | The player’s chosen name, displayed in the ranking leaderboard and on the profile page. |
avatar | string | A Base64-encoded dataUrl string produced by the Capacitor Camera plugin when the player selects or captures a profile photo. |
vibrateOnError | boolean | When 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;
}
| Field | Type | Description |
|---|
name | string | The player’s display name, copied from Profile.displayName at the time the score is submitted. |
score | number | The total score accumulated during the trivia session. |
date | string (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;
}
| Field | Type | Description |
|---|
date | string | Human-readable timestamp produced by new Date().toLocaleString() at the moment the session ends. Locale and format depend on the device’s regional settings. |
score | number | The score earned during the session. |
correctAnswers | number | The count of questions the player answered correctly in the session. |
totalQuestions | number | The 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;
}
| Field | Type | Description |
|---|
type | WikiEntityType | Identifies the SWAPI entity category. One of "characters", "films", or "planets". |
title | string | Localized section heading shown on the wiki home card (e.g. "Personajes", "Peliculas", "Planetas"). |
description | string | Short subtitle displayed beneath the section title on the wiki home card. |
route | string | Absolute Angular router path used when the player taps the section card (e.g. "/wiki/characters"). |
image | string | Path 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;
}
| Field | Type | Description |
|---|
images | string[] (optional) | Array of asset paths for the image gallery shown on the detail page. |
map | string (optional) | Asset path to a full-size map image (used on larger screens). |
mobileMap | string (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
| Interface | Source File | Used By |
|---|
TriviaQuestion | src/app/models/trivia-question.model.ts | TriviaService, TriviaPage |
Profile | src/app/models/profile.model.ts | StorageService, ProfilePage |
RankingItem | src/app/models/ranking-item.model.ts | RankingService, StorageService, RankingPage |
HistoryItem | src/app/models/history-item.model.ts | StorageService, HistoryPage |
WikiSectionConfig | src/app/data/wiki-content.ts | WikiPage, WIKI_SECTIONS constant |
WikiAssetConfig | src/app/data/wiki-content.ts | WikiDetailPage, WIKI_ASSETS constant |