-
Notifications
You must be signed in to change notification settings - Fork 2
Planning
Fabian Aronsson edited this page May 14, 2023
·
7 revisions
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 { [Key] 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 int 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, }
├── server
│ ├── FirstEndpoint
│ │ ├── Request.cs
│ │ ├── Response.cs
│ │ ├── Endpoint.cs
│ │ ├── Mapper.cs
│ │ ├── Validator.cs
│ ├── SecondEndpoint
│ │ ├── Request.cs
│ │ ├── Response.cs
│ │ ├── Endpoint.cs
│ │ ├── Mapper.cs
│ │ ├── Validator.cs
│ ├── Program.cs| Waiting | Needs help |
|---|---|
| 🪐 Jupiter | 🌞 Sun |
- Achieving 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 achieve this pattern.
- Unit of Work with Repository Pattern
-
Id for users/non server business:
-
FastEndpoints creation