This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from hacettepeoyt/db-integration
Halfway Database Integration
- Loading branch information
Showing
13 changed files
with
580 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
const mongoose = require("mongoose"); | ||
const Schema = mongoose.Schema; | ||
|
||
// TODO add default images for projects, courses and events. | ||
|
||
const faqSchema = new Schema({ | ||
question: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
answer: { | ||
type: String, | ||
required: true | ||
} | ||
}); | ||
|
||
const projectSchema = new Schema({ | ||
img: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
name: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
description: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
status: { | ||
type: Number, | ||
min: 0, | ||
max: 100, | ||
default: 0 | ||
}, | ||
|
||
repository: { | ||
type: String, | ||
required: true | ||
} | ||
}); | ||
|
||
const courseSchema = new Schema({ | ||
img: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
name: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
description: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
preRequisite: { | ||
type: Array, | ||
default: [] | ||
}, | ||
|
||
location: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
time: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
date: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
duration: { // 8 hafta, 3 gün, 4 ay... | ||
type: String, | ||
required: true | ||
} | ||
}); | ||
|
||
const eventSchema = new Schema({ | ||
img: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
name: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
description: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
location: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
time: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
date: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
duration: { | ||
type: String, | ||
required: true | ||
} | ||
}); | ||
|
||
const Faq = mongoose.model('Faq', faqSchema); | ||
const Project = mongoose.model('Project', projectSchema); | ||
const Course = mongoose.model('Course', courseSchema); | ||
const Event = mongoose.model('Event', eventSchema); | ||
|
||
module.exports = { | ||
Faq, | ||
Project, | ||
Course, | ||
Event | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const mongoose = require("mongoose"); | ||
|
||
|
||
const memberSchema = mongoose.Schema({ | ||
firstName: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
lastName: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
studentID: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
email: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
department: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
mobileNumber: { | ||
type: String, | ||
required: true | ||
}, | ||
|
||
groupChat: { | ||
type: Boolean, | ||
required: true | ||
} | ||
}) | ||
|
||
const Member = mongoose.model('Member', memberSchema); | ||
|
||
module.exports = Member; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.