Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
37d751d
Extracted a material container
Nailsonseat Feb 20, 2024
bca3b8d
Removed accidental package lock
Nailsonseat Feb 20, 2024
f04a86e
Formatted and removed wrong message usage
Nailsonseat Feb 20, 2024
6b27468
delete and put method in course resource
Nailsonseat Feb 20, 2024
3b3f913
get and post method in course list resource
Nailsonseat Feb 20, 2024
beaa4e8
removed usage of Mongo client and use mongoose only
Nailsonseat Feb 20, 2024
83446b6
defined schema for otp
Nailsonseat Feb 20, 2024
a082b9b
update course schema
Nailsonseat Feb 20, 2024
fb7ef94
update faculty schema
Nailsonseat Feb 20, 2024
9261964
formatted student schema
Nailsonseat Feb 20, 2024
0fa2fe9
corrected create faculty with entire body and not email
Nailsonseat Feb 20, 2024
2eb0fbf
added delete method for room resource
Nailsonseat Feb 20, 2024
784dc7e
removed resundant code
Nailsonseat Feb 20, 2024
42ca67f
added new course resources
Nailsonseat Feb 20, 2024
861ab7b
Added fields for credits, primary room and branch multi selector
Nailsonseat Feb 20, 2024
c32fe59
Linked courses to backend and new logic for new fields
Nailsonseat Feb 20, 2024
5071be8
Updated schema course.dart
Nailsonseat Feb 20, 2024
5cf6ddc
Updated get courses and delete course in course repo
Nailsonseat Feb 20, 2024
0f54c10
Updated dummy entries
Nailsonseat Feb 20, 2024
c1fcf28
Added field for cabin, department and courses taught
Nailsonseat Feb 20, 2024
3704ff8
Removed old fields, will add in future
Nailsonseat Feb 20, 2024
7da717b
Extracted multiple choice selector component
Nailsonseat Feb 21, 2024
927090a
Added add functionality to the current choice selector component
Nailsonseat Feb 21, 2024
6292e17
Update components with changes in mess menu
Nailsonseat Feb 21, 2024
bba3220
Use auth state only when needed and don't store in provider
Nailsonseat Feb 21, 2024
6a38e71
Added case when otp verification is failed
Nailsonseat Feb 21, 2024
d968375
Updated faculty repo methods
Nailsonseat Feb 21, 2024
54c972a
Load faculty method
Nailsonseat Feb 21, 2024
16070fc
Add and remove faculty method
Nailsonseat Feb 21, 2024
c7853ce
Load faculties in constructor and added new fields controllers
Nailsonseat Feb 21, 2024
9a09c57
Updated faculty schema
Nailsonseat Feb 21, 2024
593fe6d
Not load auth state in constructor but everytime a stateful function …
Nailsonseat Feb 21, 2024
6864eae
Editable role and branches dropdown and ass and remove student methods
Nailsonseat Feb 21, 2024
3a54d78
Updated return types for student repo methods
Nailsonseat Feb 21, 2024
e023593
Update student schema
Nailsonseat Feb 21, 2024
af55093
Added new student fields and load students
Nailsonseat Feb 21, 2024
186eb58
Build rooms tiles on the page widget itself
Nailsonseat Feb 21, 2024
fab2802
Updated views and repos
Nailsonseat Feb 21, 2024
cb3879b
Added faculty profile page
Nailsonseat Feb 21, 2024
9e99d5b
Removed unused imports
Nailsonseat Feb 21, 2024
23cf987
Fixed import
Nailsonseat Feb 21, 2024
0ec118c
Reload on add course
Nailsonseat Feb 21, 2024
b74d28a
Major bug fix on uploading image which is listing type is found in lo…
Nailsonseat Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import timetableListResource from "./resources/timetable/timetableListResource.j
import timetableResource from "./resources/timetable/timetableResource.js";
import messMenuListResource from "./resources/messMenu/messMenuListResource.js";
import messMenuResource from "./resources/messMenu/messMenuResource.js";
import courseListResource from "./resources/course/courseListResource.js";
import courseResource from "./resources/course/courseResource.js";

const PORT = `${process.env.PORT || 3000}`;
const app = express();
Expand All @@ -39,6 +41,9 @@ app.use("/student", studentResource);
app.use("/students", studentListResource);
app.use("/faculty", facultyResource);
app.use("/faculties", facultyListResource);
app.use("/courses", courseListResource);
app.use("/course", courseResource);

