diff --git a/models/User.js b/models/User.js new file mode 100644 index 0000000..4bee366 --- /dev/null +++ b/models/User.js @@ -0,0 +1,34 @@ +const mongoose = require('mongoose'); + +const UserSchema = new mongoose.Schema({ + username: { // The name of the user + type: String, + required: true, + unique: true, + minLength: 5, + maxLength: 15 + }, + email: { // The email of the user + type: String, + required: true + }, + password: { // The password of the user + type: String, + required: true + }, + rank: { // The rank of the user + type: String, + default: "user" + }, + info: { // Some information about the user + type: String, + default: "No information provided" + }, + socials: Object, // The socials of the user (ex. twitter, github, ..) + joined: { // The date when the user has joined the platform + type: Date, + default: Date.now + } +}); + +module.exports = mongoose.model('users', UserSchema); \ No newline at end of file