Added files of the Todo app

This commit is contained in:
Diven2510
2025-12-30 19:37:10 +05:30
parent 387812c33e
commit bab99095d7
31 changed files with 6803 additions and 0 deletions

37
Backend/models/Todo.js Normal file
View File

@@ -0,0 +1,37 @@
import mongoose from 'mongoose';
const todoSchema = new mongoose.Schema({
title: {
type: String,
required: true,
trim: true,
maxlength: 200
},
description: {
type: String,
trim: true,
maxlength: 1000
},
completed: {
type: Boolean,
default: false
},
priority: {
type: String,
enum: ['low', 'medium', 'high'],
default: 'medium'
},
dueDate: {
type: Date,
required: true
},
userId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true
}
}, {
timestamps: true
});
export default mongoose.model('Todo', todoSchema);