app.use("/timetable", timetableResource);
app.use("/timetables", timetableListResource);
app.use("/mess-menu", messMenuResource);
Expand Down
29 changes: 14 additions & 15 deletions backend/database/db.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import mongoose from 'mongoose'
import dotenv from 'dotenv'
import mongoose from "mongoose";
import dotenv from "dotenv";

// Add a .env file to the root to access the mongoDB credentials
dotenv.config();

const Connection = () => {
mongoose.connect(process.env.MONGODB_URI);
mongoose.connect(process.env.MONGODB_URI);
mongoose.connection.on("connected", () => {
console.log("Database connected Successfully");
});

mongoose.connection.on('connected', () => {
console.log('Database connected Successfully');
})
mongoose.connection.on("disconnected", () => {
console.log("Database disconnected");
});

mongoose.connection.on('disconnected', () => {
console.log('Database disconnected');
})
mongoose.connection.on("error", () => {
console.log("Error while connecting with the database");
});
};

mongoose.connection.on('error', () => {
console.log('Error while connecting with the database ', error.message);
})
}

export default Connection;
export default Connection;
50 changes: 23 additions & 27 deletions backend/models/course.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
import mongoose from 'mongoose';
import mongoose from "mongoose";

const courseSchema = new mongoose.Schema({
name: {
type: String,
required: true
name: {
type: String,
required: true,
},
courseCode: {
type: String,
required: true,
unique: true,
},
primaryRoom: {
type: String,
},
credits: {
type: Number,
required: true,
},
branches: [
{
type: String,
},
courseCode: {
type: String,
required: true,
unique: true
},
primaryRoom: {
type: String,
},
credits: {
type: Number,
required: true,
},
professorId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Faculty',
required: true,
},
branches: [{
type: String,
required: true
}]
],
});

const Course = mongoose.model('Course', courseSchema);
const Course = mongoose.model("Course", courseSchema);

export default Course;
export default Course;
45 changes: 23 additions & 22 deletions backend/models/faculty.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
import mongoose from 'mongoose';
import mongoose from "mongoose";

const facultySchema = new mongoose.Schema({
name: {
type: String,
default: 'Smart Insti User'
name: {
type: String,
required: true,
},
email: {
type: String,
required: true,
unique: true,
},
cabinNumber: {
type: String,
},
department: {
type: String,
},
courses: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "Course",
},
email: {
type: String,
required: true,
unique: true
},
cabinNumber: {
type: String,
},
department: {
type: String,
},
courses: [{
type: mongoose.Schema.Types.ObjectId,
ref: 'Course'
}],

],
});

const Faculty = mongoose.model('Faculty', facultySchema);
export default Faculty;
const Faculty = mongoose.model("Faculty", facultySchema);
export default Faculty;
20 changes: 20 additions & 0 deletions backend/models/otp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import mongoose from "mongoose";

const otpSchema = new mongoose.Schema({
email: {
type: String,
required: true,
},
otp: {
type: String,
required: true,
},
createdAt: {
type: Date,
required: true,
},
});

const OTP = mongoose.model("OTP", otpSchema);

export default OTP;
71 changes: 37 additions & 34 deletions backend/models/student.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
import mongoose from 'mongoose';
import mongoose from "mongoose";
const studentSchema = new mongoose.Schema({
name: {
type: String,
default: 'Smart Insti User'
name: {
type: String,
},
email: {
type: String,
required: true,
},
rollNumber: {
type: String,
},
about: {
type: String,
},
profilePicURI: {
type: String,
},
branch: {
type: String,
},
graduationYear: {
type: Number,
},
skills: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "Skill",
},
email: {
type: String,
required: true
],
achievements: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "Achievement",
},
rollNumber: {
type: String,
},
about: {
type: String,
},
profilePicURI: {
type: String,
},
branch: {
type: String,
},
graduationYear: {
type: Number,
},
skills: [{
type: mongoose.Schema.Types.ObjectId,
ref: 'Skill'
}],
achievements: [{
type: mongoose.Schema.Types.ObjectId,
ref: 'Achievement'
}],
roles: {
type: [String],
}
],
roles: {
type: [String],
},
});

const Student = mongoose.model('Student', studentSchema);
const Student = mongoose.model("Student", studentSchema);

export default Student;
Loading