Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoumayaLabbene-assignment2 #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions backend/models/categoryModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const mongoose = require('mongoose');


const categorySchema = new mongoose.Schema({

name: String,

user_id: {
type: mongoose.Schema.Types.ObjectId,
ref: 'users'
},
createdAt: {
type: Date,
default: Date.now()

},
updatedAt: {
type: Date,
default: Date.now()
}
});


const category = mongoose.model('category', categorySchema);

module.exports= category;
15 changes: 15 additions & 0 deletions backend/models/itemModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const mongoose = require('mongoose');

const itemSchema = new mongoose.Schema({
name: String,
category_id: {
type: mongoose.Schema.Types.ObjectId,
ref: 'categories'
},
note: String,
image: String
});

const item = mongoose.model('item', itemSchema);

module.exports= item;
30 changes: 30 additions & 0 deletions backend/models/listModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const mongoose = require('mongoose');

const listSchema = new mongoose.Schema({

name: String,
user_id: {
type: mongoose.Schema.Types.ObjectId,
ref: 'users'
},
createdAt: {
type: Date,
default: Date.now()

},
updatedAt: {
type: Date,
default: Date.now()
},

items: {

type: Array,
}


});

const list = mongoose.model('list', listSchema);

module.exports= list;
12 changes: 12 additions & 0 deletions backend/models/userModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const mongoose = require('mongoose');

const userSchema = new mongoose.Schema({
username: String,
email: String,
password: String
});

const user = mongoose.model('user', userSchema);

module.exports= user;

15 changes: 15 additions & 0 deletions backend/node_modules/.bin/detect-libc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/detect-libc.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions backend/node_modules/.bin/detect-libc.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions backend/node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/mime.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions backend/node_modules/.bin/mime.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions backend/node_modules/.bin/mkdirp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/mkdirp.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions backend/node_modules/.bin/mkdirp.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions backend/node_modules/.bin/node-pre-gyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/node-pre-gyp.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions backend/node_modules/.bin/node-pre-gyp.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions backend/node_modules/.bin/nopt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/nopt.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions backend/node_modules/.bin/nopt.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions backend/node_modules/.bin/rimraf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/rimraf.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading