diff --git a/Components/Layout/NavMenu.razor b/Components/Layout/NavMenu.razor
index 03e7be4..9fcecd5 100644
--- a/Components/Layout/NavMenu.razor
+++ b/Components/Layout/NavMenu.razor
@@ -13,6 +13,12 @@
Home
+
+
+
+ Register
+
+
diff --git a/Components/Pages/Account/Register.razor b/Components/Pages/Account/Register.razor
new file mode 100644
index 0000000..472cd89
--- /dev/null
+++ b/Components/Pages/Account/Register.razor
@@ -0,0 +1,62 @@
+@page "/register"
+@using Sandbox.Models.ViewModels
+@using Sandbox.Services.AuthService
+
+@* @inject AuthenticationStateProvider AuthenticationStateProvider *@
+@* @inject NavigationManager NavigationManager *@
+@inject IAuthService AuthService
+
+Register
+
+
+
+
+
+
Register Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @errorMessage
+
+
+
+ @message
+
+
+@code {
+ UserRegister user = new();
+
+ private string message = string.Empty;
+ private string messageCssClass = string.Empty;
+ private string errorMessage = string.Empty;
+
+ async void HandleRegistration()
+ {
+ var result = await AuthService.Register(user.Email, user.Password);
+ message = result.Message;
+ messageCssClass = result.Success ? "text-success" : "text-danger";
+ }
+}
\ No newline at end of file
diff --git a/Components/_Imports.razor b/Components/_Imports.razor
index eb69c3d..c69bc87 100644
--- a/Components/_Imports.razor
+++ b/Components/_Imports.razor
@@ -6,6 +6,6 @@
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
-@using blazor_server_mini_sandbox
-@using blazor_server_mini_sandbox.Components
-@using blazor_server_mini_sandbox.Components.Layout
+@using Sandbox
+@using Sandbox.Components
+@using Sandbox.Components.Layout
diff --git a/Models/ViewModels/ServiceResponse.cs b/Models/ViewModels/ServiceResponse.cs
new file mode 100644
index 0000000..a518d53
--- /dev/null
+++ b/Models/ViewModels/ServiceResponse.cs
@@ -0,0 +1,8 @@
+namespace Sandbox.Models.ViewModels;
+
+public class ServiceResponse
+{
+ public T? Data { get; set; }
+ public bool Success { get; set; } = true;
+ public string Message { get; set; } = string.Empty;
+}
\ No newline at end of file
diff --git a/Models/ViewModels/UserRegister.cs b/Models/ViewModels/UserRegister.cs
new file mode 100644
index 0000000..e1a4224
--- /dev/null
+++ b/Models/ViewModels/UserRegister.cs
@@ -0,0 +1,12 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Sandbox.Models.ViewModels;
+
+public class UserRegister
+{
+ public string Email { get; set; } = string.Empty;
+ [Required, StringLength(100, MinimumLength = 5)]
+ public string Password { get; set; } = string.Empty;
+ [Compare("Password", ErrorMessage = "The password do not match.")]
+ public string ConfirmPassword { get; set; } = string.Empty;
+}
\ No newline at end of file
diff --git a/Program.cs b/Program.cs
index 48dc6aa..5a534d4 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,4 +1,5 @@
-using blazor_server_mini_sandbox.Components;
+using Sandbox.Components;
+using Sandbox.Services.AuthService;
var builder = WebApplication.CreateBuilder(args);
@@ -6,6 +7,8 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
+builder.Services.AddScoped();
+
var app = builder.Build();
// Configure the HTTP request pipeline.
diff --git a/Services/AuthService/AuthService.cs b/Services/AuthService/AuthService.cs
new file mode 100644
index 0000000..f855537
--- /dev/null
+++ b/Services/AuthService/AuthService.cs
@@ -0,0 +1,16 @@
+using Sandbox.Models.ViewModels;
+
+namespace Sandbox.Services.AuthService;
+
+public class AuthService : IAuthService
+{
+ public async Task> Register(string userName, string password)
+ {
+ return new ServiceResponse
+ {
+ Data = 1,
+ Message = $"Got register request with user name {userName}",
+ Success = true
+ };
+ }
+}
\ No newline at end of file
diff --git a/Services/AuthService/IAuthService.cs b/Services/AuthService/IAuthService.cs
new file mode 100644
index 0000000..83bf777
--- /dev/null
+++ b/Services/AuthService/IAuthService.cs
@@ -0,0 +1,8 @@
+using Sandbox.Models.ViewModels;
+
+namespace Sandbox.Services.AuthService;
+
+public interface IAuthService
+{
+ Task> Register(string userName, string password);
+}
\ No newline at end of file
diff --git a/blazor-server-mini-sandbox.csproj b/blazor-server-mini-sandbox.csproj
index c751daa..aa45a32 100644
--- a/blazor-server-mini-sandbox.csproj
+++ b/blazor-server-mini-sandbox.csproj
@@ -4,7 +4,7 @@
net10.0
enable
enable
- blazor_server_mini_sandbox
+ Sandbox
$(AssemblyName.Replace(' ', '_'))
true