diff --git a/AppForKids.sln b/AppForKids.sln
new file mode 100644
index 0000000..ed81e30
--- /dev/null
+++ b/AppForKids.sln
@@ -0,0 +1,16 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppForKids", "AppForKids\AppForKids.csproj", "{4E7B7257-224A-465E-84C9-AF7DC5D9FF3E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4E7B7257-224A-465E-84C9-AF7DC5D9FF3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4E7B7257-224A-465E-84C9-AF7DC5D9FF3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4E7B7257-224A-465E-84C9-AF7DC5D9FF3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4E7B7257-224A-465E-84C9-AF7DC5D9FF3E}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/AppForKids/App.axaml b/AppForKids/App.axaml
new file mode 100644
index 0000000..c349c73
--- /dev/null
+++ b/AppForKids/App.axaml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AppForKids/App.axaml.cs b/AppForKids/App.axaml.cs
new file mode 100644
index 0000000..abf90b5
--- /dev/null
+++ b/AppForKids/App.axaml.cs
@@ -0,0 +1,23 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+
+namespace AppForKids;
+
+public partial class App : Application
+{
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
+ desktop.MainWindow = new Registration();
+ }
+
+ base.OnFrameworkInitializationCompleted();
+ }
+}
\ No newline at end of file
diff --git a/AppForKids/AppForKids.csproj b/AppForKids/AppForKids.csproj
new file mode 100644
index 0000000..36e431a
--- /dev/null
+++ b/AppForKids/AppForKids.csproj
@@ -0,0 +1,29 @@
+
+
+ WinExe
+ net8.0
+ enable
+ true
+ app.manifest
+ true
+
+
+
+
+
+
+
+
+
+
+ None
+ All
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
diff --git a/AppForKids/MainWindow.axaml b/AppForKids/MainWindow.axaml
new file mode 100644
index 0000000..b6a3dc9
--- /dev/null
+++ b/AppForKids/MainWindow.axaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
diff --git a/AppForKids/MainWindow.axaml.cs b/AppForKids/MainWindow.axaml.cs
new file mode 100644
index 0000000..a82e035
--- /dev/null
+++ b/AppForKids/MainWindow.axaml.cs
@@ -0,0 +1,36 @@
+using AppForKids.models;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+
+namespace AppForKids;
+
+public partial class MainWindow : Window
+{
+ private User? _currentUser = null;
+ public MainWindow(User user)
+ {
+ _currentUser = user;
+ InitializeComponent();
+ CountClickText();
+ }
+
+ private void CountClickText()
+ {
+ if (_currentUser == null) return;
+ ClickCounts.Text = $"Click count: {_currentUser.Clicks}";
+ }
+ private void OpenScoreButton_OnClick(object? sender, RoutedEventArgs e)
+ {
+ if(_currentUser == null) return;
+ new Score().ShowDialog(this);
+ }
+
+ private void ImageButton_OnClick(object? sender, RoutedEventArgs e)
+ {
+ using var dbContext = new KidsAppDbContext();
+ if(_currentUser == null) return;
+ _currentUser.Clicks += 1;
+ dbContext.Update(_currentUser);
+ if(dbContext.SaveChanges() > 0) CountClickText();
+ }
+}
\ No newline at end of file
diff --git a/AppForKids/Program.cs b/AppForKids/Program.cs
new file mode 100644
index 0000000..17c8088
--- /dev/null
+++ b/AppForKids/Program.cs
@@ -0,0 +1,21 @@
+using Avalonia;
+using System;
+
+namespace AppForKids;
+
+class Program
+{
+ // Initialization code. Don't use any Avalonia, third-party APIs or any
+ // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
+ // yet and stuff might break.
+ [STAThread]
+ public static void Main(string[] args) => BuildAvaloniaApp()
+ .StartWithClassicDesktopLifetime(args);
+
+ // Avalonia configuration, don't remove; also used by visual designer.
+ public static AppBuilder BuildAvaloniaApp()
+ => AppBuilder.Configure()
+ .UsePlatformDetect()
+ .WithInterFont()
+ .LogToTrace();
+}
\ No newline at end of file
diff --git a/AppForKids/Registration.axaml b/AppForKids/Registration.axaml
new file mode 100644
index 0000000..f3397c4
--- /dev/null
+++ b/AppForKids/Registration.axaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AppForKids/Registration.axaml.cs b/AppForKids/Registration.axaml.cs
new file mode 100644
index 0000000..391ee07
--- /dev/null
+++ b/AppForKids/Registration.axaml.cs
@@ -0,0 +1,47 @@
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using AppForKids.models;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+
+namespace AppForKids;
+
+public partial class Registration : Window
+{
+ public Registration()
+ {
+ InitializeComponent();
+ }
+
+ private void RegisterClick_OnClick(object? sender, RoutedEventArgs e)
+ {
+ if(string.IsNullOrEmpty(LoginTextBox.Text)) return;
+ if(string.IsNullOrEmpty(PasswordTextBox.Text)) return;
+ using var dbContext = new KidsAppDbContext();
+ var user = new User {
+ Clicks = 0,
+ Name = LoginTextBox.Text,
+ Password = PasswordTextBox.Text };
+ dbContext.Users.Add(user);
+ if (dbContext.SaveChanges() > 0)
+ {
+ new MainWindow(user).Show();
+ Close();
+ }
+ }
+
+ private void LoginClick_OnClick(object? sender, RoutedEventArgs e)
+ {
+ using var dbContext = new KidsAppDbContext();
+ if(string.IsNullOrEmpty(LoginTextBox.Text)) return;
+ if(string.IsNullOrEmpty(PasswordTextBox.Text)) return;
+ var user = dbContext.Users.FirstOrDefault(it => it.Name == LoginTextBox.Text);
+ if(user == null) return;
+ if (user.Password != PasswordTextBox.Text) return;
+ new MainWindow(user).Show();
+ Close();
+ }
+}
\ No newline at end of file
diff --git a/AppForKids/Score.axaml b/AppForKids/Score.axaml
new file mode 100644
index 0000000..73184ca
--- /dev/null
+++ b/AppForKids/Score.axaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AppForKids/Score.axaml.cs b/AppForKids/Score.axaml.cs
new file mode 100644
index 0000000..9d5287b
--- /dev/null
+++ b/AppForKids/Score.axaml.cs
@@ -0,0 +1,21 @@
+using System.Collections.Generic;
+using System.Linq;
+using AppForKids.models;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+using Avalonia.Media;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Color = System.Drawing.Color;
+
+namespace AppForKids;
+
+public partial class Score : Window
+{
+ public Score()
+ {
+ InitializeComponent();
+ var dbContext = new KidsAppDbContext();
+ ScoreListBox.ItemsSource = dbContext.Users;
+ }
+}
\ No newline at end of file
diff --git a/AppForKids/app.manifest b/AppForKids/app.manifest
new file mode 100644
index 0000000..b8090ea
--- /dev/null
+++ b/AppForKids/app.manifest
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AppForKids/assets/dotnet-bot_branded.png b/AppForKids/assets/dotnet-bot_branded.png
new file mode 100644
index 0000000..7543069
Binary files /dev/null and b/AppForKids/assets/dotnet-bot_branded.png differ
diff --git a/AppForKids/models/KidsAppDbContext.cs b/AppForKids/models/KidsAppDbContext.cs
new file mode 100644
index 0000000..6d4dc2d
--- /dev/null
+++ b/AppForKids/models/KidsAppDbContext.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.EntityFrameworkCore;
+
+namespace AppForKids.models;
+
+public partial class KidsAppDbContext : DbContext
+{
+ public KidsAppDbContext()
+ {
+ }
+
+ public KidsAppDbContext(DbContextOptions options)
+ : base(options)
+ {
+ }
+
+ public virtual DbSet Users { get; set; }
+
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
+ => optionsBuilder.UseNpgsql("Host=localhost;Password=123;Database=kids_app_db;Port=5432;Username=postgres");
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.Id).HasName("users_pkey");
+
+ entity.ToTable("users");
+
+ entity.Property(e => e.Id).HasColumnName("id");
+ entity.Property(e => e.Clicks).HasColumnName("clicks");
+ entity.Property(e => e.Name).HasColumnName("name");
+ entity.Property(e => e.Password).HasColumnName("password");
+ entity.Property(e => e.Url).HasColumnName("url");
+ });
+
+ OnModelCreatingPartial(modelBuilder);
+ }
+
+ partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
+}
diff --git a/AppForKids/models/User.cs b/AppForKids/models/User.cs
new file mode 100644
index 0000000..10ea7fc
--- /dev/null
+++ b/AppForKids/models/User.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+
+namespace AppForKids.models;
+
+public partial class User
+{
+ public int Id { get; set; }
+
+ public string Name { get; set; } = null!;
+
+ public int Clicks { get; set; }
+
+ public string Password { get; set; } = null!;
+
+ public string? Url { get; set; }
+}