To develop a queue system that can be used for educational purposes or for any other situations where prioritization of individuals is necessary.
- All Ids which goes out of the server/application has to be encoded in hashids.
- All Ids which comes into the server/application has to be decoded in hashids.
- Relevant tests should be written when adding new functionalities.
-
SQL as the choice of Database
-
Data models
public class User{ [Id] [Email] public string Email { get; set; } [MaxLength(20)] public string NickName { get; set; } public byte[] PasswordHash { get; set; } public byte[] PasswordSalt { get; set; } public virtual ICollection<Room> Rooms { get; set; } }
public class Room{ public Guid Id { get; set; } [MaxLength(20)] public string Name { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime ExpireAt { get; set; } = DateTime.UtcNow.AddHours(12); public virtual User Owner { get; set; } public virtual ICollection<Participant> Participators { get; set; } }
public class Paricipant{ public Guid Id { get; set; } [MaxLength(20)] public string NickName { get; set; } public DateTime StatusDate { get; set; } = DateTime.UtcNow; public Status Status { get; set; } = Status.Idling; public virtual Room Room { get; set; } }
public enum Status{ Idling, Waiting, Ongoing, }
| Waiting | Needs help |
|---|---|
| 🪐 Jupiter | 🌞 Sun |
- Achiving clean architecture by:
- Interface segregation principle
- Single responsibility principle
- Open-closed principle
- Common closure principle
- Dependency Inversion principle
- REPR Design Pattern (Request-Endpoint-Response)
- We use FastEndpoints to achive this pattern.
- Unit of Work with Repository Pattern
-
Id for users/non server business:
-
FastEndpoints creation