Add core models, DTOs, and services for EchoHub chat application

- Created User, Channel, Message, and ServerInfo models with necessary properties.
- Added DTOs for user profiles, server information, and message handling.
- Implemented JWT authentication service for user login and token generation.
- Developed Entity Framework Core DbContext for database interactions.
- Introduced SignalR ChatHub for real-time messaging and presence tracking.
- Implemented file storage and image to ASCII conversion services.
- Set up CORS and middleware for API endpoints.
- Created launch settings and development configuration for server and web projects.
This commit is contained in:
HueByte
2026-02-18 13:52:19 +01:00
parent 20a341947a
commit cfa8b90d04
47 changed files with 4596 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
namespace EchoHub.Core.DTOs;
public record RegisterRequest(string Username, string Password, string? DisplayName = null);
public record LoginRequest(string Username, string Password);
public record LoginResponse(string Token, string Username, string? DisplayName, string? NicknameColor);
+31
View File
@@ -0,0 +1,31 @@
using EchoHub.Core.Models;
namespace EchoHub.Core.DTOs;
public record MessageDto(
Guid Id,
string Content,
string SenderUsername,
string? SenderNicknameColor,
string ChannelName,
MessageType Type,
string? AttachmentUrl,
string? AttachmentFileName,
DateTimeOffset SentAt);
public record ChannelDto(
Guid Id,
string Name,
string? Topic,
int MessageCount,
DateTimeOffset CreatedAt);
public record UserDto(
Guid Id,
string Username,
string? DisplayName,
string? NicknameColor,
UserStatus Status,
DateTimeOffset LastSeenAt);
public record SendMessageRequest(string ChannelName, string Content);
+31
View File
@@ -0,0 +1,31 @@
using EchoHub.Core.Models;
namespace EchoHub.Core.DTOs;
public record UserProfileDto(
Guid Id,
string Username,
string? DisplayName,
string? Bio,
string? NicknameColor,
string? AvatarAscii,
UserStatus Status,
string? StatusMessage,
DateTimeOffset CreatedAt,
DateTimeOffset LastSeenAt);
public record UpdateProfileRequest(
string? DisplayName = null,
string? Bio = null,
string? NicknameColor = null);
public record UpdateStatusRequest(
UserStatus Status,
string? StatusMessage = null);
public record UserPresenceDto(
string Username,
string? DisplayName,
string? NicknameColor,
UserStatus Status,
string? StatusMessage);
+15
View File
@@ -0,0 +1,15 @@
namespace EchoHub.Core.DTOs;
public record ServerInfoDto(
Guid Id,
string Name,
string? Description,
string Url,
int OnlineUsers,
int TotalChannels,
bool IsOnline,
DateTimeOffset LastPingAt);
public record RegisterServerRequest(string Name, string Url, string? Description = null);
public record ServerStatusDto(string Name, string? Description, int OnlineUsers, int TotalChannels);