├── .gitignore ├── images ├── book.png ├── crown.png ├── iphone.jpg ├── shoes.png ├── wallet.png ├── watch.jpg ├── watch.png ├── wwwrrr.png ├── aeroplane.jpg ├── images.jfif ├── oneplus.png ├── tree_cs.png ├── google_question.png ├── model_50_epochs_plot.png └── randomly_permuted_costs_csacademy.png ├── assets ├── img │ ├── about.jpg │ ├── logo.png │ ├── watch.png │ ├── favicon.png │ ├── hero-bg.png │ ├── features-2.png │ ├── features-3.png │ ├── features.png │ ├── footer-bg.png │ ├── hero-img.png │ ├── items │ │ ├── bag2.jpg │ │ ├── bag1.jfif │ │ └── bag3.jfif │ ├── values-1.png │ ├── values-2.png │ ├── values-3.png │ ├── blog │ │ ├── blog-1.jpg │ │ ├── blog-2.jpg │ │ ├── blog-3.jpg │ │ ├── blog-4.jpg │ │ ├── comments-1.jpg │ │ ├── comments-2.jpg │ │ ├── comments-3.jpg │ │ ├── comments-4.jpg │ │ ├── comments-5.jpg │ │ ├── comments-6.jpg │ │ ├── blog-author.jpg │ │ ├── blog-recent-1.jpg │ │ ├── blog-recent-2.jpg │ │ ├── blog-recent-3.jpg │ │ ├── blog-recent-4.jpg │ │ ├── blog-recent-5.jpg │ │ └── blog-inside-post.jpg │ ├── pricing-free.png │ ├── team │ │ ├── team-1.jpg │ │ ├── team-2.jpg │ │ ├── team-3.jpg │ │ └── team-4.jpg │ ├── pricing-starter.png │ ├── apple-touch-icon.png │ ├── clients │ │ ├── client-1.png │ │ ├── client-2.png │ │ ├── client-3.png │ │ ├── client-4.png │ │ ├── client-5.png │ │ ├── client-6.png │ │ ├── client-7.png │ │ └── client-8.png │ ├── pricing-business.png │ ├── pricing-ultimate.png │ ├── portfolio │ │ ├── portfolio-1.jpg │ │ ├── portfolio-2.jpg │ │ ├── portfolio-3.jpg │ │ ├── portfolio-4.jpg │ │ ├── portfolio-5.jpg │ │ ├── portfolio-6.jpg │ │ ├── portfolio-7.jpg │ │ ├── portfolio-8.jpg │ │ └── portfolio-9.jpg │ ├── testimonials │ │ ├── testimonials-1.jpg │ │ ├── testimonials-2.jpg │ │ ├── testimonials-3.jpg │ │ ├── testimonials-4.jpg │ │ └── testimonials-5.jpg │ └── team-shape.svg ├── vendor │ ├── remixicon │ │ ├── remixicon.eot │ │ ├── remixicon.ttf │ │ ├── remixicon.woff │ │ └── remixicon.woff2 │ ├── font-awesome-4.7 │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ └── HELP-US-OUT.txt │ ├── bootstrap-icons │ │ └── fonts │ │ │ ├── bootstrap-icons.woff │ │ │ └── bootstrap-icons.woff2 │ ├── mdi-font │ │ └── fonts │ │ │ ├── Material-Design-Iconic-Font.eot │ │ │ ├── Material-Design-Iconic-Font.ttf │ │ │ ├── Material-Design-Iconic-Font.woff │ │ │ └── Material-Design-Iconic-Font.woff2 │ ├── php-email-form │ │ └── validate.js │ ├── purecounter │ │ └── purecounter.js │ └── bootstrap │ │ └── css │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.rtl.min.css │ │ ├── bootstrap-reboot.rtl.css │ │ └── bootstrap-reboot.css ├── css │ ├── search.css │ ├── upload.css │ ├── course.css │ ├── profile.css │ ├── thebox.css │ ├── signup.css │ ├── notification.css │ └── chat.css └── js │ ├── new.js │ ├── search.js │ └── main.js ├── Readmeimages ├── chat1.PNG ├── chat2.PNG ├── login.PNG ├── pay1.PNG ├── pay2.PNG ├── homepage.PNG ├── lostform.PNG ├── viewitem.PNG ├── foundform.PNG ├── notification.PNG ├── paymentPage.PNG ├── razorpay_success.PNG ├── adminsideconfirmation.PNG ├── notification_acceptance.PNG └── profile_and_rewards_page.PNG ├── views ├── error.ejs ├── partials │ ├── admin-sidebar.ejs │ └── admin-footer.ejs ├── login.ejs ├── signup.ejs ├── Forgotpassword.ejs ├── ResetPassword.ejs ├── item.ejs ├── chatdef.ejs ├── admin │ ├── user.ejs │ └── allposts.ejs ├── notification.ejs ├── lostform.ejs ├── upload.ejs ├── edit.ejs └── payment.ejs ├── config ├── auth_required.js └── passport.js ├── models ├── socket.js ├── chat.js ├── notification.js ├── post.js └── user.js ├── routes ├── admin.js ├── price.js ├── chat.js ├── user.js ├── payment.js ├── lost.js ├── auth.js └── post.js ├── README.md ├── package.json └── app.js /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | node_modules -------------------------------------------------------------------------------- /images/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/book.png -------------------------------------------------------------------------------- /images/crown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/crown.png -------------------------------------------------------------------------------- /images/iphone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/iphone.jpg -------------------------------------------------------------------------------- /images/shoes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/shoes.png -------------------------------------------------------------------------------- /images/wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/wallet.png -------------------------------------------------------------------------------- /images/watch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/watch.jpg -------------------------------------------------------------------------------- /images/watch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/watch.png -------------------------------------------------------------------------------- /images/wwwrrr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/wwwrrr.png -------------------------------------------------------------------------------- /assets/img/about.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/about.jpg -------------------------------------------------------------------------------- /assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/logo.png -------------------------------------------------------------------------------- /assets/img/watch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/watch.png -------------------------------------------------------------------------------- /images/aeroplane.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/aeroplane.jpg -------------------------------------------------------------------------------- /images/images.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/images.jfif -------------------------------------------------------------------------------- /images/oneplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/oneplus.png -------------------------------------------------------------------------------- /images/tree_cs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/tree_cs.png -------------------------------------------------------------------------------- /Readmeimages/chat1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/chat1.PNG -------------------------------------------------------------------------------- /Readmeimages/chat2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/chat2.PNG -------------------------------------------------------------------------------- /Readmeimages/login.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/login.PNG -------------------------------------------------------------------------------- /Readmeimages/pay1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/pay1.PNG -------------------------------------------------------------------------------- /Readmeimages/pay2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/pay2.PNG -------------------------------------------------------------------------------- /assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/favicon.png -------------------------------------------------------------------------------- /assets/img/hero-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/hero-bg.png -------------------------------------------------------------------------------- /Readmeimages/homepage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/homepage.PNG -------------------------------------------------------------------------------- /Readmeimages/lostform.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/lostform.PNG -------------------------------------------------------------------------------- /Readmeimages/viewitem.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/viewitem.PNG -------------------------------------------------------------------------------- /assets/img/features-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/features-2.png -------------------------------------------------------------------------------- /assets/img/features-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/features-3.png -------------------------------------------------------------------------------- /assets/img/features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/features.png -------------------------------------------------------------------------------- /assets/img/footer-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/footer-bg.png -------------------------------------------------------------------------------- /assets/img/hero-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/hero-img.png -------------------------------------------------------------------------------- /assets/img/items/bag2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/items/bag2.jpg -------------------------------------------------------------------------------- /assets/img/values-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/values-1.png -------------------------------------------------------------------------------- /assets/img/values-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/values-2.png -------------------------------------------------------------------------------- /assets/img/values-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/values-3.png -------------------------------------------------------------------------------- /Readmeimages/foundform.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/foundform.PNG -------------------------------------------------------------------------------- /assets/img/blog/blog-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-1.jpg -------------------------------------------------------------------------------- /assets/img/blog/blog-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-2.jpg -------------------------------------------------------------------------------- /assets/img/blog/blog-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-3.jpg -------------------------------------------------------------------------------- /assets/img/blog/blog-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-4.jpg -------------------------------------------------------------------------------- /assets/img/items/bag1.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/items/bag1.jfif -------------------------------------------------------------------------------- /assets/img/items/bag3.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/items/bag3.jfif -------------------------------------------------------------------------------- /assets/img/pricing-free.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/pricing-free.png -------------------------------------------------------------------------------- /assets/img/team/team-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/team/team-1.jpg -------------------------------------------------------------------------------- /assets/img/team/team-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/team/team-2.jpg -------------------------------------------------------------------------------- /assets/img/team/team-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/team/team-3.jpg -------------------------------------------------------------------------------- /assets/img/team/team-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/team/team-4.jpg -------------------------------------------------------------------------------- /images/google_question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/google_question.png -------------------------------------------------------------------------------- /views/error.ejs: -------------------------------------------------------------------------------- 1 |

<%= message %>

2 |

<%= error.status %>

