Debes tener instalados: - Java 21 (OpenJDK 21 recomendado).
- Spring Boot App (puedes generarla desde Spring Initializr).
- Maven (para compilar y empaquetar la app).
- Docker (descarga oficial).
| <button type="submit" | |
| class="block w-full rounded-lg bg-indigo-600 px-5 py-3 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring focus:ring-indigo-300 active:bg-indigo-800 transition-colors"> | |
| Inicio de sesión | |
| </button> | |
| </EditForm> | |
| <!-- Divisor --> | |
| <div class="mt-6 mb-6"> | |
| <div class="relative"> | |
| <div class="absolute inset-0 flex items-center"> |
Debes tener instalados: - Java 21 (OpenJDK 21 recomendado).
| <Router AppAssembly="typeof(Program).Assembly"> | |
| <Found Context="routeData"> | |
| <AuthorizeRouteView RouteData="routeData" | |
| DefaultLayout="typeof(Shared.NoteLayout)"> | |
| <NotAuthorized> | |
| <div class="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8"> | |
| <div class="max-w-md w-full space-y-8"> | |
| <div class="text-center"> | |
| <!-- Icono de acceso denegado --> | |
| <svg class="mx-auto h-24 w-24 text-red-400" fill="none" stroke="currentColor" |
| @page "/register" | |
| @inject ISender Sender; | |
| @inject NavigationManager NavigationManager; | |
| <PageTitle>Registro de usuario</PageTitle> | |
| <div class="mx-auto max-w-screen-xl px-4 py-16 sm:px-6 lg:px-8"> | |
| <div class="mx-auto max-w-lg"> | |
| <div class="mb-8"> | |
| <h1 class="text-center text-2xl font-bold text-indigo-600 sm:text-3xl">Registro de Usuario</h1> |
Proyecto de ejemplo con estructura en capas (Controller → Service → Repository), DTOs con jakarta.validation, manejo global de errores y paginación. Copia/pega los archivos en tu proyecto y ajusta los paquetes según tu organización.
| /* | |
| ============= | |
| 🏆 Ejercicio | |
| ============= | |
| */ | |
| // 1. Crear la carpeta "RegisterUser" dentro de "TechNotes.Application/Users". | |
| // | |
| // 2. Crear un archivo RegisterUserCommand.cs | |
| // - Clase llamada RegisterUserCommand. | |
| // - Implementa ICommand. |
| @page "/note-editor" | |
| @page "/note-editor/{NoteId:int}" | |
| @inject ISender Sender | |
| @inject NavigationManager NavigationManager; | |
| <div class="mx-auto max-w-screen-xl px-4 py-16 sm:px-6 lg:px-8"> | |
| <div class="mx-auto max-w-lg"> | |
| @if (isEditMode && Note is not null) | |
| { |
| @inherits LayoutComponentBase | |
| <div class="min-h-screen flex flex-col"> | |
| <header> | |
| <div class="mx-auto max-w-screen-xl px-4 sm:px-6 lg:px-8"> | |
| <div class="flex h-16 items-center justify-between"> | |
| <div class="flex-1 md:flex md:items-center md:gap-12"> | |
| <a class="block text-teal-600" href="#"> | |
| <span class="sr-only">Home</span> | |
| <svg class="h-8" viewBox="0 0 28 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
🚀 Pasos esenciales para integrar Tailwind v4 en Blazor:
| @page "/notes" | |
| @attribute [StreamRendering] | |
| @* @inject INoteService NoteService; *@ | |
| @inject ISender Sender; | |
| <PageTitle>Notas</PageTitle> | |
| <!-- Sección para la cabecera --> | |
| <div class="bg-white border-b border-gray-200 mb-8"> |