-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1ceccff
Showing
59 changed files
with
11,603 additions
and
0 deletions.
There are no files selected for viewing
Submodule client
added at
5bf7df
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,35 @@ | ||
<main class="h-screen w-full flex flex-col justify-center items-center bg-[#1A2238]"> | ||
<h1 class="text-9xl font-extrabold text-white tracking-widest">404</h1> | ||
<div class="bg-[#FF6A3D] px-2 text-sm rounded rotate-12 absolute"> | ||
Page Not Found | ||
</div> | ||
<button class="mt-5"> | ||
<a | ||
class="relative inline-block text-sm font-medium text-[#FF6A3D] group active:text-orange-500 focus:outline-none focus:ring" | ||
> | ||
<span | ||
class="absolute inset-0 transition-transform translate-x-0.5 translate-y-0.5 bg-[#FF6A3D] group-hover:translate-y-0 group-hover:translate-x-0" | ||
></span> | ||
|
||
<span class="relative block px-8 py-3 bg-[#1A2238] border border-current"> | ||
<router-link to="/">Go Home</router-link> | ||
</span> | ||
</a> | ||
</button> | ||
</main> | ||
https://www.youtube.com/watch?v=YOGgaYUW1OA | ||
1.5 liter, 1 liter, 500 ml, 300 ml | ||
|
||
<div className='fixed left-0 bottom-0 ml-5 mb-5'> | ||
<label htmlFor="my-modal" className="btn">view cart</label> | ||
<input type="checkbox" id="my-modal" className="modal-toggle" /> | ||
<div className="modal"> | ||
<div className="modal-box"> | ||
<h3 className="font-bold text-lg">Congratulations random Internet user!</h3> | ||
<p className="py-4">You've been selected for a chance to get one year of subscription to use Wikipedia for free!</p> | ||
<div className="modal-action"> | ||
<label htmlFor="my-modal" className="btn">Yay!</label> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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 @@ | ||
node_modules |
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,23 @@ | ||
{ | ||
"development": { | ||
"username": "root", | ||
"password": "hamda1234", | ||
"database": "waterzilla_database", | ||
"host": "127.0.0.1", | ||
"dialect": "mysql" | ||
}, | ||
"test": { | ||
"username": "root", | ||
"password": null, | ||
"database": "database_test", | ||
"host": "127.0.0.1", | ||
"dialect": "mysql" | ||
}, | ||
"production": { | ||
"username": "root", | ||
"password": null, | ||
"database": "database_production", | ||
"host": "127.0.0.1", | ||
"dialect": "mysql" | ||
} | ||
} |
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,36 @@ | ||
const express= require('express'); | ||
const app= express(); | ||
const db= require("./models"); | ||
const cors= require("cors"); | ||
const admin= require('./routes/Admin'); | ||
const waterbottle= require('./routes/Waterbottle'); | ||
const company=require('./routes/Company') | ||
const pages=require('./routes/Pages') | ||
const notifications=require('./routes/Notifications') | ||
const orders=require('./routes/Orders') | ||
const customers=require('./routes/Customers') | ||
const reports=require('./routes/Reports') | ||
const cart=require('./routes/Cart') | ||
const reviews=require('./routes/Reviews') | ||
|
||
app.use(cors()); | ||
app.use(express.json()); | ||
app.use(express.urlencoded({extended:true})); | ||
|
||
app.use('/admin',admin); | ||
app.use('/checkout',cart); | ||
app.use('/reviews',reviews); | ||
app.use('/admin/dashboard/waterbottle',waterbottle); | ||
app.use('/admin/dashboard/company',company); | ||
app.use('/admin/dashboard/pages',pages); | ||
app.use('/admin/dashboard/notifications',notifications); | ||
app.use('/admin/dashboard/orders',orders); | ||
app.use('/admin/dashboard/customers',customers); | ||
app.use('/admin/dashboard/reports',reports); | ||
|
||
|
||
db.sequelize.sync().then(()=>{ | ||
app.listen(8080, ()=>{ | ||
console.log("Server is listening on port 8080"); | ||
}) | ||
}) |
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,19 @@ | ||
const {verify}= require("jsonwebtoken"); | ||
|
||
const validateToken=(req,res,next)=>{ | ||
const accessToken= req.header("accessToken"); | ||
if(!accessToken){ | ||
return res.json({error:"ADMIN NOT LOGGED IN !!!"}) | ||
} | ||
try { | ||
const validToken= verify(accessToken,"secret1234"); | ||
req.user= validToken; | ||
if(validToken){ | ||
return next(); | ||
} | ||
} catch (error) { | ||
return res.json({error:error}) | ||
} | ||
} | ||
|
||
module.exports = {validateToken}; |
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,13 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Account= sequelize.define("Account", { | ||
username:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
password:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
return Account; | ||
} |
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,24 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Address= sequelize.define("Address", { | ||
houseNo:{ | ||
type: DataTypes.INTEGER, | ||
allowNull:false | ||
}, | ||
streetNo:{ | ||
type: DataTypes.INTEGER, | ||
allowNull:false | ||
}, | ||
city:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
zipCode:{ | ||
type: DataTypes.INTEGER, | ||
allowNull:false | ||
} | ||
}); | ||
Address.associate=(models)=>{ | ||
Address.hasMany(models.Orders); | ||
}; | ||
return Address; | ||
} |
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,18 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Admin= sequelize.define("Admin",{ | ||
role:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
Admin.associate=(models)=>{ | ||
Admin.hasOne(models.Website,{ | ||
onDelete:"cascade", | ||
}); | ||
Admin.hasMany(models.Notifications,{ | ||
onDelete:"cascade", | ||
}); | ||
Admin.belongsTo(models.Users); | ||
}; | ||
return Admin; | ||
} |
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,30 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Bottle= sequelize.define("Bottle", { | ||
name:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
quantity:{ | ||
type: DataTypes.INTEGER, | ||
allowNull:false | ||
}, | ||
price:{ | ||
type: DataTypes.INTEGER, | ||
allowNull:false | ||
}, | ||
size:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
image:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
Bottle.associate=(models)=>{ | ||
Bottle.belongsTo(models.Company); | ||
Bottle.hasMany(models.Orders); | ||
Bottle.hasMany(models.Reviews); | ||
}; | ||
return Bottle; | ||
} |
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,8 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Cart= sequelize.define("Cart"); | ||
Cart.associate=(models)=>{ | ||
Cart.belongsTo(models.Customer); | ||
Cart.hasMany(models.Bottle); | ||
}; | ||
return Cart; | ||
} |
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,18 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Company= sequelize.define("Company", { | ||
name:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
logo:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
Company.associate=(models)=>{ | ||
Company.hasOne(models.Bottle,{ | ||
onDelete:"cascade", | ||
}); | ||
}; | ||
return Company; | ||
} |
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,27 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Customer= sequelize.define("Customer", { | ||
name:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
profilePic:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
Customer.associate=(models)=>{ | ||
Customer.hasMany(models.Orders,{ | ||
onDelete:"cascade", | ||
}); | ||
Customer.hasMany(models.Reviews,{ | ||
onDelete:"cascade", | ||
}); | ||
Customer.hasOne(models.Cart,{ | ||
onDelete:"cascade", | ||
}); | ||
Customer.hasOne(models.Users,{ | ||
onDelete:"cascade", | ||
}); | ||
}; | ||
return Customer; | ||
} |
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,12 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Notifications= sequelize.define("Notifications", { | ||
notification:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
Notifications.associate=(models)=>{ | ||
Notifications.belongsTo(models.Admin); | ||
}; | ||
return Notifications; | ||
} |
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,14 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Orders= sequelize.define("Orders", { | ||
status:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
Orders.associate=(models)=>{ | ||
Orders.belongsTo(models.Address); | ||
Orders.belongsTo(models.Bottle); | ||
Orders.belongsTo(models.Customer) | ||
}; | ||
return Orders; | ||
} |
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,13 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Reviews= sequelize.define("Reviews", { | ||
description:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
Reviews.associate=(models)=>{ | ||
Reviews.belongsTo(models.Bottle); | ||
Reviews.belongsTo(models.Customer) | ||
}; | ||
return Reviews; | ||
} |
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,37 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Users= sequelize.define("Users", { | ||
name:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
age:{ | ||
type: DataTypes.INTEGER, | ||
allowNull:false | ||
}, | ||
gender:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
cnic:{ | ||
type: DataTypes.BIGINT, | ||
allowNull:false | ||
}, | ||
email:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
}, | ||
phone:{ | ||
type: DataTypes.BIGINT, | ||
allowNull:false | ||
} | ||
}); | ||
Users.associate=(models)=>{ | ||
Users.hasOne(models.Account,{ | ||
onDelete:"cascade", | ||
}); | ||
Users.hasOne(models.Address,{ | ||
onDelete:"cascade", | ||
}); | ||
}; | ||
return Users; | ||
} |
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,13 @@ | ||
module.exports= (sequelize,DataTypes)=>{ | ||
const Website= sequelize.define("Website", { | ||
aboutUs:{ | ||
type: DataTypes.TEXT, | ||
allowNull:false | ||
}, | ||
image:{ | ||
type: DataTypes.STRING, | ||
allowNull:false | ||
} | ||
}); | ||
return Website; | ||
} |
Oops, something went wrong.