├── backend ├── images │ ├── 1664423418489b3.jpg │ ├── 1664423473954b3.jpg │ ├── 1664423538138b3.jpg │ ├── 1664423554538b3.jpg │ ├── 1664424804758b8.jpg │ ├── 1664425717411b1.jpg │ ├── 1664425735539b4.jpg │ ├── 1664429229042b1.jpg │ ├── 1664429571850b1.jpg │ ├── 1664429678057b1.jpg │ ├── 1664429807216b1.jpg │ ├── 1664432862672b2.jpg │ ├── 1664432948471b9.jpg │ ├── 1664433840037b7.jpg │ ├── 1664632796537b1.jpg │ ├── 1664632874890b5.jpg │ ├── 1664632949770b7.jpg │ ├── 1664632978081b6.jpg │ └── file.png ├── index.js ├── model │ ├── category.js │ ├── post.js │ └── user.js ├── package-lock.json ├── package.json └── routes │ ├── auth.js │ ├── categories.js │ ├── posts.js │ └── user.js └── frontend ├── README.md ├── package-lock.json ├── package.json ├── public ├── favicon.png ├── images │ ├── blogs │ │ ├── b1.jpg │ │ ├── b10.jpg │ │ ├── b2.jpg │ │ ├── b3.jpg │ │ ├── b4.jpg │ │ ├── b5.jpg │ │ ├── b6.jpg │ │ ├── b7.jpg │ │ ├── b8.jpg │ │ └── b9.jpg │ ├── category │ │ ├── ca1.png │ │ ├── ca10.png │ │ ├── ca11.png │ │ ├── ca12.jpg │ │ ├── ca2.png │ │ ├── ca3.png │ │ ├── ca4.png │ │ ├── ca5.png │ │ ├── ca6.png │ │ ├── ca7.png │ │ ├── ca8.png │ │ └── ca9.png │ ├── product │ │ ├── product1.jpg │ │ ├── product10.png │ │ ├── product11.png │ │ ├── product12.jpg │ │ ├── product13.jpg │ │ ├── product14.png │ │ ├── product15.png │ │ ├── product16.png │ │ ├── product17.png │ │ ├── product18.png │ │ ├── product19.png │ │ ├── product2.jpg │ │ ├── product20.png │ │ ├── product21.jpg │ │ ├── product22.png │ │ ├── product23.jpg │ │ ├── product24.png │ │ ├── product3.jpg │ │ ├── product3.png │ │ ├── product4.jpg │ │ ├── product5.png │ │ ├── product6.jpg │ │ ├── product7.jpg │ │ ├── product7.png │ │ ├── product8.png │ │ └── product9.png │ └── slide │ │ ├── slide1.png │ │ ├── slide2.png │ │ ├── slide3.png │ │ └── slide4.png └── index.html └── src ├── App.js ├── assets ├── data │ └── data.js └── images │ ├── input.png │ ├── logo.svg │ ├── my-account.jpg │ ├── not-found-alt.svg │ ├── product1.jpg │ └── product2.jpg ├── components ├── blog │ ├── Card.jsx │ └── blog.css ├── category │ ├── Category.jsx │ └── category.css ├── create │ ├── Create.jsx │ └── create.css ├── footer │ └── Footer.jsx └── header │ ├── Header.jsx │ ├── User.jsx │ └── header.css ├── context ├── Action.js ├── Context.js └── Reducer.js ├── index.css ├── index.js └── pages ├── account ├── Account.jsx └── account.css ├── details ├── DetailsPages.jsx ├── createpost.jsx └── details.css ├── home └── Home.jsx └── login ├── Login.jsx ├── Regsiter.jsx └── login.css /backend/images/1664423418489b3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664423418489b3.jpg -------------------------------------------------------------------------------- /backend/images/1664423473954b3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664423473954b3.jpg -------------------------------------------------------------------------------- /backend/images/1664423538138b3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664423538138b3.jpg -------------------------------------------------------------------------------- /backend/images/1664423554538b3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664423554538b3.jpg -------------------------------------------------------------------------------- /backend/images/1664424804758b8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664424804758b8.jpg -------------------------------------------------------------------------------- /backend/images/1664425717411b1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664425717411b1.jpg -------------------------------------------------------------------------------- /backend/images/1664425735539b4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664425735539b4.jpg -------------------------------------------------------------------------------- /backend/images/1664429229042b1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664429229042b1.jpg -------------------------------------------------------------------------------- /backend/images/1664429571850b1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664429571850b1.jpg -------------------------------------------------------------------------------- /backend/images/1664429678057b1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664429678057b1.jpg -------------------------------------------------------------------------------- /backend/images/1664429807216b1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664429807216b1.jpg -------------------------------------------------------------------------------- /backend/images/1664432862672b2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664432862672b2.jpg -------------------------------------------------------------------------------- /backend/images/1664432948471b9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664432948471b9.jpg -------------------------------------------------------------------------------- /backend/images/1664433840037b7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664433840037b7.jpg -------------------------------------------------------------------------------- /backend/images/1664632796537b1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664632796537b1.jpg -------------------------------------------------------------------------------- /backend/images/1664632874890b5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664632874890b5.jpg -------------------------------------------------------------------------------- /backend/images/1664632949770b7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664632949770b7.jpg -------------------------------------------------------------------------------- /backend/images/1664632978081b6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/1664632978081b6.jpg -------------------------------------------------------------------------------- /backend/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/backend/images/file.png -------------------------------------------------------------------------------- /backend/index.js: -------------------------------------------------------------------------------- 1 | //---- step : 1.1 2 | const express = require("express") 3 | const app = express() 4 | const dotenv = require("dotenv") 5 | const mongoose = require("mongoose") 6 | 7 | //---- step : 3 8 | const multer = require("multer") 9 | const path = require("path") 10 | 11 | //---- step : 2.1 12 | const authRoute = require("./routes/auth") 13 | const authUser = require("./routes/user") 14 | const authPost = require("./routes/posts") 15 | const authCat = require("./routes/categories") 16 | 17 | //---- step : 1 18 | dotenv.config() 19 | //---- step : 2.2 20 | app.use(express.json()) 21 | //---- step : 2.3 last ma file crate garne time 22 | app.use("/images", express.static(path.join(__dirname, "/images"))) 23 | 24 | //---- step : 1.3 25 | mongoose 26 | .connect(process.env.CONNECTION_URL, { 27 | useNewUrlParser: true, 28 | useUnifiedTopology: true, 29 | /* useCreateIndex: true, 30 | useFindAndModify: true,*/ 31 | }) 32 | .then(console.log("Connected to MongoDB")) 33 | .catch((err) => console.log(err)) 34 | 35 | //---- step : 3 36 | const storage = multer.diskStorage({ 37 | destination: (req, file, callb) => { 38 | callb(null, "images") 39 | }, 40 | filename: (req, file, callb) => { 41 | //callb(null, "file.png") 42 | callb(null, req.body.name) 43 | }, 44 | }) 45 | const upload = multer({ storage: storage }) 46 | app.post("/upload", upload.single("file"), (req, res) => { 47 | res.status(200).json("File has been uploaded") 48 | }) 49 | 50 | //---- step : 2 51 | app.use("/auth", authRoute) 52 | app.use("/users", authUser) 53 | app.use("/posts", authPost) 54 | app.use("/category", authCat) 55 | 56 | //---- step : 1.2 57 | app.listen("5000", () => { 58 | console.log("backend running...") 59 | }) 60 | -------------------------------------------------------------------------------- /backend/model/category.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose") 2 | 3 | const CategorySchema = new mongoose.Schema({ 4 | name: { 5 | type: String, 6 | require: true, 7 | }, 8 | }) 9 | module.exports = mongoose.model("Category", CategorySchema) 10 | -------------------------------------------------------------------------------- /backend/model/post.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose") 2 | 3 | const PostSchema = new mongoose.Schema( 4 | { 5 | title: { 6 | type: String, 7 | require: true, 8 | unique: true, 9 | }, 10 | desc: { 11 | type: String, 12 | require: true, 13 | }, 14 | photo: { 15 | type: String, 16 | require: false, 17 | }, 18 | username: { 19 | type: String, 20 | require: true, 21 | }, 22 | categories: { 23 | type: Array, 24 | require: false, 25 | }, 26 | }, 27 | { timestamps: true } 28 | ) 29 | module.exports = mongoose.model("Post", PostSchema) 30 | -------------------------------------------------------------------------------- /backend/model/user.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose") 2 | 3 | const UserSchema = new mongoose.Schema( 4 | { 5 | username: { 6 | type: String, 7 | require: true, 8 | unique: true, 9 | }, 10 | email: { 11 | type: String, 12 | require: true, 13 | unique: true, 14 | }, 15 | password: { 16 | type: String, 17 | require: true, 18 | }, 19 | profilePic: { 20 | type: String, 21 | default: "", 22 | }, 23 | }, 24 | { timestamps: true } 25 | ) 26 | module.exports = mongoose.model("User", UserSchema) 27 | -------------------------------------------------------------------------------- /backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "nodemon index.js" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "bcrypt": "^5.0.1", 13 | "dotenv": "^16.0.2", 14 | "express": "^4.18.1", 15 | "mongoose": "^6.6.1", 16 | "multer": "^1.4.5-lts.1", 17 | "path": "^0.12.7" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /backend/routes/auth.js: -------------------------------------------------------------------------------- 1 | const router = require("express").Router() 2 | const User = require("../model/User") 3 | const bcrypt = require("bcrypt") 4 | 5 | // regsiter 6 | router.post("/register", async (req, res) => { 7 | try { 8 | const salt = await bcrypt.genSalt(10) 9 | const hashedPass = await bcrypt.hash(req.body.password, salt) 10 | 11 | const newUser = new User({ 12 | username: req.body.username, 13 | email: req.body.email, 14 | password: hashedPass, 15 | }) 16 | 17 | const user = await newUser.save() 18 | res.status(200).json(user) 19 | } catch (error) { 20 | res.status(500).json(error) 21 | } 22 | }) 23 | 24 | // login 25 | 26 | router.post("/login", async (req, res) => { 27 | try { 28 | const user = await User.findOne({ username: req.body.username }) 29 | //if no user 30 | !user && res.status(400).json("Wrong Credntials!") 31 | 32 | //if same user then compare password 33 | const validate = await bcrypt.compare(req.body.password, user.password) 34 | //if not validate 35 | !validate && res.status(400).json("Wrong Credentials!") 36 | 37 | const { password, ...other } = user._doc 38 | res.status(200).json(other) 39 | } catch (error) { 40 | res.status(500).json(error) 41 | } 42 | }) 43 | module.exports = router 44 | -------------------------------------------------------------------------------- /backend/routes/categories.js: -------------------------------------------------------------------------------- 1 | const router = require("express").Router() 2 | const Category = require("../model/Category") 3 | 4 | router.post("/", async (req, res) => { 5 | const newCat = new Category(req.body) 6 | try { 7 | const savedCat = await newCat.save() 8 | res.status(200).json(savedCat) 9 | } catch (error) { 10 | res.status(500).json(error) 11 | } 12 | }) 13 | /* { 14 | "name":"sport" 15 | } */ 16 | 17 | // get all cat 18 | router.get("/", async (req, res) => { 19 | try { 20 | const cat = await Category.find() 21 | res.status(200).json(cat) 22 | } catch (error) { 23 | res.status(500).json(error) 24 | } 25 | }) 26 | 27 | module.exports = router 28 | -------------------------------------------------------------------------------- /backend/routes/posts.js: -------------------------------------------------------------------------------- 1 | const router = require("express").Router() 2 | const Post = require("../model/Post") 3 | 4 | //create post 5 | router.post("/", async (req, res) => { 6 | const newPost = new Post(req.body) 7 | try { 8 | const savePost = await newPost.save() 9 | res.status(200).json(savePost) 10 | } catch (error) { 11 | res.status(500).json(error) 12 | } 13 | }) 14 | /* 15 | { 16 | "username":"admin", 17 | "title":"test5", 18 | "desc":"loreme2" 19 | } */ 20 | 21 | // update post 22 | router.put("/:id", async (req, res) => { 23 | try { 24 | const post = await Post.findById(req.params.id) 25 | if (post.username === req.body.username) { 26 | try { 27 | const updatePost = await Post.findByIdAndUpdate( 28 | req.params.id, 29 | { 30 | $set: req.body, 31 | }, 32 | { new: true } 33 | ) 34 | res.status(200).json(updatePost) 35 | } catch (error) { 36 | res.status(500).json(error) 37 | } 38 | } else { 39 | res.status(401).json("You can update only your post!") 40 | } 41 | } catch (error) { 42 | res.status(500).json(error) 43 | } 44 | }) 45 | 46 | // delete 47 | router.delete("/:id", async (req, res) => { 48 | try { 49 | const post = await Post.findById(req.params.id) 50 | if (post.username === req.body.username) { 51 | try { 52 | await post.delete() 53 | res.status(200).json("Post Has been delete!") 54 | } catch (error) { 55 | res.status(500).json(error) 56 | } 57 | } else { 58 | res.status(401).json("You can delete only your post!") 59 | } 60 | } catch (error) { 61 | res.status(500).json(error) 62 | } 63 | }) 64 | 65 | // get post 66 | router.get("/:id", async (req, res) => { 67 | try { 68 | const post = await Post.findById(req.params.id) 69 | res.status(200).json(post) 70 | } catch (error) { 71 | res.status(404).json(error) 72 | } 73 | }) 74 | 75 | // get all post 76 | router.get("/", async (req, res) => { 77 | const username = req.query.user 78 | const catName = req.query.cat 79 | try { 80 | let posts 81 | if (username) { 82 | posts = await Post.find({ username: username }) 83 | } else if (catName) { 84 | posts = await Post.find({ 85 | categories: { 86 | $in: [catName], 87 | }, 88 | }) 89 | } else { 90 | posts = await Post.find() 91 | } 92 | res.status(200).json(posts) 93 | } catch (error) { 94 | res.status(404).json(error) 95 | } 96 | }) 97 | 98 | //localhost:5000/posts?user=ram 99 | 100 | module.exports = router 101 | -------------------------------------------------------------------------------- /backend/routes/user.js: -------------------------------------------------------------------------------- 1 | const router = require("express").Router() 2 | const User = require("../model/User") 3 | const Post = require("../model/Post") 4 | const bcrypt = require("bcrypt") 5 | 6 | // update 7 | 8 | router.put("/:id", async (req, res) => { 9 | if (req.body.userId === req.params.id) { 10 | if (req.body.password) { 11 | const salt = await bcrypt.genSalt(10) 12 | req.body.password = await bcrypt.hash(req.body.password, salt) 13 | } 14 | try { 15 | const updatedUser = await User.findByIdAndUpdate( 16 | req.params.id, 17 | { 18 | $set: req.body, 19 | }, 20 | { new: true } 21 | ) 22 | res.status(200).json(updatedUser) 23 | } catch (error) { 24 | res.status(500).json(error) 25 | } 26 | } else { 27 | res.status(401).json("You can update your account") 28 | } 29 | }) 30 | /* 31 | { 32 | "userId" : "6332700aeda4d5e6fda5628a", 33 | "username":"sunil", 34 | "email": "sunil@gmail.com", 35 | "password":"sunil" 36 | } 37 | */ 38 | 39 | // delete 40 | router.delete("/:id", async (req, res) => { 41 | if (req.body.userId === req.params.id) { 42 | // delete all post of user and user account 43 | try { 44 | const user = await User.findById(req.params.id) 45 | try { 46 | await Post.deleteMany({ username: user.username }) 47 | // only delete user account 48 | await User.findByIdAndDelete(req.params.id) 49 | res.status(200).json("User has been deleted...") 50 | } catch (error) { 51 | res.status(500).json(error) 52 | } 53 | } catch (error) { 54 | res.status(404).json("User not found") 55 | } 56 | } else { 57 | res.status(401).json("You can delete only your account") 58 | } 59 | }) 60 | /* 61 | { 62 | "userId" : "633277ed7e57ec2eb50f9f18", 63 | "username":"sunil", 64 | "password":"sunil" 65 | } */ 66 | 67 | // get user 68 | router.get("/:id", async (req, res) => { 69 | try { 70 | const user = await User.findById(req.params.id) 71 | const { password, ...other } = user._doc 72 | res.status(200).json(other) 73 | } catch (error) { 74 | res.status(400).json(error) 75 | } 76 | }) 77 | module.exports = router 78 | -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!** 35 | 36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. 39 | 40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cartsy-ecommerce", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.16.5", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "axios": "^0.27.2", 10 | "react": "^18.2.0", 11 | "react-dom": "^18.2.0", 12 | "react-icons": "^4.4.0", 13 | "react-router-dom": "^5.3.3", 14 | "react-scripts": "5.0.1", 15 | "react-slick": "^0.29.0", 16 | "slick-carousel": "^1.8.1", 17 | "web-vitals": "^2.1.4" 18 | }, 19 | "scripts": { 20 | "start": "react-scripts start", 21 | "build": "react-scripts build", 22 | "test": "react-scripts test", 23 | "eject": "react-scripts eject" 24 | }, 25 | "eslintConfig": { 26 | "extends": [ 27 | "react-app", 28 | "react-app/jest" 29 | ] 30 | }, 31 | "browserslist": { 32 | "production": [ 33 | ">0.2%", 34 | "not dead", 35 | "not op_mini all" 36 | ], 37 | "development": [ 38 | "last 1 chrome version", 39 | "last 1 firefox version", 40 | "last 1 safari version" 41 | ] 42 | }, 43 | "proxy": "http://localhost:5000/" 44 | } 45 | -------------------------------------------------------------------------------- /frontend/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/favicon.png -------------------------------------------------------------------------------- /frontend/public/images/blogs/b1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b1.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b10.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b2.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b3.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b4.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b5.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b6.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b7.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b8.jpg -------------------------------------------------------------------------------- /frontend/public/images/blogs/b9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/blogs/b9.jpg -------------------------------------------------------------------------------- /frontend/public/images/category/ca1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca1.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca10.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca11.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca12.jpg -------------------------------------------------------------------------------- /frontend/public/images/category/ca2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca2.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca3.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca4.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca5.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca6.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca7.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca8.png -------------------------------------------------------------------------------- /frontend/public/images/category/ca9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/category/ca9.png -------------------------------------------------------------------------------- /frontend/public/images/product/product1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product1.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product10.png -------------------------------------------------------------------------------- /frontend/public/images/product/product11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product11.png -------------------------------------------------------------------------------- /frontend/public/images/product/product12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product12.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product13.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product14.png -------------------------------------------------------------------------------- /frontend/public/images/product/product15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product15.png -------------------------------------------------------------------------------- /frontend/public/images/product/product16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product16.png -------------------------------------------------------------------------------- /frontend/public/images/product/product17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product17.png -------------------------------------------------------------------------------- /frontend/public/images/product/product18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product18.png -------------------------------------------------------------------------------- /frontend/public/images/product/product19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product19.png -------------------------------------------------------------------------------- /frontend/public/images/product/product2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product2.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product20.png -------------------------------------------------------------------------------- /frontend/public/images/product/product21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product21.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product22.png -------------------------------------------------------------------------------- /frontend/public/images/product/product23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product23.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product24.png -------------------------------------------------------------------------------- /frontend/public/images/product/product3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product3.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product3.png -------------------------------------------------------------------------------- /frontend/public/images/product/product4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product4.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product5.png -------------------------------------------------------------------------------- /frontend/public/images/product/product6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product6.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product7.jpg -------------------------------------------------------------------------------- /frontend/public/images/product/product7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product7.png -------------------------------------------------------------------------------- /frontend/public/images/product/product8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product8.png -------------------------------------------------------------------------------- /frontend/public/images/product/product9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/product/product9.png -------------------------------------------------------------------------------- /frontend/public/images/slide/slide1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/slide/slide1.png -------------------------------------------------------------------------------- /frontend/public/images/slide/slide2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/slide/slide2.png -------------------------------------------------------------------------------- /frontend/public/images/slide/slide3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/slide/slide3.png -------------------------------------------------------------------------------- /frontend/public/images/slide/slide4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunil9813/MERN-BLOG-PROJECT/83b1bff59b4e0ccdd5ec7eab7a1a6b480a96fcd8/frontend/public/images/slide/slide4.png -------------------------------------------------------------------------------- /frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Blog Website App 12 | 13 | 14 | 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react" 2 | import { Footer } from "./components/footer/Footer" 3 | import { Header } from "./components/header/Header" 4 | import { Home } from "./pages/home/Home" 5 | import { Login } from "./pages/login/Login" 6 | import { Regsiter } from "./pages/login/Regsiter" 7 | import { BrowserRouter as Router, Switch, Route } from "react-router-dom" 8 | import { DetailsPages } from "./pages/details/DetailsPages" 9 | import { Account } from "./pages/account/Account" 10 | import { Create } from "./components/create/Create" 11 | import { Context } from "./context/Context" 12 | 13 | const App = () => { 14 | //after login 15 | const { user } = useContext(Context) 16 | return ( 17 | <> 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |