<commit_before>This page introduces the database design.

Role Collection
---------------
| name        | type   | default | max length | min length | required | unique | regex | description             |
|-------------|--------|---------|------------|------------|----------|--------|-------|-------------------------|
| name        | string |         | 80         |            |          | true   |       | name of the role        |
| description | string |         | 255        |            |          |        |       | description of the role |

User Collection
---------------
| name                 | type                          | default               | max length | min length | required | unique | regex | description                                          |
|----------------------|-------------------------------|-----------------------|------------|------------|----------|--------|-------|------------------------------------------------------|
| name                 | string                        |                       | 255        |            |          |        |       | display name of user                                 |
| email                | email                         |                       | 255        |            |          | true   |       | user email                                           |
| password             | string                        |                       | <PASSWORD>        |            |          |        |       | user password                                        |
| active               | boolean                       | true                  |            |            |          |        |       | user active or not                                   |
| confirm_at           | datetime                      |                       |            |            |          |        |       | time of user email confirmation                      |
| roles                | list (reference:Role)         | []                    |            |            |          |        |       | roles list of user                                   |
| last_login_at        | datetime                      |                       |            |            |          |        |       | last login time                                      |
| current_login_at     | datetime                      |                       |            |            |          |        |       | current login time                                   |
| last_login_ip        | string                        |                       | 255        |            |          |        |       | last login ip                                        |
| current_login_ip     | string                        |                       | 255        |            |          |        |       | current login ip                                     |
| login_count          | int                           |                       |            |            |          |        |       | login times count                                    |
| username             | string                        |                       | 50         |            | false    | true   |       | currently generated by name field                    |
| remember_token       | string                        |                       | 255        |            |          |        |       | remember login token                                 |
| authentication_token | string                        |                       | 255        |            |          |        |       | authentication token                                 |
| tagline              | string                        |                       | 255        |            |          |        |       | user short tagline                                   |
| bio                  | string                        |                       |            |            |          |        |       | user long self-introduction                          |
| links                | list (embedded: UserLink)     |                       |            |            |          |        |       | user social networking external links                |
| use_avatar_from      | string                        | gravatar              |            |            |          |        |       | choices between (gravatar, url, upload and facebook) |
| gravatar_email       | email                         |                       | 255        |            |          |        |       | for choice gravatar                                  |
| avatar_file_path     | string                        |                       |            |            |          |        |       | for choice upload                                    |
| avatar_url           | string                        |                       | 255        |            |          |        |       | for choice url                                       |
| teach_langs          | list (embedded: LanguageItem) | []                    |            |            |          |        |       | languages user teaches                               |
| learn_langs          | list (embedded: LanguageItem) | []                    |            |            |          |        |       | languages user learns                                |
| location             | embedded: Location            |                       |            |            |          |        |       | location type & location coordinate                  |
| place                | reference: Place              |                       |            |            |          |        |       | place document                                       |
| birthdate            | datetime                      |                       |            |            | true     |        |       | use birthdate to generate virtual property age       |
| gender               | string                        | unknown               |            |            | true     |        |       | choices between (male, female, unknown)              |
| settings             | embedded: UserSetting         | pre-configured object |            |            |          |        |       | user settings                                        |
| learn_points         | embedded: LearnPoint          | pre-configured object |            |            |          |        |       | user learn record                                    |
| nationality          | string                        |                       |            |            | true     |        |       | country name                                         |

Language Item
-------------
| name        | type     | default | max length | min length | required | unique | regex | description                      |
|-------------|----------|---------|------------|------------|----------|--------|-------|----------------------------------|
| language_id | objectId |         | 10         |            |          |        |       | abbrev name for display(e.g. EN) |
| level       | int      | 0       |            |            |          |        |       | language level                   |

Location
--------
| name        | type          | default | max length | min length | required | unique | regex | description                                                 |
|-------------|---------------|---------|------------|------------|----------|--------|-------|-------------------------------------------------------------|
| type        | string        | Point   |            |            |          |        |       | location type, choices between (Point, Polygon, LineString) |
| coordinates | list (double) | []      |            |            |          |        |       | an array of points                                          |

Place
-----
| name         | type                | default | max length | min length | required | unique | regex | description                 |
|--------------|---------------------|---------|------------|------------|----------|--------|-------|-----------------------------|
| country_code | string              |         | 5          |            | true     |        |       | country abbrev              |
| country      | string              |         | 50         |            | true     |        |       | country name                |
| place_type   | string              |         | 20         |            |          |        |       | choices between (city, ...) |
| location     | embedded: Location  |         |            |            |          |        |       | location embedded object    |
| full_name    | string              |         | 100        |            |          |        |       | place name, country name    |
| name         | string              |         | 50         |            |          |        |       | place name                  |

User Setting
------------<commit_msg>updated schema<commit_after>This page introduces the database design.

