You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Entity Relationship Diagram.md
+9-21Lines changed: 9 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,36 +1,27 @@
1
1
# Entity Relationship Diagram
2
2
3
-
Here are the entity relationship diagrams for the Viraha project. The diagrams are created using the [Mermaid](https://mermaid-js.github.io/mermaid/#/) library.
3
+
Here are the entity relationship diagrams for the Vidya project. The diagrams are created using the [Mermaid](https://mermaid-js.github.io/mermaid/#/) library.
4
4
5
-
## Organization and Permission Management
5
+
## School and Permission Management
6
6
7
-
*Organization* is the top-level entity that represents a company. Each organization can have multiple schools. For example "Bhaktilata" and "Archana" can be two schools under the same organization "Prabhupada School".
7
+
*School* is the top-level entity representing an educational institution. Each school can have multiple *Courses*, *Groups*, and other related entities.
8
8
9
-
*School* is a sub-entity of Organization. School belongs to one organization. Each school can have multiple *Courses***Groups* and so on.
9
+
*Role* is a set of permissions that can be assigned to a user. Each role can have multiple permissions, for example: "create courses", "create groups", "edit lessons" etc. Roles can be defined at the school level. Users can have multiple roles in different schools.
10
10
11
-
*Role* is a set of permissions that can be assigned to a user. Each role can have multiple permissions, for example: "create coures", "create groups", "edit lessons" etc. Roles can be defined at the organization level or at the school level. Roles can be assigned to users. A user can have multiple roles. For example, a user can have a "teacher" role in one school and a "student" role in another school.
12
-
13
-
*User* is a person who can log in to the system. A user can be assigned to one or more roles. A user can be a member of one or more schools. A user can have different roles in different schools.
11
+
*User* is a person who can log in to the system. A user can be assigned to one or more roles and can be a member of one or more schools.
14
12
15
13
```mermaid
16
14
erDiagram
17
-
Organization {
18
-
uuid id PK
19
-
string name
20
-
}
21
-
22
15
School {
23
16
uuid id PK
24
17
string name
25
-
string organizationId FK
26
18
}
27
19
28
20
Role {
29
21
uuid id PK
30
22
string name
31
23
string description
32
-
string organizationId
33
-
opt[string] schoolId
24
+
string schoolId FK
34
25
string[] permissions
35
26
}
36
27
@@ -42,19 +33,15 @@ erDiagram
42
33
string avatarUrl
43
34
}
44
35
45
-
46
36
UserRole {
47
37
uuid id PK
48
38
string userId FK
49
39
string roleId FK
50
40
}
51
41
52
-
Organization ||--o{ School : ""
53
-
Organization ||--o{ Role : ""
54
42
School ||--o{ Role : ""
55
43
User }o--o{ UserRole : ""
56
44
Role }o--o{ UserRole : ""
57
-
58
45
```
59
46
60
47
## School Management
@@ -63,9 +50,9 @@ erDiagram
63
50
64
51
*Group* is a set of students who are studying the same course. Each *Course* can have multiple *Groups*.
65
52
66
-
*Lession* is a part of a course. Each course can have multiple lessons. For example, "Chapter 1", "Chapter 2" etc can be lessons in the "Bhagavad Gita" course. Each lesson can have a title and content.
53
+
*Lesson* is a part of a course. Each course can have multiple lessons. For example, "Chapter 1", "Chapter 2" etc., can be lessons in the "Bhagavad Gita" course. Each lesson can have a title and content.
67
54
68
-
*Enrollment* is a record that links a user to a group and a rele. Each enrollment can have a status like "active", "inactive", "graduated" etc. Each enrollment can have a number of lessons opened.
55
+
*Enrollment* is a record that links a user to a group and a role. Each enrollment can have a status like "active", "inactive", "graduated", etc. Each enrollment can have a number of lessons opened.
0 commit comments