├── Backend ├── EJS │ ├── data.json │ ├── index.js │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── CSS │ │ │ └── style.css │ │ └── JS │ │ │ └── style.js │ └── views │ │ ├── datanotfound.ejs │ │ ├── includes │ │ └── head.ejs │ │ ├── index.ejs │ │ ├── instagram.ejs │ │ └── rolldice.ejs ├── Express │ ├── ExpressError.js │ ├── index.js │ ├── package-lock.json │ └── package.json ├── MISCELLANEOUS │ ├── BACKEND │ │ ├── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── views │ │ │ └── hello.ejs │ └── FRONTEND │ │ └── index.html ├── MongoDB-CLASS │ ├── MongoDB-Express │ │ ├── ExpressError.js │ │ ├── index.js │ │ ├── init.js │ │ ├── models │ │ │ └── chat.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── style.css │ │ └── views │ │ │ ├── edit.ejs │ │ │ ├── index.ejs │ │ │ └── new.ejs │ ├── MongoDB-JS │ │ ├── books.js │ │ ├── index.js │ │ ├── package-lock.json │ │ └── package.json │ └── MongoDB-Relationships │ │ ├── Models │ │ ├── customer.js │ │ ├── post.js │ │ └── user.js │ │ └── package.json ├── REST-CLASS │ ├── index.js │ ├── package-lock.json │ ├── package.json │ ├── public │ │ └── style.css │ └── views │ │ ├── edit.ejs │ │ ├── index.ejs │ │ ├── new.ejs │ │ ├── post.ejs │ │ └── show.ejs ├── SQL-CLASS │ ├── index.js │ ├── package-lock.json │ ├── package.json │ ├── schema.sql │ └── views │ │ ├── delete.ejs │ │ ├── edit.ejs │ │ ├── home.ejs │ │ ├── new.ejs │ │ └── user.ejs ├── math.js ├── package-lock.json ├── package.json └── script.js ├── CSS ├── Bootstrap │ └── index.html ├── CSS Mini Project │ ├── index.html │ ├── photo.jpg │ └── style.css ├── CSS Project │ └── SPOTIFY CLONE │ │ ├── assets │ │ ├── album_img.jpg │ │ ├── backward_icon.png │ │ ├── card1img.jpeg │ │ ├── card2img.jpeg │ │ ├── card3img.jpeg │ │ ├── card4img.jpeg │ │ ├── card5img.jpeg │ │ ├── card6img.jpeg │ │ ├── forward_icon.png │ │ ├── library_icon.png │ │ ├── logo.png │ │ ├── play_musicbar.png │ │ ├── player_icon1.png │ │ ├── player_icon2.png │ │ ├── player_icon3.png │ │ ├── player_icon4.png │ │ └── player_icon5.png │ │ ├── index.html │ │ └── style.css ├── Chapter-1 │ ├── index.html │ └── style.css ├── Chapter-2 │ ├── PracticeQs.css │ ├── PracticeQs.html │ ├── index.html │ ├── inheritance_demo.html │ ├── inheritance_style.css │ └── style.css ├── Chapter-3 │ ├── index.html │ └── style.css ├── Chapter-4 │ ├── Hover Card Effect │ │ ├── Cartoon Cute Girl&Boy.jpg │ │ ├── DigitalOcean Smiley 02.jpg │ │ ├── index.html │ │ └── style.css │ ├── Smiley Face.css │ ├── Smiley Face.html │ ├── index.html │ └── style.css ├── Chapter-5 │ ├── index.html │ └── style.css ├── Chapter-6 │ ├── Pet Adoption │ │ ├── cat.jpg │ │ ├── dog.jpg │ │ ├── index.html │ │ └── style.css │ ├── index.html │ └── style.css └── TailwindCSS │ ├── README.md │ ├── image.png │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── postcss.config.js │ ├── style.css │ └── tailwind.config.js ├── HTML └── HTML.html ├── JavaScript ├── Simon │ ├── index.html │ ├── script.js │ └── style.css ├── index.html └── script.js ├── My Portfolio └── Portfolio.html ├── Projects └── ExploreHut │ ├── app.js │ ├── cloudConfig.js │ ├── controllers │ ├── listing.js │ ├── review.js │ └── user.js │ ├── init │ ├── data.js │ └── index.js │ ├── models │ ├── listing.js │ ├── review.js │ └── user.js │ ├── package.json │ ├── public │ ├── CSS │ │ ├── filter.css │ │ ├── rating.css │ │ └── style.css │ └── JS │ │ └── script.js │ ├── routes │ ├── listing.js │ ├── review.js │ └── user.js │ ├── schema.js │ ├── utils │ ├── ExpressError.js │ ├── middleware.js │ └── wrapAsync.js │ └── views │ ├── error.ejs │ ├── includes │ ├── flashMessages.ejs │ ├── footer.ejs │ └── navbar.ejs │ ├── layouts │ └── boilerplate.ejs │ ├── listings │ ├── edit.ejs │ ├── index.ejs │ ├── new.ejs │ └── show.ejs │ └── users │ ├── login.ejs │ └── signup.ejs ├── REACT ├── Material-UI │ └── react-mini-project │ │ ├── .eslintrc.cjs │ │ ├── README.md │ │ ├── index.html │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── components │ │ │ ├── SearchBox.css │ │ │ ├── SearchBox.jsx │ │ │ ├── WeatherApp.jsx │ │ │ ├── WeatherInfo.css │ │ │ └── WeatherInfo.jsx │ │ ├── hooks │ │ │ └── useGeolocation.js │ │ ├── index.css │ │ └── main.jsx │ │ └── vite.config.js ├── react-class-app │ ├── .eslintrc.cjs │ ├── README.md │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── ButtonEvent.jsx │ │ ├── Form.jsx │ │ ├── Price.jsx │ │ ├── Product.css │ │ ├── Product.jsx │ │ ├── ProductTab.jsx │ │ ├── index.css │ │ └── main.jsx │ └── vite.config.js └── react-state-class │ ├── .eslintrc.cjs │ ├── README.md │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── App.css │ ├── App.jsx │ ├── Comment.css │ ├── Comment.jsx │ ├── CommentForm.css │ ├── CommentForm.jsx │ ├── Counter.jsx │ ├── DateActivity.jsx │ ├── Forms.jsx │ ├── LikeButton.jsx │ ├── UseEffect.jsx │ ├── components │ │ ├── LotteryGame │ │ │ ├── LotteryGame.css │ │ │ ├── LotteryGame.jsx │ │ │ ├── Ticket.jsx │ │ │ └── TicketNumber.jsx │ │ └── ToDoList │ │ │ ├── Task.css │ │ │ ├── Task.jsx │ │ │ ├── ToDoList.css │ │ │ └── ToDoList.jsx │ ├── index.css │ ├── main.jsx │ └── utils │ │ └── helperLotteryGame.js │ └── vite.config.js ├── README.md └── Redux └── redux-class ├── .eslintrc.cjs ├── README.md ├── index.html ├── package-lock.json ├── package.json ├── src ├── App.css ├── App.jsx ├── app │ └── store.js ├── components │ ├── AddTask.jsx │ ├── Task.jsx │ └── Todo.jsx ├── features │ └── todo │ │ └── todoSlice.js ├── index.css └── main.jsx └── vite.config.js /Backend/EJS/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "cats": { 3 | "name": "cats", 4 | "followers": 25000, 5 | "following": 5, 6 | "posts": [ 7 | { 8 | "image": "https://plus.unsplash.com/premium_photo-1677545182067-26ac518ef64f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8Y2F0c3xlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&w=800&q=60", 9 | "likes": 200, 10 | "comments": 17 11 | }, 12 | { 13 | "image": "https://images.unsplash.com/photo-1592194996308-7b43878e84a6?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8Y2F0c3xlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&w=800&q=60", 14 | "likes": 312, 15 | "comments": 19 16 | }, 17 | { 18 | "image": "https://images.unsplash.com/photo-1577023311546-cdc07a8454d9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Nnx8Y2F0c3xlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&w=800&q=60", 19 | "likes": 1065, 20 | "comments": 200 21 | } 22 | ] 23 | }, 24 | "dogs": { 25 | "name": "dogs", 26 | "followers": 75000, 27 | "following": 150, 28 | "posts": [ 29 | { 30 | "image": "https://images.unsplash.com/photo-1598133894008-61f7fdb8cc3a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Nnx8ZG9nc3xlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&w=800&q=60", 31 | "likes": 3000, 32 | "comments": 41 33 | }, 34 | { 35 | "image": "https://images.unsplash.com/photo-1552053831-71594a27632d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTd8fGRvZ3N8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=800&q=60", 36 | "likes": 2500, 37 | "comments": 32 38 | }, 39 | { 40 | "image": "https://images.unsplash.com/photo-1537151608828-ea2b11777ee8?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MjB8fGRvZ3N8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=800&q=60", 41 | "likes": 500, 42 | "comments": 6 43 | } 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Backend/EJS/index.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const path = require("path"); 3 | 4 | const app = express(); 5 | 6 | let port = 8080; 7 | 8 | app.set("view engine", "ejs"); //Setting template engine as ejs. 9 | app.set("views", path.join(__dirname, "/views")); //Setting this directory as default for views. 10 | app.use(express.static(path.join(__dirname, "/public"))); //Used to serve static files like images, CSS, and JavaScript files from a specific directory. 11 | app.use(express.static(path.join(__dirname, "/public/CSS"))); //Served static CSS file from public folder. 12 | app.use(express.static(path.join(__dirname, "/public/JS"))); //Served static JS file from public folder. 13 | 14 | /* This line is listening all request coming from the port & running it's callback function. */ 15 | app.listen(port, () => { 16 | console.log(`Server Started and Listening on port ${port}.`); 17 | }); 18 | 19 | /* Making Routs */ 20 | app.get("/", (req, res) => { 21 | res.render("index"); //Express by default search files by name, so we don't need to type file name with its exrensions. 22 | }); 23 | 24 | app.get("/rolldice", (req, res) => { 25 | let diceValue = Math.floor((Math.random() * 6) + 1); 26 | res.render("rolldice.ejs", { diceValue }); 27 | }); 28 | 29 | app.get("/ig/:username", (req, res) => { 30 | let { username } = req.params; //It is a destructuring assignment syntax. It's a concise way of extracting a property from an object and assigning it to a variable with the same name. 31 | const instaData = require("./data.json"); //Requiring JSON data file. 32 | const data = instaData[username]; 33 | if (data) { 34 | res.render("instagram.ejs", { data }); 35 | } else { 36 | res.render("datanotfound.ejs"); 37 | } 38 | }); -------------------------------------------------------------------------------- /Backend/EJS/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ejs", 3 | "version": "1.0.0", 4 | "description": "This is my own package that I created. It is created for the practicing and learning Embedded JavaScript.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "Sarvesh Devrukhakar", 11 | "license": "ISC", 12 | "dependencies": { 13 | "ejs": "^3.1.9", 14 | "express": "^4.18.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Backend/EJS/public/CSS/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: grey; 3 | } 4 | 5 | img { 6 | width: 15rem; 7 | height: auto; 8 | } -------------------------------------------------------------------------------- /Backend/EJS/public/JS/style.js: -------------------------------------------------------------------------------- 1 | const btns = document.querySelectorAll("button"); 2 | 3 | for (btn of btns) { 4 | btn.addEventListener("click", () => { 5 | console.log("Button clicked!"); 6 | }); 7 | } -------------------------------------------------------------------------------- /Backend/EJS/views/datanotfound.ejs: -------------------------------------------------------------------------------- 1 | <%- include("includes/head.ejs"); %> 2 | 3 |
4 |