3 |
<%= error.stack %>
4 | -------------------------------------------------------------------------------- /Readmeimages/notification.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/notification.PNG -------------------------------------------------------------------------------- /Readmeimages/paymentPage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/paymentPage.PNG -------------------------------------------------------------------------------- /assets/img/blog/comments-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/comments-1.jpg -------------------------------------------------------------------------------- /assets/img/blog/comments-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/comments-2.jpg -------------------------------------------------------------------------------- /assets/img/blog/comments-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/comments-3.jpg -------------------------------------------------------------------------------- /assets/img/blog/comments-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/comments-4.jpg -------------------------------------------------------------------------------- /assets/img/blog/comments-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/comments-5.jpg -------------------------------------------------------------------------------- /assets/img/blog/comments-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/comments-6.jpg -------------------------------------------------------------------------------- /assets/img/pricing-starter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/pricing-starter.png -------------------------------------------------------------------------------- /assets/img/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/apple-touch-icon.png -------------------------------------------------------------------------------- /assets/img/blog/blog-author.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-author.jpg -------------------------------------------------------------------------------- /assets/img/clients/client-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/clients/client-1.png -------------------------------------------------------------------------------- /assets/img/clients/client-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/clients/client-2.png -------------------------------------------------------------------------------- /assets/img/clients/client-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/clients/client-3.png -------------------------------------------------------------------------------- /assets/img/clients/client-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/clients/client-4.png -------------------------------------------------------------------------------- /assets/img/clients/client-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/clients/client-5.png -------------------------------------------------------------------------------- /assets/img/clients/client-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/clients/client-6.png -------------------------------------------------------------------------------- /assets/img/clients/client-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/clients/client-7.png -------------------------------------------------------------------------------- /assets/img/clients/client-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/clients/client-8.png -------------------------------------------------------------------------------- /assets/img/pricing-business.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/pricing-business.png -------------------------------------------------------------------------------- /assets/img/pricing-ultimate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/pricing-ultimate.png -------------------------------------------------------------------------------- /images/model_50_epochs_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/model_50_epochs_plot.png -------------------------------------------------------------------------------- /Readmeimages/razorpay_success.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/razorpay_success.PNG -------------------------------------------------------------------------------- /assets/img/blog/blog-recent-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-recent-1.jpg -------------------------------------------------------------------------------- /assets/img/blog/blog-recent-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-recent-2.jpg -------------------------------------------------------------------------------- /assets/img/blog/blog-recent-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-recent-3.jpg -------------------------------------------------------------------------------- /assets/img/blog/blog-recent-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-recent-4.jpg -------------------------------------------------------------------------------- /assets/img/blog/blog-recent-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-recent-5.jpg -------------------------------------------------------------------------------- /assets/img/blog/blog-inside-post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/blog/blog-inside-post.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-1.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-2.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-3.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-4.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-5.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-6.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-7.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-8.jpg -------------------------------------------------------------------------------- /assets/img/portfolio/portfolio-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/portfolio/portfolio-9.jpg -------------------------------------------------------------------------------- /assets/vendor/remixicon/remixicon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/remixicon/remixicon.eot -------------------------------------------------------------------------------- /assets/vendor/remixicon/remixicon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/remixicon/remixicon.ttf -------------------------------------------------------------------------------- /Readmeimages/adminsideconfirmation.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/adminsideconfirmation.PNG -------------------------------------------------------------------------------- /Readmeimages/notification_acceptance.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/notification_acceptance.PNG -------------------------------------------------------------------------------- /assets/vendor/remixicon/remixicon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/remixicon/remixicon.woff -------------------------------------------------------------------------------- /assets/vendor/remixicon/remixicon.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/remixicon/remixicon.woff2 -------------------------------------------------------------------------------- /Readmeimages/profile_and_rewards_page.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/Readmeimages/profile_and_rewards_page.PNG -------------------------------------------------------------------------------- /assets/img/testimonials/testimonials-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/testimonials/testimonials-1.jpg -------------------------------------------------------------------------------- /assets/img/testimonials/testimonials-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/testimonials/testimonials-2.jpg -------------------------------------------------------------------------------- /assets/img/testimonials/testimonials-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/testimonials/testimonials-3.jpg -------------------------------------------------------------------------------- /assets/img/testimonials/testimonials-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/testimonials/testimonials-4.jpg -------------------------------------------------------------------------------- /assets/img/testimonials/testimonials-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/img/testimonials/testimonials-5.jpg -------------------------------------------------------------------------------- /images/randomly_permuted_costs_csacademy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/images/randomly_permuted_costs_csacademy.png -------------------------------------------------------------------------------- /assets/vendor/font-awesome-4.7/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/font-awesome-4.7/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /assets/vendor/bootstrap-icons/fonts/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/bootstrap-icons/fonts/bootstrap-icons.woff -------------------------------------------------------------------------------- /assets/vendor/bootstrap-icons/fonts/bootstrap-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/bootstrap-icons/fonts/bootstrap-icons.woff2 -------------------------------------------------------------------------------- /assets/vendor/font-awesome-4.7/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/font-awesome-4.7/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /assets/vendor/font-awesome-4.7/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/font-awesome-4.7/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /assets/vendor/mdi-font/fonts/Material-Design-Iconic-Font.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/mdi-font/fonts/Material-Design-Iconic-Font.eot -------------------------------------------------------------------------------- /assets/vendor/mdi-font/fonts/Material-Design-Iconic-Font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/mdi-font/fonts/Material-Design-Iconic-Font.ttf -------------------------------------------------------------------------------- /assets/vendor/font-awesome-4.7/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/font-awesome-4.7/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /assets/vendor/font-awesome-4.7/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/font-awesome-4.7/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /assets/vendor/mdi-font/fonts/Material-Design-Iconic-Font.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/mdi-font/fonts/Material-Design-Iconic-Font.woff -------------------------------------------------------------------------------- /assets/vendor/mdi-font/fonts/Material-Design-Iconic-Font.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code-Geasss/TheLostBox/HEAD/assets/vendor/mdi-font/fonts/Material-Design-Iconic-Font.woff2 -------------------------------------------------------------------------------- /assets/css/search.css: -------------------------------------------------------------------------------- 1 | 2 | .searchh 3 | { 4 | color:rgb(255, 255, 255); 5 | font-size:15px; 6 | width:25%; 7 | outline: 1px ridge rgb(109, 58, 114); 8 | background-color: transparent; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /assets/js/new.js: -------------------------------------------------------------------------------- 1 | 2 | $(".dropdown-menu li").click(function(){ 3 | var selText = $(this).text(); 4 | $(this).parents('.btn-group').find('.dropdown-toggle').html(selText+' '); 5 | }); -------------------------------------------------------------------------------- /assets/vendor/font-awesome-4.7/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /config/auth_required.js: -------------------------------------------------------------------------------- 1 | var unauthorised = (req,res,next) => { 2 | if(req.user) return next(); 3 | else res.send("You cannot access this route"); 4 | } 5 | 6 | var isAuthenticated = (req,res,next) => { 7 | if(req.isAuthenticated()) return next(); 8 | return res.redirect('/LogIn'); 9 | } 10 | 11 | module.exports = { 12 | unauthorised, 13 | isAuthenticated 14 | } -------------------------------------------------------------------------------- /models/socket.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const { ObjectId } = mongoose.Schema; 3 | 4 | const socketSchema = new mongoose.Schema({ 5 | socketId: { 6 | type: String, 7 | required: true 8 | }, 9 | user: { 10 | type: Object, 11 | required: true 12 | }, 13 | email: { 14 | type: String, 15 | required: true 16 | } 17 | }); 18 | 19 | module.exports = mongoose.model("Socket", socketSchema); -------------------------------------------------------------------------------- /assets/css/upload.css: -------------------------------------------------------------------------------- 1 | .upload-btn-wrapper { 2 | position: relative; 3 | overflow: hidden; 4 | display: inline-block; 5 | } 6 | 7 | .btn { 8 | border: 2px solid gray; 9 | color: gray; 10 | background-color: white; 11 | padding: 8px 20px; 12 | border-radius: 8px; 13 | font-size: 20px; 14 | font-weight: bold; 15 | } 16 | 17 | .upload-btn-wrapper input[type=file] { 18 | font-size: 100px; 19 | position: absolute; 20 | left: 0; 21 | top: 0; 22 | opacity: 0; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /assets/css/course.css: -------------------------------------------------------------------------------- 1 | button, 2 | input { 3 | font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; 4 | } 5 | 6 | .nav-item .nav-link, 7 | .nav-tabs .nav-link { 8 | -webkit-transition: all 300ms ease 0s; 9 | -moz-transition: all 300ms ease 0s; 10 | -o-transition: all 300ms ease 0s; 11 | -ms-transition: all 300ms ease 0s; 12 | transition: all 300ms ease 0s; 13 | } 14 | 15 | .searchh 16 | { 17 | font-size:15px; 18 | width:25%; 19 | /* border-bottom: red; */ 20 | outline: 1px ridge rgb(109, 58, 114); 21 | } 22 | -------------------------------------------------------------------------------- /models/chat.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const { ObjectId } = mongoose.Schema; 3 | 4 | const chatSchema = new mongoose.Schema({ 5 | message: { 6 | type: String, 7 | required: true 8 | }, 9 | receiver: { 10 | type: Object, 11 | required: true 12 | }, 13 | sender: { 14 | type: Object, 15 | required: true 16 | }, 17 | time: { 18 | type: Date, 19 | default: Date.now 20 | } 21 | }); 22 | 23 | module.exports = mongoose.model("Chat", chatSchema); -------------------------------------------------------------------------------- /assets/img/team-shape.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /models/notification.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const { ObjectId } = mongoose.Schema; 3 | 4 | const notificationSchema = new mongoose.Schema({ 5 | 6 | id : { 7 | type : String, 8 | required : true 9 | }, 10 | senderId : { 11 | type : ObjectId, 12 | ref : "User", 13 | }, 14 | receiverID : { 15 | type : ObjectId, 16 | ref : "User", 17 | }, 18 | brandName : { 19 | type : String, 20 | required : true 21 | }, 22 | description:{ 23 | type:String, 24 | required:true 25 | }, 26 | isAccept : { 27 | type : Number, 28 | required : true 29 | } 30 | }, 31 | {timestamps: true }); 32 | 33 | module.exports = mongoose.model("Notification", notificationSchema); -------------------------------------------------------------------------------- /views/partials/admin-sidebar.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 32 | -------------------------------------------------------------------------------- /routes/admin.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | const router = express.Router(); 3 | 4 | const Post = require('../models/post'); 5 | var User = require('../models/user'); 6 | const Notification = require('../models/notification'); 7 | const { isAuthenticated, unauthorised } = require('../config/auth_required'); 8 | 9 | router.get('/admin',isAuthenticated,isAdmin,function(req,res,next) { 10 | 11 | var successMsg = req.flash('success')[0]; 12 | Post.find({},function (err,data) { 13 | 14 | if(err){ 15 | console.log(err); 16 | } 17 | else{ 18 | data1 = [...data]; 19 | console.log(data1); 20 | res.render('admin/allposts', {posts:data1,successMsg: successMsg, noMessages: !successMsg}); 21 | } 22 | }) 23 | }); 24 | 25 | router.get('/admin/user',isAuthenticated,isAdmin,function(req,res){ 26 | 27 | User.find({isAdmin:'false'},function(err,res1){ 28 | 29 | if(err){ 30 | console.log(err); 31 | } 32 | else{ 33 | console.log("inside"); 34 | console.log(res1); 35 | res.render('admin/user',{user:res1}); 36 | } 37 | }); 38 | }); 39 | 40 | function isAdmin(req,res,next){ 41 | if(req.user.isAdmin){ 42 | return next(); 43 | } 44 | res.redirect('/'); 45 | }; 46 | 47 | module.exports = router; -------------------------------------------------------------------------------- /models/post.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const { ObjectId } = mongoose.Schema; 3 | 4 | const postSchema = new mongoose.Schema({ 5 | 6 | category_name:{ 7 | type:String, 8 | required:true 9 | }, 10 | posts:[{ 11 | title: { 12 | type: String, 13 | required: true, 14 | }, 15 | description: { 16 | type: String, 17 | required: true 18 | }, 19 | location: { 20 | type: String, 21 | required: true 22 | }, 23 | photo: { 24 | type:String 25 | }, 26 | color:{ 27 | type:String, 28 | required:true, 29 | }, 30 | brandname:{ 31 | type:String, 32 | required:true, 33 | }, 34 | category: { 35 | type: String, 36 | required: true 37 | }, 38 | cost : { 39 | type : Number, 40 | }, 41 | paymentDone : { 42 | type : Boolean, 43 | }, 44 | postedBy: { 45 | type: ObjectId, 46 | ref: "User" 47 | }, 48 | created: { 49 | type: Date, 50 | default: Date.now 51 | }, 52 | updated: Date 53 | }], 54 | 55 | }); 56 | 57 | module.exports = mongoose.model("Post", postSchema); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TheLostBox 2 | 3 | ## Home 4 | ![](Readmeimages/homepage.PNG) 5 | 6 | ## Login 7 | ![](Readmeimages/login.PNG) 8 | 9 | ## The person (who got the lost product) fills in the details of the item/product. 10 | ![](Readmeimages/foundform.PNG) 11 | 12 | ## The owner of the actual product has to fill the Lost Form. 13 | ![](Readmeimages/lostform.PNG) 14 | 15 | ## If the person (who got the lost product) thinks the details mentioned in the lost form (filled by actual owner) matches with the actual product, he/she rejects or accepts the request. 16 | ![](Readmeimages/notification.PNG) 17 | 18 | ## If the person accepts the request, the actual owner can see his lost product/item 19 | ![](Readmeimages/notification_acceptance.PNG) 20 | 21 | ## The owner can see his actual lost product and select the options given 22 | ![](Readmeimages/viewitem.PNG) 23 | 24 | ## Option for Chat/Messaging_System 25 | ![](Readmeimages/chat1.PNG) 26 | ![](Readmeimages/chat2.PNG) 27 | 28 | ## Payment Pages 29 | ![](Readmeimages/paymentPage.PNG) 30 | 31 | ## Payment using Razorpay 32 | ![](Readmeimages/pay1.PNG) 33 | 34 | ![](Readmeimages/pay2.PNG) 35 | 36 | 37 | ## The details of the transactions in Razorpay site. 38 | ![](Readmeimages/razorpay_success.PNG) 39 | 40 | ## Details of all transactions in Admin page. 41 | ![](Readmeimages/adminsideconfirmation.PNG) 42 | 43 | ## Rewards for the person who found the lost product/item 44 | ![](Readmeimages/profile_and_rewards_page.PNG) 45 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "thelostbox", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node app.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/kunal-16/TheLostBox.git" 13 | }, 14 | "engine": { 15 | "node": "10.x" 16 | }, 17 | "author": "Chintan", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/kunal-16/TheLostBox/issues" 21 | }, 22 | "homepage": "https://github.com/kunal-16/TheLostBox#readme", 23 | "dependencies": { 24 | "bcrypt": "^5.0.1", 25 | "body": "^5.1.0", 26 | "body-parser": "^1.19.0", 27 | "connect-flash": "^0.1.1", 28 | "connect-mongo": "^3.2.0", 29 | "cookie-parser": "^1.4.5", 30 | "cors": "^2.8.5", 31 | "crypto": "^1.0.1", 32 | "dotenv": "^8.2.0", 33 | "ejs": "^3.1.6", 34 | "express": "^4.17.1", 35 | "express-session": "^1.17.1", 36 | "express-validator": "^5.3.1", 37 | "formidable": "^1.2.2", 38 | "method-override": "^3.0.0", 39 | "mongoose": "^5.12.3", 40 | "morgan": "^1.10.0", 41 | "multer": "^1.4.2", 42 | "nodemailer": "^6.5.0", 43 | "parser": "^0.1.4", 44 | "passport": "^0.4.1", 45 | "passport-google-oauth": "^2.0.0", 46 | "passport-local": "^1.0.0", 47 | "path": "^0.12.7", 48 | "razorpay": "^2.0.6", 49 | "request": "^2.88.2", 50 | "socket.io": "^2.3.0", 51 | "uuid": "^8.3.2" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /models/user.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const { v1: uuidv1 } = require('uuid'); 3 | const crypto = require('crypto'); 4 | const { ObjectId } = mongoose.Schema; 5 | 6 | 7 | const userSchema = new mongoose.Schema({ 8 | guid:{ 9 | type:String, 10 | default:null 11 | }, 12 | fullname: { 13 | type: String, 14 | trim: true, 15 | required: true 16 | }, 17 | email: { 18 | type: String, 19 | trim: true, 20 | required: true 21 | }, 22 | isAdmin : { 23 | type : Boolean, 24 | default : false, 25 | }, 26 | password: { 27 | type: String, 28 | //required: true, 29 | }, 30 | created: { 31 | type: Date, 32 | default: Date.now 33 | }, 34 | updated: Date, 35 | profile_image:{ 36 | // User Image 37 | type: String, 38 | default:"https://image.flaticon.com/icons/svg/236/236831.svg", 39 | }, 40 | about: { 41 | type: String, 42 | trim: true 43 | }, 44 | rewards:{ 45 | type:Number, 46 | }, 47 | resetPasswordToken: String, 48 | resetPasswordExpires: Date, 49 | }); 50 | 51 | //virtual field 52 | userSchema.methods.encryptPassword = function(password){ 53 | return bcrypt.hashSync(password,bcrypt.genSaltSync(5),null); 54 | }; 55 | 56 | userSchema.methods.validPassword = function(password){ 57 | return bcrypt.compareSync(password,this.password); 58 | }; 59 | 60 | module.exports = mongoose.model("User", userSchema); -------------------------------------------------------------------------------- /routes/price.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | const router = express.Router(); 3 | const request = require('request'); 4 | 5 | const Post = require('../models/post'); 6 | const { isAuthenticated, unauthorised } = require('../config/auth_required'); 7 | 8 | router.get('/price/:title/:id',function(req,res){ 9 | 10 | var title = req.params.title; 11 | var postId = req.params.id; 12 | console.log(postId); 13 | 14 | title = title.replace(/ /g, '%20'); 15 | console.log(title); 16 | 17 | request('https://vinitscraper.herokuapp.com/home/'+title, function (error, response, body) { 18 | console.error('error:', error); // Print the error 19 | console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received 20 | console.log('Price:', body); // Print the data received 21 | var data = body; 22 | console.log(data); 23 | 24 | data = data.replace(/,/g, ""); 25 | data1 = parseInt(data); 26 | data1 = data1*(0.25); 27 | data1 = parseInt(data1); 28 | 29 | Post.findOneAndUpdate({ "posts._id": postId },{$set:{ 30 | 'posts.$.cost': data1, 31 | }}, 32 | {new:true},function(err,post){ 33 | if(err){ 34 | console.log(err); 35 | // It is coming here from flask server. 36 | } 37 | else{ 38 | 39 | res.redirect(req.get('referer')); //this to redirect to the page from where u came. 40 | } 41 | }); 42 | }); 43 | }); 44 | 45 | module.exports = router; -------------------------------------------------------------------------------- /routes/chat.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const { isAuthenticated, unauthorised } = require('../config/auth_required'); 3 | const router = express.Router(); 4 | const Chat = require('../models/chat'); 5 | const User = require('../models/user'); 6 | 7 | 8 | router.get('/chatlist/:senderId',isAuthenticated,async function(req,res){ 9 | 10 | const senderId = req.params.senderId; 11 | let chatList1 = await Chat.distinct("receiver._id",{ 'sender._id': senderId }) 12 | let chatList2 = await Chat.distinct("sender._id",{ 'receiver._id': senderId }) 13 | let chatList = await chatList1.concat(chatList2); 14 | let distinctChatList = [...new Set(chatList)] 15 | User.find({ _id: { $in: distinctChatList } }) 16 | .select('fullname email created updated ') 17 | .exec((err,data) => { 18 | if(err || !data){ 19 | res.status(400).json({ 20 | error: err 21 | }) 22 | } 23 | //console.log(data); 24 | res.render('chatdef',{data:data,currentuser:req.user}); 25 | }); 26 | }); 27 | 28 | router.get('/chats/:senderId/:receiverId',isAuthenticated,function(req,res){ 29 | const senderId = req.params.senderId; 30 | const receiverId = req.params.receiverId; 31 | 32 | Chat.find({ $or: [{ 'receiver._id': receiverId, 'sender._id': senderId },{ 'sender._id': receiverId, 'receiver._id': senderId }] }, 33 | (err, chats) => { 34 | if(err || !chats){ 35 | console.log("err"); 36 | } 37 | else 38 | { 39 | //console.log(chats); 40 | //console.log(req.user); 41 | User.findById(receiverId,function(err,result){ 42 | var data=result; 43 | //console.log(data); 44 | res.render('chat',{chats:chats,currentuser:req.user,receiveruser:data}); 45 | }) 46 | 47 | } 48 | }); 49 | 50 | }); 51 | 52 | 53 | module.exports = router; -------------------------------------------------------------------------------- /assets/css/profile.css: -------------------------------------------------------------------------------- 1 | 2 | .emp-profile{ 3 | padding: 3%; 4 | margin-top: 3%; 5 | margin-bottom: 3%; 6 | border-radius: 0.5rem; 7 | background: #fff; 8 | border-style:solid; 9 | } 10 | .profile-img{ 11 | text-align: center; 12 | } 13 | .profile-img img{ 14 | width: 70%; 15 | height: 100%; 16 | } 17 | .profile-img .file { 18 | position: relative; 19 | overflow: hidden; 20 | margin-top: -20%; 21 | width: 70%; 22 | border: none; 23 | border-radius: 0; 24 | font-size: 15px; 25 | background: #212529b8; 26 | } 27 | .profile-img .file input { 28 | position: absolute; 29 | opacity: 0; 30 | right: 0; 31 | top: 0; 32 | } 33 | .profile-head h5{ 34 | color: #333; 35 | } 36 | .profile-head h6{ 37 | color: #0062cc; 38 | } 39 | .profile-edit-btn{ 40 | border: none; 41 | border-radius: 1.5rem; 42 | width: 70%; 43 | padding: 2%; 44 | font-weight: 600; 45 | color: #6c757d; 46 | cursor: pointer; 47 | } 48 | .proile-rating{ 49 | font-size: 12px; 50 | color: #818182; 51 | margin-top: 5%; 52 | } 53 | .proile-rating span{ 54 | color: #495057; 55 | font-size: 15px; 56 | font-weight: 600; 57 | } 58 | .profile-head .nav-tabs{ 59 | margin-bottom:5%; 60 | } 61 | .profile-head .nav-tabs .nav-link{ 62 | font-weight:600; 63 | border: none; 64 | } 65 | .profile-head .nav-tabs .nav-link.active{ 66 | border: none; 67 | border-bottom:2px solid #0062cc; 68 | } 69 | .profile-work{ 70 | padding: 14%; 71 | margin-top: -15%; 72 | } 73 | .profile-work p{ 74 | font-size: 12px; 75 | color: #818182; 76 | font-weight: 600; 77 | margin-top: 10%; 78 | } 79 | .profile-work a{ 80 | text-decoration: none; 81 | color: #495057; 82 | font-weight: 600; 83 | font-size: 14px; 84 | } 85 | .profile-work ul{ 86 | list-style: none; 87 | } 88 | .profile-tab label{ 89 | font-weight: 600; 90 | } 91 | .profile-tab p{ 92 | font-weight: 600; 93 | color: #0062cc; 94 | } -------------------------------------------------------------------------------- /routes/user.js: -------------------------------------------------------------------------------- 1 | const { isAuthenticated, unauthorised } = require('../config/auth_required'); 2 | const express = require('express'); 3 | const router = express.Router(); 4 | const multer = require('multer'); 5 | const path = require('path'); 6 | 7 | 8 | var User = require('../models/user'); 9 | const Post = require('../models/post'); 10 | 11 | const MIME_TYPE_MAP = { 12 | "image/png": "png", 13 | "image/jpeg": "jpg", 14 | "image/jpg": "jpg" 15 | }; 16 | 17 | const storage = multer.diskStorage({ 18 | destination: (req, file, cb) => { 19 | const isValid = MIME_TYPE_MAP[file.mimetype]; 20 | let error = new Error("Invalid mime type"); 21 | if (isValid) { 22 | error = null; 23 | } 24 | cb(error, "images/"); 25 | }, 26 | filename: (req, file, cb) => { 27 | const name = file.originalname 28 | .toLowerCase() 29 | .split(" ") 30 | .join("-"); 31 | const ext = MIME_TYPE_MAP[file.mimetype]; 32 | cb(null, name); 33 | } 34 | }); 35 | 36 | 37 | router.get('/profile',isAuthenticated,function(req,res){ 38 | var currentUser= req.user; 39 | 40 | Post.aggregate([ 41 | {$unwind:"$posts"}, 42 | {$match:{"posts.postedBy":currentUser._id}}, 43 | ]).exec(function(err,result){ 44 | if(err) console.log(err); 45 | console.log(result); 46 | res.render('profile',{currentUser:currentUser,result:result}); 47 | }); 48 | 49 | }); 50 | 51 | 52 | router.post('/save', unauthorised,multer({ storage: storage }).single("photo"),(req, res, next) => { 53 | console.log(req.body); 54 | var name = req.body.fullname; 55 | var about = req.body.about; 56 | data=path.join('/images/' + req.file.filename); 57 | var path2 = data.replace(/\\/g, '/'); 58 | console.log(path2); 59 | 60 | User.findOneAndUpdate({email:req.user.email},{fullname:name,about:about,profile_image:path2},function(err,result){ 61 | if(err) console.log(err); 62 | res.redirect('/profile'); 63 | }); 64 | }); 65 | 66 | module.exports=router; -------------------------------------------------------------------------------- /assets/css/thebox.css: -------------------------------------------------------------------------------- 1 | .container { 2 | padding: 0; 3 | padding-top: 40px; 4 | margin: 0; 5 | height: 100%; 6 | width: 1200px; 7 | margin: 0 auto; 8 | min-height: 100%; 9 | 10 | } 11 | 12 | .spacecontainer { 13 | padding: 0; 14 | margin: 0; 15 | 16 | width: 1200px; 17 | margin: 0 auto; 18 | height:50px; 19 | min-height: 100%; 20 | } 21 | 22 | .slidecontainer { 23 | width: 100%; 24 | } 25 | 26 | .slider { 27 | -webkit-appearance: none; 28 | width: 100%; 29 | height: 25px; 30 | background: #d3d3d3; 31 | outline: none; 32 | opacity: 0.7; 33 | -webkit-transition: .2s; 34 | transition: opacity .2s; 35 | } 36 | 37 | .slider:hover { 38 | opacity: 1; 39 | } 40 | 41 | .slider::-webkit-slider-thumb { 42 | -webkit-appearance: none; 43 | appearance: none; 44 | width: 25px; 45 | height: 25px; 46 | background: #4CAF50; 47 | cursor: pointer; 48 | } 49 | 50 | .slider::-moz-range-thumb { 51 | width: 25px; 52 | height: 25px; 53 | background: #4CAF50; 54 | cursor: pointer; 55 | } 56 | 57 | .button{ 58 | background-color: #008CBA; 59 | border: none; 60 | color: white; 61 | padding: 5px 20px; 62 | text-align: center; 63 | text-decoration: none; 64 | display: inline-block; 65 | font-size: 16px; 66 | margin: 4px 2px; 67 | cursor: pointer; 68 | } 69 | 70 | 71 | .dropbtn { 72 | background-color: #4c6faf; 73 | color: white; 74 | padding: 12px; 75 | font-size: 12px; 76 | border: none; 77 | } 78 | 79 | .dropdown { 80 | position: relative; 81 | display: inline-block; 82 | } 83 | 84 | .dropdown-content { 85 | display: none; 86 | position: absolute; 87 | background-color: #f1f1f1; 88 | min-width: 160px; 89 | box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); 90 | z-index: 1; 91 | } 92 | 93 | .dropdown-content a { 94 | color: black; 95 | padding: 12px 12px; 96 | text-decoration: none; 97 | display: block; 98 | } 99 | 100 | .dropdown-content a:hover {background-color: #ddd;} 101 | 102 | .dropdown:hover .dropdown-content {display: block;} 103 | 104 | .dropdown:hover .dropbtn {background-color: #5a3e8e;} -------------------------------------------------------------------------------- /routes/payment.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | var crypto = require('crypto'); 4 | 5 | const { isAuthenticated, unauthorised } = require('../config/auth_required'); 6 | 7 | const bodyParser = require('body-parser'); 8 | const Razorpay = require("razorpay"); 9 | var User = require('../models/user'); 10 | const Post = require('../models/post'); 11 | 12 | const instance = new Razorpay({ 13 | key_id : process.env.KEY_ID, 14 | key_secret : process.env.KEY_SECRET 15 | }); 16 | 17 | 18 | router.get("/payments/:id/:id2",(req,res)=>{ 19 | var rid= req.params.id; 20 | var postId = req.params.id2; 21 | console.log(rid); 22 | console.log(postId); 23 | 24 | Post.findOne({"posts._id": postId},{posts:{ $elemMatch:{_id:postId}}},function(err,result){ 25 | if(err){ 26 | console.log(err); 27 | } 28 | else{ 29 | var payAmount = result.posts[0].cost; 30 | res.render("payment",{key: process.env.KEY_ID,rid:rid,payAmount:payAmount,currentUser: req.user,pid:postId}); 31 | 32 | } 33 | }); 34 | 35 | }); 36 | 37 | router.post("/api/payment/order",(req,res)=>{ 38 | 39 | params = req.body; 40 | console.log(params); 41 | instance.orders 42 | .create(params) 43 | .then((data)=>{ 44 | res.send({sub:data, status:"success"}); 45 | }) 46 | .catch((error)=>{ 47 | res.send({sub:error,status:"failed"}); 48 | }); 49 | }); 50 | 51 | router.post("/api/payment/verify",(req,res)=>{ 52 | body = req.body.razorpay_order_id + "|" + req.body.razorpay_payment_id; 53 | 54 | var expectedSignature = crypto 55 | .createHmac("sha256",process.env.KEY_SECRET) 56 | .update(body.toString()) 57 | .digest("hex"); 58 | console.log("sig" + req.body.razorpay_signature); 59 | console.log("sig" + expectedSignature); 60 | //console.log("hii inside payment"); 61 | var response = {status : "failure"}; 62 | var rid = req.body.rid; 63 | var pid = req.body.pid; 64 | var amt = req.body.amt; 65 | var amt1 = parseInt(amt*0.75); 66 | 67 | 68 | if(expectedSignature === req.body.razorpay_signature) 69 | { 70 | response = {status : "success"}; 71 | User.findOneAndUpdate({"_id":rid},{$inc:{rewards:amt1}},{new:true},function(err,res){ 72 | if(err) console.log(err); 73 | console.log(res); 74 | 75 | }); 76 | 77 | //console.log(pid); 78 | Post.findOneAndUpdate({ "posts._id": pid },{$set:{ 79 | 'posts.$.paymentDone': true, 80 | }}, 81 | {new:true},function(err,post){ 82 | if(err){ 83 | console.log(err); 84 | } 85 | else{ 86 | //console.log(post); 87 | res.redirect('/'); 88 | } 89 | }); 90 | } 91 | 92 | }); 93 | 94 | module.exports = router; -------------------------------------------------------------------------------- /assets/vendor/php-email-form/validate.js: -------------------------------------------------------------------------------- 1 | /** 2 | * PHP Email Form Validation - v3.0 3 | * URL: https://bootstrapmade.com/php-email-form/ 4 | * Author: BootstrapMade.com 5 | */ 6 | (function () { 7 | "use strict"; 8 | 9 | let forms = document.querySelectorAll('.php-email-form'); 10 | 11 | forms.forEach( function(e) { 12 | e.addEventListener('submit', function(event) { 13 | event.preventDefault(); 14 | 15 | let thisForm = this; 16 | 17 | let action = thisForm.getAttribute('action'); 18 | let recaptcha = thisForm.getAttribute('data-recaptcha-site-key'); 19 | 20 | if( ! action ) { 21 | displayError(thisForm, 'The form action property is not set!') 22 | return; 23 | } 24 | thisForm.querySelector('.loading').classList.add('d-block'); 25 | thisForm.querySelector('.error-message').classList.remove('d-block'); 26 | thisForm.querySelector('.sent-message').classList.remove('d-block'); 27 | 28 | let formData = new FormData( thisForm ); 29 | 30 | if ( recaptcha ) { 31 | if(typeof grecaptcha !== "undefined" ) { 32 | grecaptcha.ready(function() { 33 | try { 34 | grecaptcha.execute(recaptcha, {action: 'php_email_form_submit'}) 35 | .then(token => { 36 | formData.set('recaptcha-response', token); 37 | php_email_form_submit(thisForm, action, formData); 38 | }) 39 | } catch(error) { 40 | displayError(thisForm, error) 41 | } 42 | }); 43 | } else { 44 | displayError(thisForm, 'The reCaptcha javascript API url is not loaded!') 45 | } 46 | } else { 47 | php_email_form_submit(thisForm, action, formData); 48 | } 49 | }); 50 | }); 51 | 52 | function php_email_form_submit(thisForm, action, formData) { 53 | fetch(action, { 54 | method: 'POST', 55 | body: formData, 56 | headers: {'X-Requested-With': 'XMLHttpRequest'} 57 | }) 58 | .then(response => { 59 | if( response.ok ) { 60 | return response.text() 61 | } else { 62 | throw new Error(`${response.status} ${response.statusText} ${response.url}`); 63 | } 64 | }) 65 | .then(data => { 66 | thisForm.querySelector('.loading').classList.remove('d-block'); 67 | if (data.trim() == 'OK') { 68 | thisForm.querySelector('.sent-message').classList.add('d-block'); 69 | thisForm.reset(); 70 | } else { 71 | throw new Error(data ? data : 'Form submission failed and no error message returned from: ' + action); 72 | } 73 | }) 74 | .catch((error) => { 75 | displayError(thisForm, error); 76 | }); 77 | } 78 | 79 | function displayError(thisForm, error) { 80 | thisForm.querySelector('.loading').classList.remove('d-block'); 81 | thisForm.querySelector('.error-message').innerHTML = error; 82 | thisForm.querySelector('.error-message').classList.add('d-block'); 83 | } 84 | 85 | })(); 86 | -------------------------------------------------------------------------------- /views/login.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The Box 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 58 |
59 |
60 |
61 |
62 | <% if(hasError){ %> 63 |
64 | <% messages.forEach(function(errmessage){ %> 65 |

<%= errmessage %>

66 | <% }) %> 67 |
68 | <% } %> 69 | 70 |

Login

71 |
72 | 73 | 74 | 75 | 76 | 77 | 78 |
79 |
80 | 81 |
82 | Sign in with
social network
83 | 84 | 85 |
86 |
OR
87 |
88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /views/signup.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The Box 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 57 |
58 |
59 |
60 |
61 | <% if(hasError){ %> 62 |
63 | <% messages.forEach(function(errmessage){ %> 64 |

<%= errmessage %>

65 | <% }) %> 66 |
67 | <% } %> 68 |

Sign up

69 |
70 | 71 | 72 | 73 | 74 | 75 | 76 |
77 |
78 | 79 |
80 | Sign in with
social network
81 | 82 | 83 |
84 |
OR
85 | 86 |
87 |
88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /views/Forgotpassword.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The Box 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 57 | 58 |
59 | 60 |
61 | <% if(typeof messages.error != 'undefined'){ %> 62 | 65 | <% } %> 66 | <% if(typeof messages.info != 'undefined'){ %> 67 | 70 | <% } %> 71 | 72 |

Forgot Password

73 |
74 |
75 |
76 | 77 | 78 | 79 |
80 | We'll never share your email with anyone else. 81 |
82 | 83 |
84 |
85 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /assets/js/search.js: -------------------------------------------------------------------------------- 1 | 2 | function myFunction() { 3 | var input, filter, table, tr, td, i; 4 | input = document.getElementById("myInput"); 5 | filter = input.value.toUpperCase(); 6 | table = document.getElementById("myTable1"); 7 | tr = table.getElementsByTagName("tr"); 8 | for (i = 1; i < tr.length; i++) { 9 | // Hide the row initially. 10 | tr[i].style.display = "none"; 11 | 12 | td = tr[i].getElementsByTagName("td"); 13 | for (var j = 0; j < td.length; j++) { 14 | cell = tr[i].getElementsByTagName("td")[j]; 15 | if (cell) { 16 | if (cell.innerHTML.toUpperCase().indexOf(filter) > -1) { 17 | tr[i].style.display = ""; 18 | break; 19 | } 20 | } 21 | } 22 | } 23 | } 24 | 25 | 26 | function order_list_search() { 27 | var input, filter, table, tr, td, i; 28 | input = document.getElementById("myInput"); 29 | filter = input.value.toUpperCase(); 30 | table = document.getElementById("order_list"); 31 | tr = table.getElementsByTagName("tr"); 32 | for (i = 1; i < tr.length; i++) { 33 | // Hide the row initially. 34 | tr[i].style.display = "none"; 35 | 36 | td = tr[i].getElementsByTagName("td"); 37 | for (var j = 0; j < td.length; j++) { 38 | cell = tr[i].getElementsByTagName("td")[j]; 39 | if (cell) { 40 | if (cell.innerHTML.toUpperCase().indexOf(filter) > -1) { 41 | tr[i].style.display = ""; 42 | break; 43 | } 44 | } 45 | } 46 | } 47 | } 48 | 49 | function orders_search(id) { 50 | var input, filter, table, tr, td, i; 51 | input = document.getElementById(id); 52 | filter = input.value.toUpperCase(); 53 | table = document.getElementById("orders"); 54 | tr = table.getElementsByTagName("tr"); 55 | for (i = 1; i < tr.length; i++) { 56 | // Hide the row initially. 57 | tr[i].style.display = "none"; 58 | 59 | td = tr[i].getElementsByTagName("td"); 60 | for (var j = 0; j < td.length; j++) { 61 | cell = tr[i].getElementsByTagName("td")[j]; 62 | if (cell) { 63 | if (cell.innerHTML.toUpperCase().indexOf(filter) > -1) { 64 | tr[i].style.display = ""; 65 | break; 66 | } 67 | } 68 | } 69 | } 70 | } 71 | 72 | function pending_orders_search(id) { 73 | var input, filter, table, tr, td, i; 74 | input = document.getElementById(id); 75 | filter = input.value.toUpperCase(); 76 | table = document.getElementById("pending_orders"); 77 | tr = table.getElementsByTagName("tr"); 78 | for (i = 1; i < tr.length; i++) { 79 | // Hide the row initially. 80 | tr[i].style.display = "none"; 81 | 82 | td = tr[i].getElementsByTagName("td"); 83 | for (var j = 0; j < td.length; j++) { 84 | cell = tr[i].getElementsByTagName("td")[j]; 85 | if (cell) { 86 | if (cell.innerHTML.toUpperCase().indexOf(filter) > -1) { 87 | tr[i].style.display = ""; 88 | break; 89 | } 90 | } 91 | } 92 | } 93 | } 94 | 95 | function user_search() { 96 | var input, filter, table, tr, td, i; 97 | input = document.getElementById("myInput"); 98 | filter = input.value.toUpperCase(); 99 | table = document.getElementById("users"); 100 | tr = table.getElementsByTagName("tr"); 101 | for (i = 1; i < tr.length; i++) { 102 | // Hide the row initially. 103 | tr[i].style.display = "none"; 104 | 105 | td = tr[i].getElementsByTagName("td"); 106 | for (var j = 0; j < td.length; j++) { 107 | cell = tr[i].getElementsByTagName("td")[j]; 108 | if (cell) { 109 | if (cell.innerHTML.toUpperCase().indexOf(filter) > -1) { 110 | tr[i].style.display = ""; 111 | break; 112 | } 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /assets/css/signup.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Roboto:400,300,500); 2 | *:focus { 3 | outline: none; 4 | } 5 | 6 | body { 7 | margin: 0; 8 | padding: 0; 9 | background: #FFF; 10 | font-size: 16px; 11 | color: #222; 12 | font-family: 'Roboto', sans-serif; 13 | font-weight: 300; 14 | } 15 | 16 | #login-box { 17 | position: relative; 18 | margin: 5% auto; 19 | width: 600px; 20 | height: 400px; 21 | background: #DDD; 22 | border-radius: 2px; 23 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); 24 | } 25 | 26 | .left { 27 | position: absolute; 28 | top: 0; 29 | left: 0; 30 | box-sizing: border-box; 31 | padding: 40px; 32 | width: 300px; 33 | height: 400px; 34 | } 35 | 36 | h1 { 37 | margin: 0 0 20px 0; 38 | font-weight: 300; 39 | font-size: 28px; 40 | } 41 | 42 | input[type="text"],input[type="email"], 43 | input[type="password"] { 44 | display: block; 45 | box-sizing: border-box; 46 | margin-bottom: 20px; 47 | padding: 4px; 48 | width: 220px; 49 | height: 32px; 50 | border: none; 51 | border-bottom: 1px solid #AAA; 52 | font-family: 'Roboto', sans-serif; 53 | font-weight: 400; 54 | font-size: 15px; 55 | transition: 0.2s ease; 56 | } 57 | 58 | input[type="text"]:focus, 59 | input[type="password"]:focus { 60 | border-bottom: 2px solid #16a085; 61 | color: #16a085; 62 | transition: 0.2s ease; 63 | } 64 | 65 | input[type="submit"] { 66 | margin-top: 28px; 67 | width: 120px; 68 | height: 32px; 69 | background: #16a085; 70 | border: none; 71 | border-radius: 2px; 72 | color: #FFF; 73 | font-family: 'Roboto', sans-serif; 74 | font-weight: 500; 75 | text-transform: uppercase; 76 | transition: 0.1s ease; 77 | cursor: pointer; 78 | } 79 | 80 | input[type="submit"]:hover, 81 | input[type="submit"]:focus { 82 | opacity: 0.8; 83 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); 84 | transition: 0.1s ease; 85 | } 86 | 87 | input[type="submit"]:active { 88 | opacity: 1; 89 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); 90 | transition: 0.1s ease; 91 | } 92 | 93 | .or { 94 | position: absolute; 95 | top: 180px; 96 | left: 280px; 97 | width: 40px; 98 | height: 40px; 99 | background: #DDD; 100 | border-radius: 50%; 101 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); 102 | line-height: 40px; 103 | text-align: center; 104 | } 105 | 106 | .right { 107 | position: absolute; 108 | top: 0; 109 | right: 0; 110 | box-sizing: border-box; 111 | padding: 40px; 112 | width: 300px; 113 | height: 400px; 114 | background: url('https://goo.gl/YbktSj'); 115 | background-size: cover; 116 | background-position: center; 117 | border-radius: 0 2px 2px 0; 118 | } 119 | 120 | .right .loginwith { 121 | display: block; 122 | margin-bottom: 40px; 123 | font-size: 28px; 124 | color: #FFF; 125 | text-align: center; 126 | } 127 | 128 | button.social-signin { 129 | margin-bottom: 20px; 130 | width: 220px; 131 | height: 36px; 132 | border: none; 133 | border-radius: 2px; 134 | color: #FFF; 135 | font-family: 'Roboto', sans-serif; 136 | font-weight: 500; 137 | transition: 0.2s ease; 138 | cursor: pointer; 139 | } 140 | 141 | button.social-signin:hover, 142 | button.social-signin:focus { 143 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); 144 | transition: 0.2s ease; 145 | } 146 | 147 | button.social-signin:active { 148 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); 149 | transition: 0.2s ease; 150 | } 151 | 152 | button.social-signin.facebook { 153 | background: #32508E; 154 | } 155 | 156 | button.social-signin.twitter { 157 | background: #55ACEE; 158 | } 159 | 160 | button.social-signin.google { 161 | background: #DD4B39; 162 | } 163 | 164 | .spacecontainer { 165 | padding: 0; 166 | margin: 0; 167 | 168 | width: 1200px; 169 | margin: 0 auto; 170 | height:50px; 171 | min-height: 100%; 172 | } 173 | -------------------------------------------------------------------------------- /routes/lost.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | const router = express.Router(); 3 | 4 | const Post = require('../models/post'); 5 | const Notification = require('../models/notification'); 6 | const { isAuthenticated, unauthorised } = require('../config/auth_required'); 7 | 8 | router.get("/form",isAuthenticated,function(req,res,next){ 9 | var errMsg = req.flash('error')[0]; 10 | res.render('lostform',{currentUser: req.user,errMsg: errMsg, noMessages: !errMsg }); 11 | }); 12 | 13 | router.post("/form",unauthorised,function(req,res,next){ 14 | 15 | var brand = req.body.bname; 16 | var color = req.body.color; 17 | var category_name = req.body.category; 18 | var description=req.body.description; 19 | var currentUser = req.user; 20 | 21 | if(description.length == 0 || category_name.length == 0 || 22 | color.length == 0 || brand.length == 0){ 23 | console.log("err ke andar"); 24 | req.flash('error', 'Please fill all the fields'); 25 | res.redirect("/form"); 26 | } 27 | else{ 28 | 29 | Post.aggregate([ 30 | {$match:{category_name:category_name}}, 31 | {$unwind:"$posts"}, 32 | {$match:{"posts.color":color,"posts.brandname":brand,"posts.postedBy":{'$ne':currentUser._id}}}, 33 | ]).exec(function(err,result){ 34 | if(err) console.log(err); 35 | console.log(result); 36 | 37 | for(index in result){ 38 | var newNotification = new Notification({ 39 | id : result[index].posts._id, 40 | senderId : req.user._id, 41 | receiverID : result[index].posts.postedBy, 42 | brandName : brand, 43 | description:description, 44 | isAccept : 0 45 | }); 46 | 47 | console.log(newNotification); 48 | newNotification.save(function(err,result){ 49 | if(err){ 50 | console.log(err); 51 | } 52 | else{ 53 | console.log("ok"); 54 | } 55 | }); 56 | } 57 | res.redirect('/'); 58 | }); 59 | } 60 | }); 61 | 62 | 63 | router.get('/accept/:id',unauthorised,function(req,res){ 64 | 65 | var noteId = req.params.id; 66 | Notification.findOneAndUpdate({ 67 | "_id" : noteId 68 | },{ 69 | $set : {isAccept : 1} 70 | },{ 71 | new : true 72 | },function(err,data){ 73 | if(err){ 74 | console.log(err); 75 | } 76 | else{ 77 | res.redirect("/notification"); 78 | } 79 | }); 80 | }); 81 | 82 | 83 | router.get('/reject/:id',unauthorised,function(req,res){ 84 | 85 | var noteId = req.params.id; 86 | Notification.findOneAndUpdate({ 87 | "_id" : noteId 88 | },{ 89 | $set : {isAccept : 2} 90 | },{ 91 | new : true 92 | },function(err,data){ 93 | if(err){ 94 | console.log(err); 95 | } 96 | else{ 97 | res.redirect("/notification"); 98 | } 99 | }); 100 | }); 101 | 102 | router.get('/notification',isAuthenticated ,function (req,res) { 103 | var currentUser = req.user; 104 | 105 | Notification.find({ 106 | $or : [{"senderId" : currentUser._id}, {"receiverID" : currentUser._id}] 107 | }) 108 | .populate('receiverID senderId') 109 | .exec(function(err,result){ 110 | if(err){ 111 | console.log(err); 112 | } 113 | else{ 114 | console.log("hy"); 115 | console.log(result); 116 | res.render('notification',{result:result ,currentUser:currentUser}); 117 | } 118 | }); 119 | }); 120 | 121 | module.exports = router; 122 | -------------------------------------------------------------------------------- /assets/css/notification.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Baloo+Paaji+2:wght@400;500&display=swap"); 2 | 3 | .container { 4 | display: grid; 5 | grid-template-columns: 300px 300px 300px; 6 | grid-gap: 50px; 7 | justify-content: center; 8 | align-items: center; 9 | height: 80vh; 10 | background-color: #f5f5f5; 11 | font-family: 'Baloo Paaji 2', cursive; 12 | } 13 | 14 | .card { 15 | background-color: #222831; 16 | height: 30rem; 17 | border-radius: 5px; 18 | display: flex; 19 | flex-direction: column; 20 | align-items: center; 21 | box-shadow: rgba(0, 0, 0, 0.7); 22 | color: white; 23 | } 24 | 25 | .card__name { 26 | margin-top: 15px; 27 | font-size: 1.5em; 28 | } 29 | 30 | .card__name1 { 31 | margin-top: 15px; 32 | font-size: 1.2em; 33 | margin-left: 10px; 34 | padding: 5px; 35 | } 36 | 37 | .card__image { 38 | height: 160px; 39 | width: 160px; 40 | border-radius: 50%; 41 | border: 5px solid #272133; 42 | margin-top: 20px; 43 | box-shadow: 0 10px 50px rgba(235, 25, 110, 1); 44 | } 45 | 46 | 47 | .draw-border { 48 | box-shadow: inset 0 0 0 4px #58cdd1; 49 | color: #58afd1; 50 | -webkit-transition: color 0.25s 0.0833333333s; 51 | transition: color 0.25s 0.0833333333s; 52 | position: relative; 53 | } 54 | 55 | .draw-border::before, 56 | .draw-border::after { 57 | border: 0 solid transparent; 58 | box-sizing: border-box; 59 | content: ''; 60 | pointer-events: none; 61 | position: absolute; 62 | width: 0rem; 63 | height: 0; 64 | bottom: 0; 65 | right: 0; 66 | } 67 | 68 | .draw-border::before { 69 | border-bottom-width: 4px; 70 | border-left-width: 4px; 71 | } 72 | 73 | .draw-border::after { 74 | border-top-width: 4px; 75 | border-right-width: 4px; 76 | } 77 | 78 | .draw-border:hover { 79 | color: #ffe593; 80 | } 81 | 82 | .draw-border:hover::before, 83 | .draw-border:hover::after { 84 | border-color: #eb196e; 85 | -webkit-transition: border-color 0s, width 0.25s, height 0.25s; 86 | transition: border-color 0s, width 0.25s, height 0.25s; 87 | width: 100%; 88 | height: 100%; 89 | } 90 | 91 | .draw-border:hover::before { 92 | -webkit-transition-delay: 0s, 0s, 0.25s; 93 | transition-delay: 0s, 0s, 0.25s; 94 | } 95 | 96 | .draw-border:hover::after { 97 | -webkit-transition-delay: 0s, 0.25s, 0s; 98 | transition-delay: 0s, 0.25s, 0s; 99 | } 100 | 101 | .btn { 102 | background: none; 103 | border: none; 104 | cursor: pointer; 105 | line-height: 1.5; 106 | font: 700 1.2rem 'Roboto Slab', sans-serif; 107 | padding: 0.75em 2em; 108 | letter-spacing: 0.05rem; 109 | margin: 1em; 110 | width: 13rem; 111 | } 112 | 113 | .btn:focus { 114 | outline: 2px dotted #55d7dc; 115 | } 116 | 117 | 118 | .social-icons { 119 | padding: 0; 120 | list-style: none; 121 | margin: 1em; 122 | } 123 | 124 | .social-icons li { 125 | display: inline-block; 126 | margin: 0.15em; 127 | position: relative; 128 | font-size: 1em; 129 | } 130 | 131 | .social-icons i { 132 | color: #fff; 133 | position: absolute; 134 | top: 0.95em; 135 | left: 0.96em; 136 | transition: all 265ms ease-out; 137 | } 138 | 139 | .social-icons a { 140 | display: inline-block; 141 | } 142 | 143 | .social-icons a:before { 144 | transform: scale(1); 145 | -ms-transform: scale(1); 146 | -webkit-transform: scale(1); 147 | content: " "; 148 | width: 45px; 149 | height: 45px; 150 | border-radius: 100%; 151 | display: block; 152 | background: linear-gradient(45deg, #ff003c, #c648c8); 153 | transition: all 265ms ease-out; 154 | } 155 | 156 | .social-icons a:hover:before { 157 | transform: scale(0); 158 | transition: all 265ms ease-in; 159 | } 160 | 161 | .social-icons a:hover i { 162 | transform: scale(2.2); 163 | -ms-transform: scale(2.2); 164 | -webkit-transform: scale(2.2); 165 | color: #ff003c; 166 | background: -webkit-linear-gradient(45deg, #ff003c, #c648c8); 167 | -webkit-background-clip: text; 168 | -webkit-text-fill-color: transparent; 169 | transition: all 265ms ease-in; 170 | } 171 | 172 | .grid-container { 173 | display: grid; 174 | grid-template-columns: 1fr 1fr; 175 | grid-gap: 20px; 176 | font-size: 1.2em; 177 | } -------------------------------------------------------------------------------- /assets/vendor/purecounter/purecounter.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=2)}([,,function(e,t,n){e.exports=n(3)},function(e,t,n){"use strict";function r(e,t){for(var n=0;nr.end?r.end:r.start:void setTimeout(function(){return void 0!==e.target?n.startCounter(e.target,r):n.startCounter(e,r)},r.delay)})}},{key:"startCounter",value:function(e,t){var n=this,r=(t.end-t.start)/(t.duration/t.delay),a="inc";t.start>t.end&&(a="dec",r*=-1),r<1&&t.decimals<=0&&(r=1);var i=t.decimals<=0?parseInt(t.start):parseFloat(t.start).toFixed(t.decimals);e.innerHTML=i,!0===t.once&&e.setAttribute("data-purecounter-duration",0);var o=setInterval(function(){var s=n.nextNumber(i,r,t,a);e.innerHTML=n.formatNumber(s,t),((i=s)>=t.end&&"inc"==a||i<=t.end&&"dec"==a)&&(clearInterval(o),i!=t.end&&(e.innerHTML=t.decimals<=0?parseInt(t.end):parseFloat(t.end).toFixed(t.decimals)))},t.delay)}},{key:"parseConfig",value:function(e){for(var t=[].filter.call(e.attributes,function(e){return/^data-purecounter-/.test(e.name)}),n={start:0,end:9001,duration:2e3,delay:10,once:!0,decimals:0,legacy:!0},r=0;r=window.pageYOffset&&n>=window.pageXOffset&&t+a<=window.pageYOffset+window.innerHeight&&n+r<=window.pageXOffset+window.innerWidth}},{key:"intersectionListenerSupported",value:function(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype}}])&&r(t.prototype,n),a&&r(t,a),e}())}]); -------------------------------------------------------------------------------- /views/ResetPassword.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The Box 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 57 | 58 |
59 | 60 |
61 | <% if(typeof messages.error != 'undefined'){ %> 62 | 65 | <% } %> 66 | <% if(typeof messages.info != 'undefined'){ %> 67 | 70 | <% } %> 71 | 72 |

Reset Password

73 |
74 |
75 | 76 |
77 | 78 | 79 |
80 |
81 |
82 | 83 | 84 |
85 |
86 | 87 |
88 |
89 | 95 | 96 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /config/passport.js: -------------------------------------------------------------------------------- 1 | const passport = require('passport'); 2 | const bcrypt = require('bcrypt'); 3 | const User = require('../models/user'); 4 | const { Strategy } = require('passport-local'); 5 | const LocalStrategy = require('passport-local').Strategy; 6 | const crypto = require('crypto'); 7 | const GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; 8 | require('dotenv').config(); 9 | 10 | 11 | /*done(err,__) err as a first parameter*/ 12 | passport.serializeUser(function(user, done){ 13 | done(null, user.id); 14 | }); 15 | 16 | passport.deserializeUser(function(id, done){ 17 | User.findById(id, function(err,user){ 18 | done(err, user); 19 | }); 20 | }); 21 | 22 | passport.use(new GoogleStrategy({ 23 | clientID: process.env.GCLIENTID, 24 | clientSecret:process.env.GCLIENTSECRET, 25 | callbackURL:"https://thelostbox.herokuapp.com/logIn/google/callback", 26 | userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo" 27 | }, 28 | (accessToken,refreshToken,profile,done)=>{ 29 | User.findOne({email: profile.emails[0].value},function(err,user){ 30 | if(err) return done(err); 31 | if(user) 32 | { 33 | console.log("user found"); 34 | console.log(user); 35 | if(user.guid == profile.id){ 36 | return done(null,user); 37 | } 38 | user.guid = profile.id; 39 | user.updated = Date.now(); 40 | user.save(function(err){ 41 | if(err) 42 | { 43 | throw err; 44 | } 45 | return done(null,user); 46 | }); 47 | // return done(null,user); 48 | } 49 | else 50 | { 51 | var newUser = new User(); 52 | newUser.guid = profile.id; 53 | newUser.fullname = profile.name.givenName + ' ' + profile.name.familyName; 54 | newUser.email = profile.emails[0].value; 55 | newUser.profile_image = profile.photos[0].value; 56 | newUser.save(function(err){ 57 | if(err) 58 | { 59 | throw err; 60 | } 61 | return done(null,newUser); 62 | }); 63 | } 64 | }) 65 | })); 66 | 67 | passport.use('local.signup', new LocalStrategy({ 68 | usernameField: 'email', 69 | passwordField: 'password', 70 | passReqToCallback: true 71 | }, function (req,email, password, done){ 72 | console.log('hy'); 73 | User.findOne({'email': email}, async function(err, user){ 74 | if(err){ 75 | return done(err); 76 | } 77 | if(req.body.fullname=="" || req.body.username==""){ 78 | return done(null, false, {message: 'Missing credentials'}); 79 | } 80 | 81 | if(user){ 82 | return done(null, false, {message: 'Email is already in use'}); 83 | } 84 | var newUser = new User(); 85 | newUser.fullname = req.body.fullname; 86 | newUser.email = email; 87 | newUser.password = bcrypt.hashSync(password, 10); 88 | newUser.save(function(err, result){ 89 | if(err){ 90 | console.log(err); 91 | return done(err); 92 | } 93 | 94 | return done(null, newUser); 95 | }); 96 | }); 97 | })); 98 | 99 | passport.use('local.signin', new LocalStrategy({ 100 | usernameField: 'email', 101 | passwordField: 'password', 102 | passReqToCallback: true 103 | }, function(req, email, password, done){ 104 | User.findOne({'email': email},function(err, user){ 105 | if(err){ 106 | return done(err); 107 | } 108 | if(!user){ 109 | return done(null, false, {message: 'No user found.'}); 110 | } 111 | // if(!user.validPassword(password)){ 112 | // return done(null, false, {message: 'Incorrect password.'}); 113 | // } 114 | if(!bcrypt.compareSync(password, user.password)){ 115 | return done(null, false, {message: 'Incorrect password.'}); 116 | } 117 | return done(null, user); 118 | }); 119 | })) -------------------------------------------------------------------------------- /assets/css/chat.css: -------------------------------------------------------------------------------- 1 | *{ 2 | box-sizing:border-box; 3 | } 4 | #container{ 5 | width:750px; 6 | height:600px; 7 | background:#eff3f7; 8 | margin:0 auto; 9 | margin-top: 100px; 10 | font-size:0; 11 | border-radius:5px; 12 | overflow:hidden; 13 | } 14 | aside{ 15 | width:260px; 16 | height:800px; 17 | background-color:#3b3e49; 18 | display:inline-block; 19 | font-size:15px; 20 | vertical-align:top; 21 | } 22 | main{ 23 | width:490px; 24 | height:800px; 25 | display:inline-block; 26 | font-size:15px; 27 | vertical-align:top; 28 | } 29 | 30 | aside header{ 31 | padding:30px 20px; 32 | } 33 | aside input{ 34 | width:100%; 35 | height:50px; 36 | line-height:50px; 37 | padding:0 50px 0 20px; 38 | background-color:#5e616a; 39 | border:none; 40 | border-radius:3px; 41 | color:#fff; 42 | background-image:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/1940306/ico_search.png); 43 | background-repeat:no-repeat; 44 | background-position:170px; 45 | background-size:40px; 46 | } 47 | aside input::placeholder{ 48 | color:#fff; 49 | } 50 | aside ul{ 51 | padding-left:0; 52 | margin:0; 53 | list-style-type:none; 54 | overflow-y:scroll; 55 | height:690px; 56 | } 57 | aside li{ 58 | padding:10px 0; 59 | } 60 | aside li:hover{ 61 | background-color:#5e616a; 62 | } 63 | h2,h3{ 64 | margin:0; 65 | } 66 | aside li img{ 67 | border-radius:50%; 68 | margin-left:20px; 69 | margin-right:8px; 70 | } 71 | aside li div{ 72 | display:inline-block; 73 | vertical-align:top; 74 | margin-top:12px; 75 | } 76 | aside li h2{ 77 | font-size:14px; 78 | color:#fff; 79 | font-weight:normal; 80 | margin-bottom:5px; 81 | } 82 | aside li h3{ 83 | font-size:12px; 84 | color:#7e818a; 85 | font-weight:normal; 86 | } 87 | 88 | .status{ 89 | width:8px; 90 | height:8px; 91 | border-radius:50%; 92 | display:inline-block; 93 | margin-right:7px; 94 | } 95 | .green{ 96 | background-color:#58b666; 97 | } 98 | .orange{ 99 | background-color:#ff725d; 100 | } 101 | .blue{ 102 | background-color:#6fbced; 103 | margin-right:0; 104 | margin-left:7px; 105 | } 106 | 107 | main header{ 108 | height:110px; 109 | padding:30px 20px 30px 40px; 110 | } 111 | main header > *{ 112 | display:inline-block; 113 | vertical-align:top; 114 | } 115 | main header img:first-child{ 116 | border-radius:50%; 117 | } 118 | main header img:last-child{ 119 | width:24px; 120 | margin-top:8px; 121 | } 122 | main header div{ 123 | margin-left:10px; 124 | margin-right:145px; 125 | } 126 | main header h2{ 127 | font-size:16px; 128 | margin-bottom:5px; 129 | } 130 | main header h3{ 131 | font-size:14px; 132 | font-weight:normal; 133 | color:#7e818a; 134 | } 135 | 136 | #chat{ 137 | padding-left:0; 138 | margin:0; 139 | list-style-type:none; 140 | overflow-y:scroll; 141 | height:300px; 142 | border-top:2px solid #fff; 143 | border-bottom:2px solid #fff; 144 | } 145 | #chat li{ 146 | padding:10px 30px; 147 | } 148 | #chat h2,#chat h3{ 149 | display:inline-block; 150 | font-size:13px; 151 | font-weight:normal; 152 | } 153 | #chat h3{ 154 | color:#bbb; 155 | } 156 | #chat .entete{ 157 | margin-bottom:5px; 158 | } 159 | #chat .message{ 160 | padding:20px; 161 | color:#fff; 162 | line-height:25px; 163 | max-width:90%; 164 | display:inline-block; 165 | text-align:left; 166 | border-radius:5px; 167 | } 168 | #chat .me{ 169 | text-align:right; 170 | } 171 | #chat .you .message{ 172 | background-color:#58b666; 173 | } 174 | #chat .me .message{ 175 | background-color:#6fbced; 176 | } 177 | #chat .triangle{ 178 | width: 0; 179 | height: 0; 180 | border-style: solid; 181 | border-width: 0 10px 10px 10px; 182 | } 183 | #chat .you .triangle{ 184 | border-color: transparent transparent #58b666 transparent; 185 | margin-left:15px; 186 | } 187 | #chat .me .triangle{ 188 | border-color: transparent transparent #6fbced transparent; 189 | margin-left:375px; 190 | } 191 | 192 | main footer{ 193 | height:155px; 194 | padding:20px 30px 10px 20px; 195 | } 196 | main footer textarea{ 197 | resize:none; 198 | border:none; 199 | display:block; 200 | width:100%; 201 | height:80px; 202 | border-radius:3px; 203 | padding:20px; 204 | font-size:13px; 205 | margin-bottom:13px; 206 | } 207 | main footer textarea::placeholder{ 208 | color:#ddd; 209 | } 210 | main footer img{ 211 | height:30px; 212 | cursor:pointer; 213 | } 214 | main footer a{ 215 | text-decoration:none; 216 | text-transform:uppercase; 217 | font-weight:bold; 218 | color:#6fbced; 219 | vertical-align:top; 220 | margin-left:333px; 221 | margin-top:5px; 222 | display:inline-block; 223 | } -------------------------------------------------------------------------------- /assets/vendor/bootstrap/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v5.0.0-beta2 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors 4 | * Copyright 2011-2021 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /assets/vendor/bootstrap/css/bootstrap-reboot.rtl.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v5.0.0-beta2 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors 4 | * Copyright 2011-2021 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-right:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-right:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:right}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:right;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:right}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}[type=email],[type=number],[type=tel],[type=url]{direction:ltr}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.rtl.min.css.map */ -------------------------------------------------------------------------------- /views/item.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The Box 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 44 | 45 | 46 | 47 | 48 | 49 | 76 | 77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 |
85 | 86 | 87 | 88 | 89 | 90 | 91 |
92 | 93 |
94 |
95 | 96 | 97 | 98 |
99 |
100 |

<%= data.posts[0].title %>

101 |
102 |
Location: <%= data.posts[0].location %>

103 |
Description: <%= data.posts[0].description %>

104 |
Person to Contact: <%= data.posts[0].postedBy.fullname %>

105 |
Email: <%= data.posts[0].postedBy.email %>


106 |
Color: <%= data.posts[0].color %>

107 |
Category: <%= data.posts[0].category %>

108 | 109 | <% if (data.posts[0].category !== category) { %> 110 | 111 | <% } %> 112 | 113 | 114 | 115 | 116 |
117 | 118 |
119 |
120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /views/chatdef.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The Box 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 66 | 67 |
68 | 69 |
70 | 91 |
92 |
93 | 94 |
95 |

Chat

96 |
97 |
98 |
99 |
100 | 101 | 102 | 103 | 104 | 105 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /views/admin/user.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | <%- include ("../partials/admin-sidebar") %> 18 | 19 | 20 |
21 | 22 | 37 | 38 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | 47 |
48 | 49 |
50 |
51 |
52 | 53 |
54 |
55 |
56 |
57 | 84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | 92 |
93 |
94 | 95 | 119 | 120 | <%- include ("../partials/admin-footer") %> -------------------------------------------------------------------------------- /views/notification.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The LostBox 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 64 |
65 |
66 |
67 |
68 | 69 | <% for (index in result) { %> 70 | 71 | 72 | 73 | <% if (currentUser._id == result[index].senderId.id) { %> 74 |
75 |
76 | <% if (result[index].isAccept === 1) {%> 77 | 80 |

Your Request is accepted for <%= result[index].brandName %>, <%= result[index].description %>

81 |

View ur lost product

82 | <% } else if (result[index].isAccept === 0){%> 83 |

Request

84 |

Your Request has been sent to <%= result[index].receiverID.fullname %>.

85 |
86 |

Please wait for the response.

87 | <% } else { %> 88 |

Your Request is rejected.

89 |

Sorry ur request was rejected by <%= result[index].receiverID.fullname %>

90 | <% } %> 91 | <%} else { %> 92 | 93 | <% if (result[index].isAccept == 0) { %> 94 |
95 |
96 |

A Request has been made for <%= result[index].brandName %>, <%= result[index].description %> by <%= result[index].senderId.fullname %>

97 | 98 | 99 |
100 | <% } %> 101 | <% } %> 102 | 103 | 105 | 106 |
107 | 108 |
109 | 110 | 111 | 112 | <% } %> 113 | 114 | 115 | -------------------------------------------------------------------------------- /views/lostform.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The LostBox 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 38 | 74 | 75 | 76 | 77 | 78 | 79 | 105 | 106 |
107 |
108 |
109 |
110 | 111 | 112 |
113 | 114 |
115 |
116 | <%= errMsg %> 117 |
118 | 119 |
120 | 121 | 122 |
123 | 124 | 125 | 126 |
127 | 128 |
140 |
141 | 142 | 143 |
144 | 145 | 146 |
147 | 148 |
149 |
150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const http = require("http"); 3 | const app = express(); 4 | const request = require('request'); 5 | 6 | const server =http.createServer(app); 7 | const io = require("socket.io").listen(server); 8 | 9 | const mongoose = require('mongoose'); 10 | var createError = require('http-errors'); 11 | const morgan = require('morgan'); 12 | var path = require('path'); 13 | const session = require('express-session'); 14 | const MongoStore = require('connect-mongo')(session); 15 | const bodyParser = require('body-parser'); 16 | const cookieParser = require('cookie-parser'); 17 | const expressValidator = require('express-validator'); 18 | const cors = require('cors'); 19 | const passport = require('passport'); 20 | 21 | 22 | var methodOverride = require("method-override"); 23 | 24 | const flash = require('connect-flash'); 25 | const dotenv = require('dotenv'); 26 | dotenv.config(); 27 | 28 | 29 | 30 | require('./config/passport'); 31 | 32 | const PORT = process.env.PORT; 33 | mongoose.set('useNewUrlParser', true); 34 | mongoose.set('useUnifiedTopology', true); 35 | mongoose.connect(process.env.MONGODB_URI) 36 | .then(() => console.log('db connected')); 37 | 38 | mongoose.connection.on('error', err => { 39 | console.log(`DB Error: ${err.message}`); 40 | }); 41 | 42 | 43 | const postRoutes = require('./routes/post'); 44 | const authRoutes = require('./routes/auth'); 45 | const userRoutes = require('./routes/user'); 46 | const chatRoutes = require('./routes/chat'); 47 | const lostRoutes = require('./routes/lost'); 48 | const paymentRoutes = require('./routes/payment'); 49 | const priceRoutes = require('./routes/price'); 50 | const adminRoutes = require('./routes/admin'); 51 | 52 | app.set('views', path.join(__dirname, 'views')); 53 | app.set('view engine', 'ejs'); 54 | 55 | app.use(morgan('dev')); 56 | app.use(express.json()); 57 | app.use(bodyParser.json()); 58 | app.use(bodyParser.urlencoded({ extended: false })); 59 | app.use(cookieParser()); 60 | app.use(expressValidator()); 61 | app.use(cors()); 62 | app.use("/images",express.static(path.join(__dirname, 'images'))); 63 | app.use(express.static(path.join(__dirname, 'assets'))); 64 | 65 | 66 | const Socket = require('./models/socket'); 67 | const Chat = require('./models/chat'); 68 | 69 | 70 | 71 | io.on('connection', async (socket) => { 72 | console.log('CLIENT CONNECTED') 73 | socket.on('userInfo',(user) => { 74 | console.log(user); 75 | Socket.findOne({email: user.email}, function(err,res) { 76 | if(!res){ 77 | let newSocket = new Socket({ 78 | socketId: socket.id, 79 | user: user, 80 | email: user.email 81 | }) 82 | newSocket.save((err,result) => { 83 | if(err){ 84 | console.log(err) 85 | } else { 86 | console.log("ADDED TO DB ", socket.id) 87 | } 88 | }) 89 | } else { 90 | Socket.findOneAndUpdate({email: user.email} ,{$set: {"socketId": socket.id}}, (err,result) => { 91 | if(err){ 92 | console.log(err) 93 | }else{ 94 | console.log("UPDATED"); 95 | } 96 | }) 97 | } 98 | }) 99 | }); 100 | 101 | socket.on('sendMessage', (message, sender, receiver, callback) => { 102 | const senderId = sender._id; 103 | const receiverId = receiver._id; 104 | Socket.findOne({email: receiver.email}) 105 | .exec(async function(err,res) { 106 | if(res!=null){ 107 | console.log("SENT") 108 | const newChat = new Chat({ 109 | message, 110 | receiver, 111 | sender 112 | }); 113 | await newChat.save((err,result) => { 114 | if(err){ 115 | console.log(err) 116 | } else { 117 | console.log("--------------------------------"); 118 | console.log("CHAT SAVED"); 119 | console.log("--------------------------------"); 120 | } 121 | }) 122 | // const allChats = await Chat.find({ $or: [{ 'receiver._id': receiverId, 'sender._id': senderId },{ 'sender._id': receiverId, 'receiver._id': senderId }] }) 123 | console.log("emitting online") 124 | io.to(res.socketId).emit('message', newChat); 125 | socket.emit('message', newChat); 126 | 127 | } else { 128 | const newChat = new Chat({ 129 | message, 130 | receiver, 131 | sender 132 | }); 133 | await newChat.save((err,result) => { 134 | if(err){ 135 | console.log(err) 136 | } else { 137 | console.log("--------------------------------"); 138 | console.log("OFFLINE CHAT SAVED"); 139 | console.log("--------------------------------"); 140 | } 141 | }) 142 | console.log("emitting offline") 143 | //console.log(newChat); 144 | socket.emit('message', newChat); 145 | } 146 | }) 147 | callback(); 148 | }); 149 | socket.on('disconnect', () => { 150 | Socket.findOne({socketId: socket.id}) 151 | .remove((err, result) => { 152 | if(err){ 153 | console.log(err) 154 | } else { 155 | console.log("DELETED"); 156 | } 157 | }) 158 | console.log("DISCONNECTED") 159 | }); 160 | }); 161 | 162 | app.use(session({ 163 | secret: 'supersecret', 164 | resave: false, 165 | saveUninitialized: false, 166 | store: new MongoStore({ mongooseConnection: mongoose.connection }), 167 | cookie: { maxAge: 180 * 60 * 1000 }/* 180 minutes */ 168 | })); 169 | 170 | app.use(flash()); 171 | app.use(methodOverride("_method")); 172 | app.use(passport.initialize()); 173 | app.use(passport.session()); 174 | 175 | app.use(function(req, res, next){ 176 | res.locals.currentUser = req.user; 177 | res.locals.session = req.session; 178 | next(); 179 | }); 180 | 181 | app.use(authRoutes); 182 | app.use(postRoutes); 183 | app.use(chatRoutes); 184 | app.use(userRoutes); 185 | app.use(lostRoutes); 186 | app.use(paymentRoutes); 187 | app.use(priceRoutes); 188 | app.use(adminRoutes); 189 | 190 | 191 | 192 | app.use(function(err,req,res,next){ 193 | if(err.name === 'UnauthorizedError'){ 194 | res.status(401).json({ error: "Unauthorized !" }); 195 | } 196 | }); 197 | 198 | server.listen(PORT, () => { 199 | console.log(`Server started at port ${PORT}`) 200 | }) 201 | -------------------------------------------------------------------------------- /views/upload.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The LostBox 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 39 | 75 | 76 | 77 | 78 | 79 | 80 | 106 | 107 | 108 |
109 | 110 |
111 |
112 | <%= errMsg %> 113 |
114 |
115 | 116 |
117 | 118 | 119 | 120 |
121 | 122 | 123 |
124 | 125 | 126 |
127 | 128 |
140 |
141 | 142 | 143 |
144 |
145 |
146 |
147 | 148 | 149 |
150 |
151 |
152 | 153 | 154 | 155 | 156 |
157 |
158 | 159 |
160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /views/partials/admin-footer.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /views/edit.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | The LostBox 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 38 | 74 | 75 | 76 | 77 | 78 | 79 | 105 | 106 | 107 |
108 | 109 |
110 |
111 | <%= errMsg %> 112 |
113 |
114 | 115 |
116 |
117 | 118 | 119 |
120 | 121 | 122 |
123 | 124 | 125 |
126 | 127 |
133 |
134 | <% if(currentUser.isAdmin) { %> 135 | 136 | 137 |
138 | <% } %> 139 | 140 | 141 |
142 | 143 |
144 |
145 | 146 | 147 |
148 |
149 |
150 | 151 | 152 | 153 | 154 |
155 |
156 |
157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /views/admin/allposts.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | <%- include ("../partials/admin-sidebar") %> 18 | 19 | 20 |
21 | 22 | 37 | 38 |
39 |
40 |
41 | <%= successMsg %> 42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | 53 |
54 | 55 |
56 |
57 |
58 | 59 |
60 |
61 |
62 |
63 | 122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 | 130 |
131 |
132 | 133 | 157 | 158 | <%- include ("../partials/admin-footer") %> -------------------------------------------------------------------------------- /assets/js/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Template Name: FlexStart - v1.1.1 3 | * Template URL: https://bootstrapmade.com/flexstart-bootstrap-startup-template/ 4 | * Author: BootstrapMade.com 5 | * License: https://bootstrapmade.com/license/ 6 | */ 7 | (function() { 8 | "use strict"; 9 | 10 | /** 11 | * Easy selector helper function 12 | */ 13 | const select = (el, all = false) => { 14 | el = el.trim() 15 | if (all) { 16 | return [...document.querySelectorAll(el)] 17 | } else { 18 | return document.querySelector(el) 19 | } 20 | } 21 | 22 | /** 23 | * Easy event listener function 24 | */ 25 | const on = (type, el, listener, all = false) => { 26 | if (all) { 27 | select(el, all).forEach(e => e.addEventListener(type, listener)) 28 | } else { 29 | select(el, all).addEventListener(type, listener) 30 | } 31 | } 32 | 33 | /** 34 | * Easy on scroll event listener 35 | */ 36 | const onscroll = (el, listener) => { 37 | el.addEventListener('scroll', listener) 38 | } 39 | 40 | /** 41 | * Navbar links active state on scroll 42 | */ 43 | let navbarlinks = select('#navbar .scrollto', true) 44 | const navbarlinksActive = () => { 45 | let position = window.scrollY + 200 46 | navbarlinks.forEach(navbarlink => { 47 | if (!navbarlink.hash) return 48 | let section = select(navbarlink.hash) 49 | if (!section) return 50 | if (position >= section.offsetTop && position <= (section.offsetTop + section.offsetHeight)) { 51 | navbarlink.classList.add('active') 52 | } else { 53 | navbarlink.classList.remove('active') 54 | } 55 | }) 56 | } 57 | window.addEventListener('load', navbarlinksActive) 58 | onscroll(document, navbarlinksActive) 59 | 60 | /** 61 | * Scrolls to an element with header offset 62 | */ 63 | const scrollto = (el) => { 64 | let header = select('#header') 65 | let offset = header.offsetHeight 66 | 67 | if (!header.classList.contains('header-scrolled')) { 68 | offset -= 10 69 | } 70 | 71 | let elementPos = select(el).offsetTop 72 | window.scrollTo({ 73 | top: elementPos - offset, 74 | behavior: 'smooth' 75 | }) 76 | } 77 | 78 | /** 79 | * Toggle .header-scrolled class to #header when page is scrolled 80 | */ 81 | let selectHeader = select('#header') 82 | if (selectHeader) { 83 | const headerScrolled = () => { 84 | if (window.scrollY > 100) { 85 | selectHeader.classList.add('header-scrolled') 86 | } else { 87 | selectHeader.classList.remove('header-scrolled') 88 | } 89 | } 90 | window.addEventListener('load', headerScrolled) 91 | onscroll(document, headerScrolled) 92 | } 93 | 94 | /** 95 | * Back to top button 96 | */ 97 | let backtotop = select('.back-to-top') 98 | if (backtotop) { 99 | const toggleBacktotop = () => { 100 | if (window.scrollY > 100) { 101 | backtotop.classList.add('active') 102 | } else { 103 | backtotop.classList.remove('active') 104 | } 105 | } 106 | window.addEventListener('load', toggleBacktotop) 107 | onscroll(document, toggleBacktotop) 108 | } 109 | 110 | /** 111 | * Mobile nav toggle 112 | */ 113 | on('click', '.mobile-nav-toggle', function(e) { 114 | select('#navbar').classList.toggle('navbar-mobile') 115 | this.classList.toggle('bi-list') 116 | this.classList.toggle('bi-x') 117 | }) 118 | 119 | /** 120 | * Mobile nav dropdowns activate 121 | */ 122 | on('click', '.navbar .dropdown > a', function(e) { 123 | if (select('#navbar').classList.contains('navbar-mobile')) { 124 | e.preventDefault() 125 | this.nextElementSibling.classList.toggle('dropdown-active') 126 | } 127 | }, true) 128 | 129 | /** 130 | * Scrool with ofset on links with a class name .scrollto 131 | */ 132 | on('click', '.scrollto', function(e) { 133 | if (select(this.hash)) { 134 | e.preventDefault() 135 | 136 | let navbar = select('#navbar') 137 | if (navbar.classList.contains('navbar-mobile')) { 138 | navbar.classList.remove('navbar-mobile') 139 | let navbarToggle = select('.mobile-nav-toggle') 140 | navbarToggle.classList.toggle('bi-list') 141 | navbarToggle.classList.toggle('bi-x') 142 | } 143 | scrollto(this.hash) 144 | } 145 | }, true) 146 | 147 | /** 148 | * Scroll with ofset on page load with hash links in the url 149 | */ 150 | window.addEventListener('load', () => { 151 | if (window.location.hash) { 152 | if (select(window.location.hash)) { 153 | scrollto(window.location.hash) 154 | } 155 | } 156 | }); 157 | 158 | /** 159 | * Clients Slider 160 | */ 161 | new Swiper('.clients-slider', { 162 | speed: 400, 163 | loop: true, 164 | autoplay: { 165 | delay: 5000, 166 | disableOnInteraction: false 167 | }, 168 | slidesPerView: 'auto', 169 | pagination: { 170 | el: '.swiper-pagination', 171 | type: 'bullets', 172 | clickable: true 173 | }, 174 | breakpoints: { 175 | 320: { 176 | slidesPerView: 2, 177 | spaceBetween: 40 178 | }, 179 | 480: { 180 | slidesPerView: 3, 181 | spaceBetween: 60 182 | }, 183 | 640: { 184 | slidesPerView: 4, 185 | spaceBetween: 80 186 | }, 187 | 992: { 188 | slidesPerView: 6, 189 | spaceBetween: 120 190 | } 191 | } 192 | }); 193 | 194 | /** 195 | * Porfolio isotope and filter 196 | */ 197 | window.addEventListener('load', () => { 198 | let portfolioContainer = select('.portfolio-container'); 199 | if (portfolioContainer) { 200 | let portfolioIsotope = new Isotope(portfolioContainer, { 201 | itemSelector: '.portfolio-item', 202 | layoutMode: 'fitRows' 203 | }); 204 | 205 | let portfolioFilters = select('#portfolio-flters li', true); 206 | 207 | on('click', '#portfolio-flters li', function(e) { 208 | e.preventDefault(); 209 | portfolioFilters.forEach(function(el) { 210 | el.classList.remove('filter-active'); 211 | }); 212 | this.classList.add('filter-active'); 213 | 214 | portfolioIsotope.arrange({ 215 | filter: this.getAttribute('data-filter') 216 | }); 217 | aos_init(); 218 | }, true); 219 | } 220 | 221 | }); 222 | 223 | /** 224 | * Initiate portfolio lightbox 225 | */ 226 | const portfolioLightbox = GLightbox({ 227 | selector: '.portfokio-lightbox' 228 | }); 229 | 230 | /** 231 | * Portfolio details slider 232 | */ 233 | new Swiper('.portfolio-details-slider', { 234 | speed: 400, 235 | autoplay: { 236 | delay: 5000, 237 | disableOnInteraction: false 238 | }, 239 | pagination: { 240 | el: '.swiper-pagination', 241 | type: 'bullets', 242 | clickable: true 243 | } 244 | }); 245 | 246 | /** 247 | * Testimonials slider 248 | */ 249 | new Swiper('.testimonials-slider', { 250 | speed: 600, 251 | loop: true, 252 | autoplay: { 253 | delay: 5000, 254 | disableOnInteraction: false 255 | }, 256 | slidesPerView: 'auto', 257 | pagination: { 258 | el: '.swiper-pagination', 259 | type: 'bullets', 260 | clickable: true 261 | }, 262 | breakpoints: { 263 | 320: { 264 | slidesPerView: 1, 265 | spaceBetween: 40 266 | }, 267 | 268 | 1200: { 269 | slidesPerView: 3, 270 | } 271 | } 272 | }); 273 | 274 | /** 275 | * Animation on scroll 276 | */ 277 | function aos_init() { 278 | AOS.init({ 279 | duration: 1000, 280 | easing: "ease-in-out", 281 | once: true, 282 | mirror: false 283 | }); 284 | } 285 | window.addEventListener('load', () => { 286 | aos_init(); 287 | }); 288 | 289 | })(); -------------------------------------------------------------------------------- /assets/vendor/bootstrap/css/bootstrap-reboot.rtl.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v5.0.0-beta2 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors 4 | * Copyright 2011-2021 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | *, 9 | *::before, 10 | *::after { 11 | box-sizing: border-box; 12 | } 13 | 14 | @media (prefers-reduced-motion: no-preference) { 15 | :root { 16 | scroll-behavior: smooth; 17 | } 18 | } 19 | 20 | body { 21 | margin: 0; 22 | font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; 23 | font-size: 1rem; 24 | font-weight: 400; 25 | line-height: 1.5; 26 | color: #212529; 27 | background-color: #fff; 28 | -webkit-text-size-adjust: 100%; 29 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 30 | } 31 | 32 | [tabindex="-1"]:focus:not(:focus-visible) { 33 | outline: 0 !important; 34 | } 35 | 36 | hr { 37 | margin: 1rem 0; 38 | color: inherit; 39 | background-color: currentColor; 40 | border: 0; 41 | opacity: 0.25; 42 | } 43 | 44 | hr:not([size]) { 45 | height: 1px; 46 | } 47 | 48 | h6, h5, h4, h3, h2, h1 { 49 | margin-top: 0; 50 | margin-bottom: 0.5rem; 51 | font-weight: 500; 52 | line-height: 1.2; 53 | } 54 | 55 | h1 { 56 | font-size: calc(1.375rem + 1.5vw); 57 | } 58 | @media (min-width: 1200px) { 59 | h1 { 60 | font-size: 2.5rem; 61 | } 62 | } 63 | 64 | h2 { 65 | font-size: calc(1.325rem + 0.9vw); 66 | } 67 | @media (min-width: 1200px) { 68 | h2 { 69 | font-size: 2rem; 70 | } 71 | } 72 | 73 | h3 { 74 | font-size: calc(1.3rem + 0.6vw); 75 | } 76 | @media (min-width: 1200px) { 77 | h3 { 78 | font-size: 1.75rem; 79 | } 80 | } 81 | 82 | h4 { 83 | font-size: calc(1.275rem + 0.3vw); 84 | } 85 | @media (min-width: 1200px) { 86 | h4 { 87 | font-size: 1.5rem; 88 | } 89 | } 90 | 91 | h5 { 92 | font-size: 1.25rem; 93 | } 94 | 95 | h6 { 96 | font-size: 1rem; 97 | } 98 | 99 | p { 100 | margin-top: 0; 101 | margin-bottom: 1rem; 102 | } 103 | 104 | abbr[title], 105 | abbr[data-bs-original-title] { 106 | text-decoration: underline; 107 | -webkit-text-decoration: underline dotted; 108 | text-decoration: underline dotted; 109 | cursor: help; 110 | -webkit-text-decoration-skip-ink: none; 111 | text-decoration-skip-ink: none; 112 | } 113 | 114 | address { 115 | margin-bottom: 1rem; 116 | font-style: normal; 117 | line-height: inherit; 118 | } 119 | 120 | ol, 121 | ul { 122 | padding-right: 2rem; 123 | } 124 | 125 | ol, 126 | ul, 127 | dl { 128 | margin-top: 0; 129 | margin-bottom: 1rem; 130 | } 131 | 132 | ol ol, 133 | ul ul, 134 | ol ul, 135 | ul ol { 136 | margin-bottom: 0; 137 | } 138 | 139 | dt { 140 | font-weight: 700; 141 | } 142 | 143 | dd { 144 | margin-bottom: 0.5rem; 145 | margin-right: 0; 146 | } 147 | 148 | blockquote { 149 | margin: 0 0 1rem; 150 | } 151 | 152 | b, 153 | strong { 154 | font-weight: bolder; 155 | } 156 | 157 | small { 158 | font-size: 0.875em; 159 | } 160 | 161 | mark { 162 | padding: 0.2em; 163 | background-color: #fcf8e3; 164 | } 165 | 166 | sub, 167 | sup { 168 | position: relative; 169 | font-size: 0.75em; 170 | line-height: 0; 171 | vertical-align: baseline; 172 | } 173 | 174 | sub { 175 | bottom: -0.25em; 176 | } 177 | 178 | sup { 179 | top: -0.5em; 180 | } 181 | 182 | a { 183 | color: #0d6efd; 184 | text-decoration: underline; 185 | } 186 | a:hover { 187 | color: #0a58ca; 188 | } 189 | 190 | a:not([href]):not([class]), a:not([href]):not([class]):hover { 191 | color: inherit; 192 | text-decoration: none; 193 | } 194 | 195 | pre, 196 | code, 197 | kbd, 198 | samp { 199 | font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 200 | font-size: 1em; 201 | direction: ltr ; 202 | unicode-bidi: bidi-override; 203 | } 204 | 205 | pre { 206 | display: block; 207 | margin-top: 0; 208 | margin-bottom: 1rem; 209 | overflow: auto; 210 | font-size: 0.875em; 211 | } 212 | pre code { 213 | font-size: inherit; 214 | color: inherit; 215 | word-break: normal; 216 | } 217 | 218 | code { 219 | font-size: 0.875em; 220 | color: #d63384; 221 | word-wrap: break-word; 222 | } 223 | a > code { 224 | color: inherit; 225 | } 226 | 227 | kbd { 228 | padding: 0.2rem 0.4rem; 229 | font-size: 0.875em; 230 | color: #fff; 231 | background-color: #212529; 232 | border-radius: 0.2rem; 233 | } 234 | kbd kbd { 235 | padding: 0; 236 | font-size: 1em; 237 | font-weight: 700; 238 | } 239 | 240 | figure { 241 | margin: 0 0 1rem; 242 | } 243 | 244 | img, 245 | svg { 246 | vertical-align: middle; 247 | } 248 | 249 | table { 250 | caption-side: bottom; 251 | border-collapse: collapse; 252 | } 253 | 254 | caption { 255 | padding-top: 0.5rem; 256 | padding-bottom: 0.5rem; 257 | color: #6c757d; 258 | text-align: right; 259 | } 260 | 261 | th { 262 | text-align: inherit; 263 | text-align: -webkit-match-parent; 264 | } 265 | 266 | thead, 267 | tbody, 268 | tfoot, 269 | tr, 270 | td, 271 | th { 272 | border-color: inherit; 273 | border-style: solid; 274 | border-width: 0; 275 | } 276 | 277 | label { 278 | display: inline-block; 279 | } 280 | 281 | button { 282 | border-radius: 0; 283 | } 284 | 285 | button:focus:not(:focus-visible) { 286 | outline: 0; 287 | } 288 | 289 | input, 290 | button, 291 | select, 292 | optgroup, 293 | textarea { 294 | margin: 0; 295 | font-family: inherit; 296 | font-size: inherit; 297 | line-height: inherit; 298 | } 299 | 300 | button, 301 | select { 302 | text-transform: none; 303 | } 304 | 305 | [role=button] { 306 | cursor: pointer; 307 | } 308 | 309 | select { 310 | word-wrap: normal; 311 | } 312 | 313 | [list]::-webkit-calendar-picker-indicator { 314 | display: none; 315 | } 316 | 317 | button, 318 | [type=button], 319 | [type=reset], 320 | [type=submit] { 321 | -webkit-appearance: button; 322 | } 323 | button:not(:disabled), 324 | [type=button]:not(:disabled), 325 | [type=reset]:not(:disabled), 326 | [type=submit]:not(:disabled) { 327 | cursor: pointer; 328 | } 329 | 330 | ::-moz-focus-inner { 331 | padding: 0; 332 | border-style: none; 333 | } 334 | 335 | textarea { 336 | resize: vertical; 337 | } 338 | 339 | fieldset { 340 | min-width: 0; 341 | padding: 0; 342 | margin: 0; 343 | border: 0; 344 | } 345 | 346 | legend { 347 | float: right; 348 | width: 100%; 349 | padding: 0; 350 | margin-bottom: 0.5rem; 351 | font-size: calc(1.275rem + 0.3vw); 352 | line-height: inherit; 353 | } 354 | @media (min-width: 1200px) { 355 | legend { 356 | font-size: 1.5rem; 357 | } 358 | } 359 | legend + * { 360 | clear: right; 361 | } 362 | 363 | ::-webkit-datetime-edit-fields-wrapper, 364 | ::-webkit-datetime-edit-text, 365 | ::-webkit-datetime-edit-minute, 366 | ::-webkit-datetime-edit-hour-field, 367 | ::-webkit-datetime-edit-day-field, 368 | ::-webkit-datetime-edit-month-field, 369 | ::-webkit-datetime-edit-year-field { 370 | padding: 0; 371 | } 372 | 373 | ::-webkit-inner-spin-button { 374 | height: auto; 375 | } 376 | 377 | [type=search] { 378 | outline-offset: -2px; 379 | -webkit-appearance: textfield; 380 | } 381 | 382 | [type="tel"], 383 | [type="url"], 384 | [type="email"], 385 | [type="number"] { 386 | direction: ltr; 387 | } 388 | ::-webkit-search-decoration { 389 | -webkit-appearance: none; 390 | } 391 | 392 | ::-webkit-color-swatch-wrapper { 393 | padding: 0; 394 | } 395 | 396 | ::file-selector-button { 397 | font: inherit; 398 | } 399 | 400 | ::-webkit-file-upload-button { 401 | font: inherit; 402 | -webkit-appearance: button; 403 | } 404 | 405 | output { 406 | display: inline-block; 407 | } 408 | 409 | iframe { 410 | border: 0; 411 | } 412 | 413 | summary { 414 | display: list-item; 415 | cursor: pointer; 416 | } 417 | 418 | progress { 419 | vertical-align: baseline; 420 | } 421 | 422 | [hidden] { 423 | display: none !important; 424 | } 425 | /*# sourceMappingURL=bootstrap-reboot.rtl.css.map */ -------------------------------------------------------------------------------- /assets/vendor/bootstrap/css/bootstrap-reboot.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v5.0.0-beta2 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors 4 | * Copyright 2011-2021 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | *, 9 | *::before, 10 | *::after { 11 | box-sizing: border-box; 12 | } 13 | 14 | @media (prefers-reduced-motion: no-preference) { 15 | :root { 16 | scroll-behavior: smooth; 17 | } 18 | } 19 | 20 | body { 21 | margin: 0; 22 | font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; 23 | font-size: 1rem; 24 | font-weight: 400; 25 | line-height: 1.5; 26 | color: #212529; 27 | background-color: #fff; 28 | -webkit-text-size-adjust: 100%; 29 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 30 | } 31 | 32 | [tabindex="-1"]:focus:not(:focus-visible) { 33 | outline: 0 !important; 34 | } 35 | 36 | hr { 37 | margin: 1rem 0; 38 | color: inherit; 39 | background-color: currentColor; 40 | border: 0; 41 | opacity: 0.25; 42 | } 43 | 44 | hr:not([size]) { 45 | height: 1px; 46 | } 47 | 48 | h6, h5, h4, h3, h2, h1 { 49 | margin-top: 0; 50 | margin-bottom: 0.5rem; 51 | font-weight: 500; 52 | line-height: 1.2; 53 | } 54 | 55 | h1 { 56 | font-size: calc(1.375rem + 1.5vw); 57 | } 58 | @media (min-width: 1200px) { 59 | h1 { 60 | font-size: 2.5rem; 61 | } 62 | } 63 | 64 | h2 { 65 | font-size: calc(1.325rem + 0.9vw); 66 | } 67 | @media (min-width: 1200px) { 68 | h2 { 69 | font-size: 2rem; 70 | } 71 | } 72 | 73 | h3 { 74 | font-size: calc(1.3rem + 0.6vw); 75 | } 76 | @media (min-width: 1200px) { 77 | h3 { 78 | font-size: 1.75rem; 79 | } 80 | } 81 | 82 | h4 { 83 | font-size: calc(1.275rem + 0.3vw); 84 | } 85 | @media (min-width: 1200px) { 86 | h4 { 87 | font-size: 1.5rem; 88 | } 89 | } 90 | 91 | h5 { 92 | font-size: 1.25rem; 93 | } 94 | 95 | h6 { 96 | font-size: 1rem; 97 | } 98 | 99 | p { 100 | margin-top: 0; 101 | margin-bottom: 1rem; 102 | } 103 | 104 | abbr[title], 105 | abbr[data-bs-original-title] { 106 | text-decoration: underline; 107 | -webkit-text-decoration: underline dotted; 108 | text-decoration: underline dotted; 109 | cursor: help; 110 | -webkit-text-decoration-skip-ink: none; 111 | text-decoration-skip-ink: none; 112 | } 113 | 114 | address { 115 | margin-bottom: 1rem; 116 | font-style: normal; 117 | line-height: inherit; 118 | } 119 | 120 | ol, 121 | ul { 122 | padding-left: 2rem; 123 | } 124 | 125 | ol, 126 | ul, 127 | dl { 128 | margin-top: 0; 129 | margin-bottom: 1rem; 130 | } 131 | 132 | ol ol, 133 | ul ul, 134 | ol ul, 135 | ul ol { 136 | margin-bottom: 0; 137 | } 138 | 139 | dt { 140 | font-weight: 700; 141 | } 142 | 143 | dd { 144 | margin-bottom: 0.5rem; 145 | margin-left: 0; 146 | } 147 | 148 | blockquote { 149 | margin: 0 0 1rem; 150 | } 151 | 152 | b, 153 | strong { 154 | font-weight: bolder; 155 | } 156 | 157 | small { 158 | font-size: 0.875em; 159 | } 160 | 161 | mark { 162 | padding: 0.2em; 163 | background-color: #fcf8e3; 164 | } 165 | 166 | sub, 167 | sup { 168 | position: relative; 169 | font-size: 0.75em; 170 | line-height: 0; 171 | vertical-align: baseline; 172 | } 173 | 174 | sub { 175 | bottom: -0.25em; 176 | } 177 | 178 | sup { 179 | top: -0.5em; 180 | } 181 | 182 | a { 183 | color: #0d6efd; 184 | text-decoration: underline; 185 | } 186 | a:hover { 187 | color: #0a58ca; 188 | } 189 | 190 | a:not([href]):not([class]), a:not([href]):not([class]):hover { 191 | color: inherit; 192 | text-decoration: none; 193 | } 194 | 195 | pre, 196 | code, 197 | kbd, 198 | samp { 199 | font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 200 | font-size: 1em; 201 | direction: ltr /* rtl:ignore */; 202 | unicode-bidi: bidi-override; 203 | } 204 | 205 | pre { 206 | display: block; 207 | margin-top: 0; 208 | margin-bottom: 1rem; 209 | overflow: auto; 210 | font-size: 0.875em; 211 | } 212 | pre code { 213 | font-size: inherit; 214 | color: inherit; 215 | word-break: normal; 216 | } 217 | 218 | code { 219 | font-size: 0.875em; 220 | color: #d63384; 221 | word-wrap: break-word; 222 | } 223 | a > code { 224 | color: inherit; 225 | } 226 | 227 | kbd { 228 | padding: 0.2rem 0.4rem; 229 | font-size: 0.875em; 230 | color: #fff; 231 | background-color: #212529; 232 | border-radius: 0.2rem; 233 | } 234 | kbd kbd { 235 | padding: 0; 236 | font-size: 1em; 237 | font-weight: 700; 238 | } 239 | 240 | figure { 241 | margin: 0 0 1rem; 242 | } 243 | 244 | img, 245 | svg { 246 | vertical-align: middle; 247 | } 248 | 249 | table { 250 | caption-side: bottom; 251 | border-collapse: collapse; 252 | } 253 | 254 | caption { 255 | padding-top: 0.5rem; 256 | padding-bottom: 0.5rem; 257 | color: #6c757d; 258 | text-align: left; 259 | } 260 | 261 | th { 262 | text-align: inherit; 263 | text-align: -webkit-match-parent; 264 | } 265 | 266 | thead, 267 | tbody, 268 | tfoot, 269 | tr, 270 | td, 271 | th { 272 | border-color: inherit; 273 | border-style: solid; 274 | border-width: 0; 275 | } 276 | 277 | label { 278 | display: inline-block; 279 | } 280 | 281 | button { 282 | border-radius: 0; 283 | } 284 | 285 | button:focus:not(:focus-visible) { 286 | outline: 0; 287 | } 288 | 289 | input, 290 | button, 291 | select, 292 | optgroup, 293 | textarea { 294 | margin: 0; 295 | font-family: inherit; 296 | font-size: inherit; 297 | line-height: inherit; 298 | } 299 | 300 | button, 301 | select { 302 | text-transform: none; 303 | } 304 | 305 | [role=button] { 306 | cursor: pointer; 307 | } 308 | 309 | select { 310 | word-wrap: normal; 311 | } 312 | 313 | [list]::-webkit-calendar-picker-indicator { 314 | display: none; 315 | } 316 | 317 | button, 318 | [type=button], 319 | [type=reset], 320 | [type=submit] { 321 | -webkit-appearance: button; 322 | } 323 | button:not(:disabled), 324 | [type=button]:not(:disabled), 325 | [type=reset]:not(:disabled), 326 | [type=submit]:not(:disabled) { 327 | cursor: pointer; 328 | } 329 | 330 | ::-moz-focus-inner { 331 | padding: 0; 332 | border-style: none; 333 | } 334 | 335 | textarea { 336 | resize: vertical; 337 | } 338 | 339 | fieldset { 340 | min-width: 0; 341 | padding: 0; 342 | margin: 0; 343 | border: 0; 344 | } 345 | 346 | legend { 347 | float: left; 348 | width: 100%; 349 | padding: 0; 350 | margin-bottom: 0.5rem; 351 | font-size: calc(1.275rem + 0.3vw); 352 | line-height: inherit; 353 | } 354 | @media (min-width: 1200px) { 355 | legend { 356 | font-size: 1.5rem; 357 | } 358 | } 359 | legend + * { 360 | clear: left; 361 | } 362 | 363 | ::-webkit-datetime-edit-fields-wrapper, 364 | ::-webkit-datetime-edit-text, 365 | ::-webkit-datetime-edit-minute, 366 | ::-webkit-datetime-edit-hour-field, 367 | ::-webkit-datetime-edit-day-field, 368 | ::-webkit-datetime-edit-month-field, 369 | ::-webkit-datetime-edit-year-field { 370 | padding: 0; 371 | } 372 | 373 | ::-webkit-inner-spin-button { 374 | height: auto; 375 | } 376 | 377 | [type=search] { 378 | outline-offset: -2px; 379 | -webkit-appearance: textfield; 380 | } 381 | 382 | /* rtl:raw: 383 | [type="tel"], 384 | [type="url"], 385 | [type="email"], 386 | [type="number"] { 387 | direction: ltr; 388 | } 389 | */ 390 | ::-webkit-search-decoration { 391 | -webkit-appearance: none; 392 | } 393 | 394 | ::-webkit-color-swatch-wrapper { 395 | padding: 0; 396 | } 397 | 398 | ::file-selector-button { 399 | font: inherit; 400 | } 401 | 402 | ::-webkit-file-upload-button { 403 | font: inherit; 404 | -webkit-appearance: button; 405 | } 406 | 407 | output { 408 | display: inline-block; 409 | } 410 | 411 | iframe { 412 | border: 0; 413 | } 414 | 415 | summary { 416 | display: list-item; 417 | cursor: pointer; 418 | } 419 | 420 | progress { 421 | vertical-align: baseline; 422 | } 423 | 424 | [hidden] { 425 | display: none !important; 426 | } 427 | 428 | /*# sourceMappingURL=bootstrap-reboot.css.map */ -------------------------------------------------------------------------------- /routes/auth.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const passport = require('passport'); 4 | var crypto = require('crypto'); 5 | const bcrypt = require('bcrypt'); 6 | var async = require('async'); 7 | var nodemailer = require('nodemailer'); 8 | 9 | //IMporting models 10 | var User = require('../models/user'); 11 | 12 | router.get('/',function(req,res){ 13 | res.render('index'); 14 | }); 15 | 16 | router.get('/forgot',function(req,res){ 17 | var messages = req.flash(); 18 | res.render('Forgotpassword',{user:req.user,messages:messages}); 19 | }); 20 | 21 | router.post('/forgot', function(req, res, next) { 22 | console.log("POST route"); 23 | async.waterfall([ 24 | function(done) { 25 | crypto.randomBytes(20, function(err, buf) { 26 | var token = buf.toString('hex'); 27 | done(err, token); 28 | }); 29 | }, 30 | function(token, done) { 31 | User.findOne({ email: req.body.email }, function(err, user) { 32 | if (!user) { 33 | req.flash('error', 'No account with that email address exists.'); 34 | console.log('Cannot find user'); 35 | return res.redirect('/forgot'); 36 | } 37 | 38 | user.resetPasswordToken = token; 39 | user.resetPasswordExpires = Date. now() + 3600000; // 1 hour 40 | 41 | user.save(function(err) { 42 | console.log("Hello") 43 | done(err, token, user); 44 | }); 45 | }); 46 | }, 47 | function(token, user, done) { 48 | 49 | var url = req.protocol + '://' + req.headers.host + '/reset/' + token; 50 | var smtpTransport = nodemailer.createTransport({ 51 | service: 'gmail', 52 | auth: { 53 | user: 'vinit.mundra@somaiya.edu', 54 | pass: process.env.EMAIL_PASS 55 | } 56 | }); 57 | var mailOptions = { 58 | to: user.email, 59 | from: 'vinit.mundra@somaiya.edu', 60 | subject: 'Password Reset for your Lostbox account', 61 | // text: 'You are receiving this because you (or someone else) have requested the reset of the password for your account.\n\n' + 62 | // 'Please click on the following link, or paste this into your browser to complete the process:\n\n' + 63 | // 'http://' + req.headers.host + '/reset/' + token + '\n\n' + 64 | // 'If you did not request this, please ignore this email and your password will remain unchanged.\n', 65 | html: `
66 | 67 |

Hi ${ user.email }

68 |

We got a request to reset your Lostbox Password.

69 |
70 | Reset Password 76 |
77 |

If you ignore this message your password will not be changed. 78 | 79 | 80 |

` 81 | }; 82 | smtpTransport.sendMail(mailOptions, function(err) { 83 | req.flash('info', 'An e-mail has been sent to ' + user.email + ' with further instructions.'); 84 | console.log(err); 85 | done(err, 'done'); 86 | }); 87 | } 88 | ], function(err) { 89 | if (err) return next(err); 90 | res.redirect('/forgot'); 91 | }); 92 | }); 93 | 94 | router.get('/reset/:token', function(req, res) { 95 | User.findOne({ resetPasswordToken: req.params.token, resetPasswordExpires: { $gt: Date.now() } }, function(err, user) { 96 | if (!user) { 97 | console.log("Found incorrect token"); 98 | req.flash('error', 'Password reset token is invalid or has expired.'); 99 | return res.redirect('/forgot'); 100 | } 101 | //console.log("Found correct token"); 102 | var messages = req.flash(); 103 | res.render('ResetPassword', { 104 | user: req.user, 105 | messages: messages 106 | }); 107 | }); 108 | }); 109 | 110 | //Reset Password here 111 | router.post('/reset', function(req, res) { 112 | var password = req.body.password; 113 | var cpassword = req.body.cpassword; 114 | var token = req.body.token; 115 | var url = "/reset/".concat(token); 116 | if( password == '' || cpassword == ''){ 117 | req.flash('error','Enter all fields'); 118 | return res.redirect(url); 119 | } 120 | if( password != cpassword){ 121 | req.flash('error','Passwords do not match'); 122 | return res.redirect(url); 123 | } 124 | async.waterfall([ 125 | function(done) { 126 | User.findOne({ resetPasswordToken: req.body.token, resetPasswordExpires: { $gt: Date.now() } }, function(err, user) { 127 | if (!user) { 128 | req.flash('error', 'Password reset token is invalid or has expired.'); 129 | console.log(req.body.token); 130 | return res.redirect('back'); 131 | } 132 | console.log("Inside"); 133 | user.password = bcrypt.hashSync(req.body.password, 10); 134 | user.resetPasswordToken = undefined; 135 | user.resetPasswordExpires = undefined; 136 | 137 | user.save(function(err) { 138 | // req.logIn(user, function(err) { 139 | done(err, user); 140 | // }); 141 | }); 142 | }); 143 | }, 144 | ], function(err) { 145 | res.redirect('/logIn'); 146 | }); 147 | }); 148 | 149 | router.get('/Signup', function (req, res) { 150 | var messages = req.flash('error'); 151 | res.render('signup',{messages: messages, hasError: messages.length > 0 }); 152 | }); 153 | 154 | router.post('/Signup', passport.authenticate('local.signup', { 155 | failureRedirect: '/Signup', 156 | failureFlash: true 157 | }),function(req,res){ 158 | 159 | if(req.session.oldUrl){ 160 | var oldUrl = req.session.oldUrl; 161 | req.session.oldUrl = null; 162 | res.redirect(oldUrl); 163 | } else { 164 | User.findOne({'email': req.body.email}, function(err, user){ 165 | 166 | res.redirect('/LogIn'); 167 | }); 168 | } 169 | 170 | }); 171 | 172 | router.get('/LogIn',function (req, res) { 173 | var messages = req.flash('error'); 174 | res.render('login',{messages: messages, hasError: messages.length > 0 }); 175 | }); 176 | 177 | router.post('/LogIn', passport.authenticate('local.signin', { 178 | failureRedirect: '/LogIn', 179 | failureFlash: true 180 | }), function(req,res){ 181 | if(req.session.oldUrl){ 182 | var oldUrl = req.session.oldUrl; 183 | req.session.oldUrl = null; 184 | res.redirect(oldUrl); 185 | } else { 186 | User.findOne({'email': req.body.email}, function(err, user){ 187 | if(user.isAdmin){ 188 | console.log(user); 189 | res.redirect('/admin'); 190 | } 191 | else{ 192 | 193 | res.redirect('/'); 194 | } 195 | }); 196 | } 197 | 198 | }); 199 | 200 | 201 | router.get('/logIn/google',passport.authenticate('google',{scope:['profile','email']})); 202 | 203 | router.get('/logIn/google/callback',passport.authenticate('google',{failureRedirect:'/logIn'}), 204 | function(req,res){ 205 | res.redirect('/'); 206 | }); 207 | 208 | router.get('/logout', function(req, res, next){ 209 | req.logout(); 210 | req.session.destroy(); 211 | res.redirect('/'); 212 | }); 213 | 214 | module.exports = router; 215 | -------------------------------------------------------------------------------- /routes/post.js: -------------------------------------------------------------------------------- 1 | const { isAuthenticated, unauthorised } = require('../config/auth_required'); 2 | const express = require('express'); 3 | const router = express.Router(); 4 | const multer = require('multer'); 5 | const path = require('path'); 6 | 7 | const Post = require('../models/post'); 8 | 9 | const MIME_TYPE_MAP = { 10 | "image/png": "png", 11 | "image/jpeg": "jpg", 12 | "image/jpg": "jpg" 13 | }; 14 | 15 | const storage = multer.diskStorage({ 16 | destination: (req, file, cb) => { 17 | const isValid = MIME_TYPE_MAP[file.mimetype]; 18 | let error = new Error("Invalid mime type"); 19 | if (isValid) { 20 | error = null; 21 | } 22 | cb(error, "images/"); 23 | }, 24 | filename: (req, file, cb) => { 25 | const name = file.originalname 26 | .toLowerCase() 27 | .split(" ") 28 | .join("-"); 29 | const ext = MIME_TYPE_MAP[file.mimetype]; 30 | cb(null, name); 31 | } 32 | }); 33 | 34 | 35 | //Create 36 | router.post("/post/create",unauthorised,multer({ storage: storage }).single("photo"),(req, res, next) => { 37 | 38 | if(req.file == undefined){ 39 | req.flash('error','Please upload an image'); 40 | res.redirect("/post/create"); 41 | } 42 | else{ 43 | data=path.join('/images/' + req.file.filename); 44 | var path2 = data.replace(/\\/g, '/'); 45 | var title = req.body.title; 46 | var description=req.body.description; 47 | var category=req.body.category; 48 | var location=req.body.location; 49 | var color=req.body.color; 50 | var brand = req.body.brand; 51 | console.log(req.body); 52 | 53 | var newPost = new Post( 54 | { 55 | category_name:category, 56 | posts:[{ 57 | title:title, 58 | category:category, 59 | description:description, 60 | location:location, 61 | color:color, 62 | brandname:brand, 63 | photo:path2, 64 | postedBy:req.user._id, 65 | }] 66 | }); 67 | var newPost1 = [{ 68 | title:title, 69 | category:category, 70 | description:description, 71 | location:location, 72 | color:color, 73 | brandname:brand, 74 | photo:path2, 75 | postedBy:req.user._id, 76 | }]; 77 | 78 | if(title.length == 0 || description.length == 0 || category.length == 0 || location.length == 0 || color.length == 0 || brand.length == 0){ 79 | console.log("err ke andar"); 80 | req.flash('error', 'Please fill all the fields'); 81 | res.redirect("/post/create"); 82 | } 83 | else{ 84 | Post.find({"category_name":category},function(err,result){ 85 | if(err) console.log(err); 86 | if(result.length!=0){ 87 | Post.updateOne({"category_name":category},{$push:{"posts":newPost1}},function(err,doc){ 88 | if(err){ 89 | console.log(err); 90 | } 91 | else{ 92 | res.redirect('/'); 93 | } 94 | }) 95 | }else{ 96 | newPost.save(function(err,result){ 97 | if(err) console.log(err); 98 | else{ 99 | req.flash('success', 'Sucessfully added Post'); 100 | res.redirect("/"); 101 | } 102 | }); 103 | } 104 | }); 105 | } 106 | } 107 | 108 | }); 109 | 110 | 111 | //Edit 112 | router.put('/post/:name/:id',unauthorised,multer({ storage: storage }).single("photo"),(req, res, next) => { 113 | var successMsg = req.flash('success')[0]; 114 | var postId = req.params.id; 115 | 116 | console.log(req.body); 117 | if(req.file == undefined){ 118 | req.flash('error','Please upload an image'); 119 | res.redirect("/post/${req.params.name}/${req.params.id}/edit"); 120 | } 121 | else{ 122 | 123 | data=path.join('/images/' + req.file.filename); 124 | var path2 = data.replace(/\\/g, '/'); 125 | var title = req.body.title; 126 | var description=req.body.description; 127 | var category=req.params.name; 128 | var location=req.body.location; 129 | var datetime=req.body.datetime; 130 | var color=req.body.color; 131 | var brand = req.body.brand; 132 | 133 | if(title.length == 0 || description.length == 0 || category.length == 0 || location.length == 0 134 | || datetime.length == 0|| color.length == 0 || brand.length == 0){ 135 | console.log("err ke andar"); 136 | req.flash('error', 'Please fill all the fields'); 137 | res.redirect("/post/${req.params.name}/${req.params.id}/edit"); 138 | } 139 | else{ 140 | Post.findOneAndUpdate({ "posts._id": postId },{$set:{ 141 | 'posts.$.title': title, 142 | 'posts.$.category': category, 143 | 'posts.$.description': description, 144 | 'posts.$.location': location, 145 | 'posts.$.photo': path2, 146 | 'posts.$.brandname': brand, 147 | 'posts.$.color': color, 148 | 'posts.$.datetime': datetime, 149 | 'posts.$.postedBy': req.user._id, 150 | 'posts.$.updated': Date.now(), 151 | }}, 152 | {new:true},function(err,post){ 153 | if(err){ 154 | res.redirect("/post/${req.params.id}/edit"); 155 | } 156 | else{ 157 | 158 | req.flash('success', 'Sucessfully Updated post'); 159 | res.redirect("/"); 160 | } 161 | }); 162 | } 163 | } 164 | }) 165 | 166 | router.get('/post/create',isAuthenticated,function(req,res){ 167 | var errMsg = req.flash('error')[0]; 168 | //console.log("1"); 169 | res.render('upload',{currentUser: req.user,errMsg: errMsg, noMessages: !errMsg }); 170 | }); 171 | 172 | router.get('/post/:name/:id/edit',isAuthenticated,function(req,res){ 173 | var errMsg = req.flash('error')[0]; 174 | var postId = req.params.id; 175 | //console.log("1"); 176 | Post.find({ "posts._id" : postId},{posts:{ $elemMatch:{_id:postId}}},function(err,result){ 177 | if(err) 178 | { 179 | //res.redirect('/box'); 180 | } 181 | else{ 182 | var data=result[0]; 183 | //console.log(data); 184 | res.render("edit",{post:data,errMsg: errMsg, noMessages: !errMsg}) 185 | } 186 | }) 187 | }); 188 | 189 | //Delete 190 | router.delete('/post/:id',isAuthenticated,function(req,res){ 191 | Post.findOneAndUpdate({"posts._id" : req.params.id},{$pull:{"posts":{_id:req.params.id}}},function(err){ 192 | if(err){ 193 | res.redirect('/'); 194 | } 195 | else{ 196 | console.log("deleted"); 197 | req.flash('success','Post Deleted sucessfully'); 198 | res.redirect("/"); 199 | } 200 | }); 201 | }); 202 | 203 | // router.get('/box',isAuthenticated,function(req,res){ 204 | // Post.find({},function(err,allposts){ 205 | // if(err) 206 | // { 207 | // console.log(err); 208 | // } 209 | // else{ 210 | // console.log(allposts); 211 | // //res.render('thebox',{posts:allposts,currentUser:req.user}); 212 | // } 213 | // }); 214 | // }); 215 | 216 | router.get('/box/:id',isAuthenticated,function(req,res){ 217 | var postid=req.params.id; 218 | var currentUser = req.user; 219 | var category = "cards"; 220 | 221 | Post.find({ "posts._id" : postid},{posts:{ $elemMatch:{_id:postid}}}) 222 | .populate('posts.postedBy') 223 | .exec(function(err,result){ 224 | if(err){ 225 | console.log(err); 226 | } 227 | else 228 | { 229 | console.log(result); 230 | var data = result[0]; 231 | res.render("item", {data:data,currentUser:currentUser,category:category}); 232 | } 233 | }); 234 | 235 | 236 | }); 237 | 238 | 239 | //router.put("/post/:postId", isAuthenticated , isPoster, updatePost); 240 | 241 | module.exports = router; -------------------------------------------------------------------------------- /views/payment.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | The Box 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 103 | 104 | 105 |
106 |
107 |
108 | 109 |
110 | 111 | 112 | 113 | 114 |
115 | 116 | 117 | 118 |
119 | 120 |
121 |
122 | 123 | 124 |
125 | 126 | 127 |
128 | 129 |
130 |
131 | 132 | 133 | 134 | 135 |
136 | 137 | 138 | 139 | 162 | 163 | 164 | 191 | 192 | 216 |
217 | 218 | 219 | --------------------------------------------------------------------------------