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

Update/lynx auth - Otp component added #71

Open
wants to merge 2 commits into
base: integ
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions database/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,64 @@ const CertificateType = sequelize.define(
}
);

const Admin = sequelize.define(
"admin",
{
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
},

sign: {
type: DataTypes.BLOB,
},
otp: {
type: DataTypes.STRING,
allowNull: true,
}
},
{
freezeTableName: true,
}
);
const Student = sequelize.define(
"student",
{
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
},
department: {
type: DataTypes.STRING,
allowNull: true,
},
course: {
type: DataTypes.STRING,
allowNull: true,
},

photo: {
type: DataTypes.BLOB,
},
},
{
freezeTableName: true,
}
);


const Certificate = sequelize.define(
"certificates",
{
Expand Down Expand Up @@ -124,6 +182,38 @@ const Certificate = sequelize.define(
type: DataTypes.STRING,
allowNull: true,
},
photo: {
type: DataTypes.BLOB,
allowNull: true,
},
fname: {
type: DataTypes.STRING,
allowNull: true,
},
dob: {
type: DataTypes.STRING,
allowNull: true,
},
stayDate: {
type: DataTypes.STRING,
allowNull: true,
},
year: {
type: DataTypes.INTEGER,
allowNull: true
},
semester: {
type: DataTypes.INTEGER,
allowNull: true
},
department: {
type: DataTypes.STRING,
allowNull: true,
},
course: {
type: DataTypes.STRING,
allowNull: true,
},
},
{
freezeTableName: true,
Expand Down Expand Up @@ -312,4 +402,6 @@ module.exports = {
Alumni,
RankGradeCard,
test_conn,
Admin,
Student,
};
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@ const { exit } = require("process");
app.use(cors());
app.use(express.json());
// app.use(morgan('dev'));
app.use(express.static("public/build"));
// app.use(express.static("public/build"));

app.use("/api", apiRouter);
app.use("/login", loginRouter);
app.use("/alumni", alumniRouter);


app.use(function (req, res) {
res.sendFile("public/build/index.html", { root: __dirname });
});
// app.use(function (req, res) {
// res.sendFile("public/build/index.html", { root: __dirname });
// });

try {
fs.mkdirSync(__dirname + "/temp");
fs.mkdirSync(__dirname + "/uploads");
fs.mkdirSync(__dirname + "/sign");
} catch (err) {
// catch all errors ectory already exist (EEXIST)
if (err.code !== "EEXIST") {
Expand Down
Loading