Skip to content

allanma88/chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Architecture

This project is not a fully functional project, only implement the features of assignment, lack of some important parts, like authentication, authorization, UI.

Extensions

The extension for the start up of program, we currently only defined the user and signalr extension. For a real product, should contains more extension like log, graceful shutdown, monitor

Controllers

the web layer, only contains the web related logic, like api implementation and signin

Hubs

the hub layer, only contains the message related logic

Services

the business layer, the actually implemenation, mainly interacting with the database

Database

the db layer, define the context and db model

Model

the model for service and web layer

How to run

  • config the project properly in the appsettings.Development.json file
  • run dotnet ef database update at the src/Chat.Server folder to apply the database migration
  • run the src\Chat.Server

User Management

For demo purpose, I didn't use the Microsoft Identity framework, it's complex and if use the Microsoft Identity framework, there is no need to implement the User register and login API.

Register

POST https://127.0.0.1:7291/api/users/register

{
    "name": "User Name",
    "email": "Email",
    "password": "Password"
}

Password requirement: at least 8 length, must contains the upper case letter, lower case letter, digit, non alpha numeric letter

Login

POST https://127.0.0.1:7291/api/users/login

{
    "email": "email",
    "password": "password"
}

Message Management

https://127.0.0.1:7291/api/messages/send

{
    "sender": "service1",
    "recipient": "[email protected]",
    "timestamp": "2024-08-30T10:00:00",
    "content": "hello"
}
  • the Chat.Client will receive the message

Basic Real-time Message Pushing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published