TF-App’s login system identifies users by their DNI (national identity number) rather than a generic username, reflecting the real estate industry’s reliance on formal identification. The login form performs client-side validation before processing credentials and surfaces all feedback — success or failure — through a custom modal dialog that replaces the browser’s nativeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Niurka77/tf-app/llms.txt
Use this file to discover all available pages before exploring further.
alert() for a polished mobile experience on Android.
Login Flow
App opens — login screen is displayed
When the app launches,
dist/index.html is presented. It renders the DNI input field, a password field, a “Recuérdame” checkbox, and the submit button inside a Tailwind-styled form. Note: src/views/login.html is currently empty — dist/index.html is the authoritative login template.User enters DNI and password
The DNI field (
id="username") accepts the user’s national ID number as plain text. The password field (id="password") uses type="password" to mask the entry. Both fields carry green-themed styling via Tailwind CSS and Font Awesome icons for visual cues.Client-side validation checks for empty fields
On form submission,
main.js trims whitespace from both values. If either field is empty after trimming, showMessage is called immediately and the submit handler returns early — no network request is made.Credentials are checked against the demo values
The current release compares the trimmed inputs against the hardcoded demo credentials: username
usuario and password contraseña. This simulates a real authentication check and will be replaced by a backend API call in production.Successful login — welcome modal is shown
When the credentials match,
showMessage('Inicio de Sesión Exitoso', '¡Bienvenido! Has iniciado sesión correctamente.') is called and the modal appears. A redirect to dashboard.html would follow in a production build.loginForm submit event listener from src/main.js:
The showMessage Modal
showMessage(title, message) is a lightweight custom dialog defined at the top of src/main.js. It was created to replace the browser’s built-in alert(), which renders inconsistently across Android WebViews and breaks the app’s visual design. The function targets three elements in the DOM by ID — messageModal, messageModalTitle, and messageModalBody — sets their text content, and toggles a hidden Tailwind class to show or hide the overlay.
showMessage(title: string, message: string): void
Call this function anywhere in the app to surface user feedback without disrupting the native Android UI.
The modal closes when the user clicks the close button or taps anywhere on the semi-transparent backdrop behind the dialog. This is handled by the
modal.onclick listener that checks event.target === modal, ensuring a tap on the modal content itself does not dismiss it.Remember Me
The login form includes a “Recuérdame” (Remember Me) checkbox rendered below the password field:form-checkbox utility. To activate its persistence behaviour in a production build, read the checkbox value after a successful login and store an auth token in localStorage or a secure cookie so the user is not prompted again on subsequent app launches.
Password Recovery
The “¿Olvidaste tu contraseña?” (Forgot your password?) link beneath the submit button has its own event handler inmain.js:
event.preventDefault() stops the browser from following the href="#" anchor. In the current release the handler simply shows a confirmation modal. For production, replace the showMessage call with a redirect to a dedicated password-reset view or an API request that triggers a recovery email to the user’s registered address.
Connecting to a Real Backend
To replace the hardcoded credential check with a real authentication API, substitute the simulatedif block in the submit handler with a fetch() call:
main.js and follows the same showMessage convention for error feedback. Store the returned token in localStorage to authorize subsequent API calls from the dashboard.