Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/yeremyacuna/LYNX/llms.txt

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

The Administrator role in LYNX provides unrestricted access to system data and reporting. Administrators can list all passengers and drivers, inspect every trip across the waiting queue, active trips, and history, search for passengers by DNI, run sorting algorithms across any data set, view platform-wide statistics, and audit password records stored in binary format. All admin actions are available from the Administrator Panel, which is accessible from the main menu under “Administracion”.

Admin Credentials

Admin accounts are stored across two files:
  • assets/admins.txt — plain-text file holding one record per line in the format ADM-XXX|username|password (3-digit zero-padded numeric suffix). For example: ADM-001|Yeremy|admin777.
  • assets/passwords.bin — binary file that stores a separate password snapshot. This binary store is written by AuthManager::savePasswordsBinary() and read back by AuthManager::readPasswordsBinary().
Login is handled by AuthManager::loginAdminValid(username, password), which looks up the admin by username and validates the plain-text password against the stored record.

Administrator Panel

The panel presents 12 numbered actions navigated with the arrow keys. Pressing Enter on the highlighted option executes the corresponding function.
#Menu ItemFunction Called
1List all passengersAdministratorMenu::listarUsuarios()
2List all driversAdministratorMenu::listarConductores()
3List all tripsAdministratorMenu::listarViajes()
4Search passenger by DNIAdministratorMenu::buscarUsuario()
5Sort drivers by ratingAdministratorMenu::ordenarConductores()
6Top drivers (rating ≥ 4.0)AdministratorMenu::topConductores()
7General statisticsAdministratorMenu::estadisticas()
8Sort passengers by total spendingAdministratorMenu::ordenarPasajeros()
9Sort passengers by IDAdministratorMenu::ordenarPasajerosPorId()
10Sort drivers by IDAdministratorMenu::ordenarConductoresPorId()
11Sort active trips by priceAdministratorMenu::ordenarViajesActivos()
12View passwords in binaryAdministratorMenu::verPasswordsBinarias()

List all passengers (1)

Iterates the passenger LinkedList with forEach and prints each record using Passenger::toString().

List all drivers (2)

Iterates the driver LinkedList with forEach and prints each record using Driver::toString().

List all trips (3)

Calls TripManager::viewWaitingDetailed(), TripManager::viewActive(), and TripManager::viewHistory() to display trips across all three containers (waiting queue, active list, and history stack). Also shows the platform’s cumulative 20 % commission earnings via TripManager::getTotalPlatformEarnings().

Search passenger by DNI (4)

Uses LinkedList::findFirst to locate the passenger whose dni matches the input. If found, also retrieves that passenger’s most recent trip via TripManager::getLastTripByPassenger(dni) and displays it alongside the passenger record.

Sort drivers by rating (5)

Applies ShellSort (descending) via AuthManager::sortDriversByRating() and prints the driver list before and after to show the effect of the sort.

Top drivers — rating ≥ 4.0 (6)

Scans the driver list with a lambda filter and displays only drivers whose rating is 4.0 or higher.

General statistics (7)

Aggregates system-wide metrics and displays them in a single screen. The output is produced by AdministratorMenu::estadisticas():
// From AdministratorMenu.h
int disponibles = authMgr->contarConductoresDisponibles(0);
float ganancia  = tripMgr->getTotalPlatformEarnings();

fila("Conductores disponibles", to_string(disponibles));
fila("Viajes en espera",        to_string(tripMgr->getTotalWaiting()));
fila("Viajes activos",          to_string(tripMgr->getTotalActiveTrips()));
fila("Viajes en historial",     to_string(tripMgr->getTotalHistoryTrips()));
fila("Ganancia plataforma",     "S/ " + to_string(ganancia));
fila("Monto total en cola",     "S/ " + to_string(tripMgr->calcTotalEnCola()));
fila("Viajes en curso",         to_string(tripMgr->contarViajesEnCurso()));
authMgr->contarConductoresDisponibles(0) is a recursive method that walks the driver list counting available drivers. tripMgr->getTotalPlatformEarnings() applies the 20 % commission to all completed trip fares.

Sort passengers by total spending (8)

Applies Insertion Sort (descending) via AuthManager::sortUsersBySpent() and prints passenger names and totals before and after the sort.

Sort passengers by ID (9)

Applies AuthManager::sortPassengersById() and lists each passenger’s PAS-XXXX code, name, and DNI in the resulting order.

Sort drivers by ID (10)

Applies AuthManager::sortDriversById() and lists each driver’s DRV-XXXX code, name, and DNI in the resulting order.

Sort active trips by price (11)

Applies a sort on the active DoublyLinkedList<Trip> via TripManager::sortActiveTripsByPrice() and shows each trip’s ID and price before and after.

View passwords in binary (12)

Calls AuthManager::savePasswordsBinary() to write the current snapshot to assets/passwords.bin, then reads it back with AuthManager::readPasswordsBinary() and displays each entry’s type, ID, DNI, and binary-encoded password string on screen.

Security Note

Admin passwords are stored in binary format inside assets/passwords.bin. This file must not be edited manually — the binary layout is written and parsed exclusively by AuthManager::savePasswordsBinary() and AuthManager::readPasswordsBinary(). Editing the file with a text editor will corrupt the binary records and prevent all admin logins. If the file is lost or corrupted, it must be regenerated by running the application with a valid admins.txt present and triggering a save cycle.

Creating an Admin Account

New administrator accounts are created programmatically via AuthManager::registerAdmin(username, password). The method generates a sequential ADM-XXX identifier (e.g. ADM-116) using FileManager::generarIdAdmin(contador), which zero-pads the counter to 3 digits with setw(3). The record is appended to assets/admins.txt in the pipe-delimited format:
ADM-XXX|username|password
The first few entries in the live data file illustrate the format:
ADM-001|Yeremy|admin777
ADM-002|Salvador|tyranitar
ADM-003|Melissa|heichahi

Key Admin Capabilities

User Visibility

List and search all registered passengers and drivers. Sort passenger lists by ID or total spending, and driver lists by rating or ID, for quick reporting.

Trip Overview

Inspect all trips across the waiting queue, active trips list, and history stack in a single view, including the platform’s cumulative commission earnings.

Sorting and Reports

Run on-demand sort algorithms — ShellSort on drivers, Insertion Sort on passengers, price sort on active trips — and view live platform statistics.

Security Audit

Trigger a binary password snapshot at any time and review each account’s binary-encoded credential directly from the administrator panel.

Build docs developers (and LLMs) love