Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/HectorDNC/galactic-tournament-front/llms.txt

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

Galactic Tournament’s Angular frontend communicates exclusively with a single Spring Boot backend over HTTP. Every service uses environment.api_url as the base URL, so the correct backend is targeted automatically depending on the active build configuration. This page documents every endpoint the frontend calls, the TypeScript interfaces that model their payloads, and ready-to-run curl examples.
The production backend is deployed on Railway at https://galactic-tournament-app-production.up.railway.app. All example URLs on this page use that base. For local development, substitute http://localhost:8080.

TypeScript Interfaces

The following interfaces are defined in the project’s model files and are used as generic type arguments for Angular’s HttpClient responses throughout the services.
// src/app/modules/species/models/specie.ts
export interface Specie {
  id: number;
  name: string;
  powerLevel: number;
  specialAbility: string;
  createdAt: Date;
}

// src/app/modules/species/services/species.service.ts
export interface SpecieRequest {
  name: string;
  powerLevel: number;
  specialAbility: string;
}

// src/app/modules/battle/models/battle.ts
export interface BattleRequest {
  fighterLeftId: number;
  fighterRightId: number;
}

export interface BattleResult {
  id: number;
  fighterLeft: Specie;
  fighterRight: Specie;
  winner: Specie;
  battleDate: Date;
}

// src/app/modules/battle-statistics/models/ranking.ts
export interface RankingResponse {
  specieId: number;
  species: Specie;
  victories: number;
}

// src/app/shared/models/dashboard.dto.ts
export interface DashboardDTO {
  totalSpecies: number;
  top3Ranking: RankingResponse[];
  lastBattle: BattleResult;
}

// src/app/shared/models/page.ts
export interface Page<T> {
  content: T[];
  page: PageInfo;
}

export interface PageInfo {
  size: number;
  number: number;       // 0-based current page index
  totalElements: number;
  totalPages: number;
}

Endpoints

GET /api/species/all

Returns the complete, unpaginated list of all species. Used by the battle form to populate fighter dropdowns.GET {api_url}/api/species/allNo request parameters.Response — Specie[]
[n].id
number
required
Unique identifier for the species.
[n].name
string
required
Display name of the species (e.g. "Zorgon").
[n].powerLevel
number
required
Numeric combat power rating used to determine battle outcomes.
[n].specialAbility
string
required
Text description of the species’ unique ability.
[n].createdAt
Date
required
ISO 8601 timestamp recording when the species was registered.

GET /api/species

Returns a paginated, optionally filtered list of species. Used by the species management table.GET {api_url}/api/species?page=0&size=10&name=zorgQuery Parameters
page
number
default:"0"
Zero-based page index.
size
number
default:"10"
Number of records per page.
name
string
Optional partial-match filter on the species name. Omit to return all species for the requested page.
Response — Page<Specie>
content
Specie[]
required
Array of species objects for the current page. Each element has the same shape as the /api/species/all response items.
page
PageInfo
required

GET /api/species/:id

Fetches a single species by its numeric ID.GET {api_url}/api/species/{id}Path Parameters
id
number
required
The unique identifier of the species to retrieve.
Response — SpecieReturns a single Specie object. See GET /api/species/all for field descriptions.

POST /api/species

Creates a new species entry.POST {api_url}/api/speciesRequest Body — SpecieRequest
name
string
required
Name of the new species. Must be unique.
powerLevel
number
required
Numeric power rating. Higher values give an advantage in battles.
specialAbility
string
required
Description of the species’ special combat ability.
Response — SpecieReturns the newly created Specie object, including the server-assigned id and createdAt timestamp.

PUT /api/species/:id

Updates an existing species by ID. The entire SpecieRequest body must be provided (full replacement, not a partial patch).PUT {api_url}/api/species/{id}Path Parameters
id
number
required
The unique identifier of the species to update.
Request Body — SpecieRequest
name
string
required
Updated species name.
powerLevel
number
required
Updated power level.
specialAbility
string
required
Updated special ability description.
Response — SpecieReturns the updated Specie object.

curl Examples

curl -X GET \
  "https://galactic-tournament-app-production.up.railway.app/api/species?page=0&size=5" \
  -H "Accept: application/json"

Endpoint Summary

MethodPathServiceDescription
GET/api/species/allSpeciesService.getAll()All species, unpaginated
GET/api/speciesSpeciesService.findAll()Paginated + filterable species list
GET/api/species/:idSpeciesService.findById()Single species by ID
POST/api/speciesSpeciesService.create()Create a new species
PUT/api/species/:idSpeciesService.update()Update an existing species
POST/api/battlesBattleService.start()Start a battle between two species
POST/api/battles/randomBattleService.randomBattle()Start a battle with random fighters
GET/api/battle-statistics/rankingBattleStatisticsService.getRanking()Victory leaderboard
GET/api/dashboardDashboardService.getDashboard()Aggregated dashboard summary

Build docs developers (and LLMs) love