Role Collection
---------------
| name        | type   | default | max length | min length | required | unique | regex | description             |
|-------------|--------|---------|------------|------------|----------|--------|-------|-------------------------|
| name        | string |         | 80         |            |          | true   |       | name of the role        |
| description | string |         | 255        |            |          |        |       | description of the role |

User Collection
---------------
| name                 | type                          | default               | max length | min length | required | unique | regex | description                                          |
|----------------------|-------------------------------|-----------------------|------------|------------|----------|--------|-------|------------------------------------------------------|
| name                 | string                        |                       | 255        |            |          |        |       | display name of user                                 |
| email                | email                         |                       | 255        |            | true     | true   |       | user email                                           |
| password             | string                        |                       | 255        |            |          |        |       | user password                                        |
| active               | boolean                       | true                  |            |            |          |        |       | user active or not                                   |
| confirm_at           | datetime                      |                       |            |            |          |        |       | time of user email confirmation                      |
| roles                | list (reference:Role)         | []                    |            |            |          |        |       | roles list of user                                   |
| last_login_at        | datetime                      |                       |            |            |          |        |       | last login time                                      |
| current_login_at     | datetime                      |                       |            |            |          |        |       | current login time                                   |
| last_login_ip        | string                        |                       | 255        |            |          |        |       | last login ip                                        |
| current_login_ip     | string                        |                       | 255        |            |          |        |       | current login ip                                     |
| login_count          | int                           |                       |            |            |          |        |       | login times count                                    |
| username             | string                        |                       | 50         |            | false    | true   |       | currently generated by name field                    |
| remember_token       | string                        |                       | 255        |            |          |        |       | remember login token                                 |
| authentication_token | string                        |                       | 255        |            |          |        |       | authentication token                                 |
| tagline              | string                        |                       | 255        |            |          |        |       | user short tagline                                   |
| bio                  | string                        |                       |            |            |          |        |       | user long self-introduction                          |
| links                | list (embedded: UserLink)     |                       |            |            |          |        |       | user social networking external links                |
| use_avatar_from      | string                        | gravatar              |            |            |          |        |       | choices between (gravatar, url, upload and facebook) |
| gravatar_email       | email                         |                       | 255        |            |          |        |       | for choice gravatar                                  |
| avatar_file_path     | string                        |                       |            |            |          |        |       | for choice upload                                    |
| avatar_url           | string                        |                       | 255        |            |          |        |       | for choice url                                       |
| teach_langs          | list (embedded: LanguageItem) | []                    |            |            |          |        |       | languages user teaches                               |
| learn_langs          | list (embedded: LanguageItem) | []                    |            |            |          |        |       | languages user learns                                |
| location             | embedded: Location            |                       |            |            |          |        |       | location type & location coordinate                  |
| place                | reference: Place              |                       |            |            |          |        |       | place document                                       |
| birthdate            | datetime                      |                       |            |            | true     |        |       | use birthdate to generate virtual property age       |
| gender               | string                        | unknown               |            |            | true     |        |       | choices between (male, female, unknown)              |
| settings             | embedded: UserSetting         | pre-configured object |            |            |          |        |       | user settings                                        |
| learn_points         | embedded: LearnPoint          | pre-configured object |            |            |          |        |       | user learn record                                    |
| nationality          | string                        |                       |            |            | true     |        |       | country name                                         |

Language Item
-------------
| name        | type     | default | max length | min length | required | unique | regex | description                      |
|-------------|----------|---------|------------|------------|----------|--------|-------|----------------------------------|
| language_id | objectId |         | 10         |            | true     |        |       | abbrev name for display(e.g. EN) |
| level       | int      | 0       |            |            | true     |        |       | language level                   |

Location
--------
| name        | type          | default | max length | min length | required | unique | regex | description                                                 |
|-------------|---------------|---------|------------|------------|----------|--------|-------|-------------------------------------------------------------|
| type        | string        | Point   |            |            |          |        |       | location type, choices between (Point, Polygon, LineString) |
| coordinates | list (double) | []      |            |            |          |        |       | an array of points                                          |

Place
-----
| name         | type                | default | max length | min length | required | unique | regex | description                 |
|--------------|---------------------|---------|------------|------------|----------|--------|-------|-----------------------------|
| country_code | string              |         | 5          |            | true     |        |       | country abbrev              |
| country      | string              |         | 50         |            | true     |        |       | country name                |
| place_type   | string              | city    | 20         |            |          |        |       | choices between (city, region) |
| location     | embedded: Location  |         |            |            |          |        |       | location embedded object    |
| full_name    | string              |         | 100        |            |          |        |       | place name, country name    |
| name         | string              |         | 50         |            |          |        |       | place name                  |

User Setting
------------
{'fraction_non_alphanumeric': 0.14647337608028993, 'fraction_numerical': 0.005408419291887371, 'mean_word_length': 0.44145302579763723, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 310, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4577776', 'n_tokens_mistral': 3314, 'n_tokens_neox': 2977, 'n_words': 708}