Is your feature request related to a problem? Please describe.
Before we write any endpoints dealing with creating languages or collecting language data, we need to define schemas for any data related to languages. Schemas are JSON objects that defines the the structure and contents of your data.
Describe the solution you'd like
We will need to define a couple of schemas:
Schema 1: Course
Description: The data for a course for a specific endangered language. This will have a one-to-many relationship with the User model.
Fields:
approved
Type: Boolean
Required: True
admin_id
Type: String
Required: True
details:
Type: CourseDetails
Required: True
privacy_level:
Type: Integer, Public (0) or Private (1) - can use another enum here
Required: True
hashed_password:
Type: String
Required: False
salt:
Type: String,
Required: False
Schema 1.5: Course Details
Fields:
language_name:
Type: String
Required: False,
Default: ""
language_description:
Type: String
Required: False,
Default: ""
population_size:
Type: Integer
Required: False,
Default: ""
Schema 2: Unit
Fields:
_course_id:
Type: String
Required: True
name:
Type: String
Required: True
order:
Type: Integer
Required: True
selected:
Type: Boolean
Required: True
Schema 3: Lesson
Fields:
_course_id:
Type: String
Required: True
_unit_id:
Type: String
Required: True
name:
Type: String
Required: True
order:
Type: Integer
Required: True
selected:
Type: Boolean
Required: True
vocab:
Type: Vocab:
Required: True
Default: []
Schema 4: Vocab
Description: A word/phrase in an endangered language.
Fields:
order:
Type: Int
Required: True
original:
Type: String
Required: True
translation:
Type: String
Required: True
image
Type: String
Required: False
Default: ""
audio
Type: String
Required: False
Default: ""
We can define these schemas in api/src/models in a file called language.js. In the end, it should look similar to the code in home.js. This past H4I project also has good examples on how to code this.
@nroy20 @jessicasingh7 I've updated this issue with three more fields underneath the Course Schema: privacy_level, hashed_password, and salt. Please add those as well :)
Is your feature request related to a problem? Please describe.
Before we write any endpoints dealing with creating languages or collecting language data, we need to define schemas for any data related to languages. Schemas are JSON objects that defines the the structure and contents of your data.
Describe the solution you'd like
We will need to define a couple of schemas:
Schema 1: Course
Description: The data for a course for a specific endangered language. This will have a one-to-many relationship with the User model. Fields:
Schema 1.5: Course Details
Fields:
Schema 2: Unit
Fields:
Schema 3: Lesson
Fields:
Schema 4: Vocab
Description: A word/phrase in an endangered language. Fields:
We can define these schemas in
api/src/models
in a file calledlanguage.js
. In the end, it should look similar to the code inhome.js
. This past H4I project also has good examples on how to code this.