├── README.md
├── View Source Code
├── README.md
├── instruction.md
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ ├── manifest.json
│ └── robots.txt
└── src
│ ├── App.js
│ ├── index.css
│ └── index.js
├── instruction.md
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
├── server
├── controllers
│ ├── authController.js
│ ├── postController.js
│ └── userController.js
├── dbConfig
│ └── index.js
├── index.js
├── middleware
│ ├── authMiddleware.js
│ └── errorMiddleware.js
├── models
│ ├── PasswordReset.js
│ ├── commentModel.js
│ ├── emailVerification.js
│ ├── friendRequest.js
│ ├── postModel.js
│ └── userModel.js
├── package-lock.json
├── package.json
├── routes
│ ├── authRoutes.js
│ ├── index.js
│ ├── postRoutes.js
│ └── userRoutes.js
├── utils
│ ├── index.js
│ └── sendEmail.js
└── views
│ └── build
│ ├── asset-manifest.json
│ ├── index.html
│ ├── manifest.json
│ ├── robots.txt
│ └── static
│ ├── css
│ ├── main.2609a62c.css
│ └── main.2609a62c.css.map
│ └── js
│ ├── main.4e9a0992.js
│ ├── main.4e9a0992.js.LICENSE.txt
│ ├── main.4e9a0992.js.map
│ ├── main.5b2b5904.js
│ ├── main.5b2b5904.js.LICENSE.txt
│ └── main.5b2b5904.js.map
├── src
├── App.js
├── assets
│ ├── data.js
│ ├── img.jpeg
│ ├── index.js
│ └── userprofile.png
├── components
│ ├── CustomButton.jsx
│ ├── EditProfile.jsx
│ ├── FriendsCard.jsx
│ ├── Loading.jsx
│ ├── PostCard.jsx
│ ├── ProfileCard.jsx
│ ├── TextInput.jsx
│ ├── TopBar.jsx
│ └── index.js
├── index.css
├── index.js
├── pages
│ ├── Home.jsx
│ ├── Login.jsx
│ ├── Profile.jsx
│ ├── Register.jsx
│ ├── ResetPassword.jsx
│ └── index.js
└── redux
│ ├── postSlice.js
│ ├── reducer.js
│ ├── store.js
│ ├── theme.js
│ └── userSlice.js
└── tailwind.config.js
/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 |
72 |
73 |
74 | # INTRUCTIONS
75 |
76 | # SERVER OR BACKEND
77 | Firstly move to the server directory eg: cd server
78 |
79 | 1. Create a .env file
80 | The .env file will contain the following:
81 | i. MONGODB_URL = database connection string
82 | ii. JWT_SECRET_KEY = your secreate key
83 | iii. PORT = 8800
84 | iv. AUTH_EMAIL= email address
85 | v. AUTH_PASSWORD=email access password
86 | vi. APP_URL = http://localhost:8800/api-v1
87 |
88 | Note: I used hotmail account to send verification email, so you can just create one
89 | because hotmail account is reliable in product and has no configuration.
90 |
91 | Alos, chnage API_URL when you deploy your app else use localhost with the appropriate port number
92 |
93 | 2. Run npm install to install the packages
94 | 3. Run npm start to start the server
95 |
96 |
97 | CLINET SIDE
98 |
99 | The client or frontend also has .env filde in the root folder.
100 | Create an environment variable of name REACT_APP_CLOUDINARY_ID.
101 | This will store the cloudinary cloud name
102 |
103 |
104 |
105 | For Support, Contact:
106 | Email: codewavewithasante@gmail.com
107 | Telegram: https://t.me/Codewave_with_asante
108 |
--------------------------------------------------------------------------------
/View Source Code/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 |
--------------------------------------------------------------------------------
/View Source Code/instruction.md:
--------------------------------------------------------------------------------
1 | Full-Stack Social Media Application using ReactJs, and Tailwind CSS for the front end and NodeJs, ExpressJs and MongoDb for backend.
2 | This App is fully responsive. This project includes for frontend (UI Design) and Backend (Server).
3 |
4 | # Functionalities:
5 | 1. #User Authentication and Authorisation
6 | 2. #Email Verification
7 | 3. #Password reset
8 | 4. #Create Post
9 | 5. #Advance Comment system (comments with sub coments)
10 | 6. #Like post and comments
11 | 7. #Delete post
12 | 8. #Friend Request (send request, accept or deby)
13 | and others.....
14 |
15 |
16 | # Getting Started
17 |
18 | # SERVER OR BACKEND
19 | Firstly move to the server directory eg: cd server
20 |
21 | 1. Create a `.env` file
22 | The .env file will contain the following:
23 | i. MONGODB_URL = `database connection string`
24 | ii. JWT_SECRET_KEY = `your secreate key`
25 | iii. PORT = `8800`
26 | iv. AUTH_EMAIL= `email address`
27 | v. AUTH_PASSWORD= `email access password`
28 | vi. APP_URL = `http://localhost:8800`
29 |
30 | Note: I used hotmail account to send verification email, so you can just create one because hotmail account is reliable in product and has no configuration.
31 |
32 | Alos, change `API_URL` when you deploy your app else use localhost with the appropriate `port number`
33 |
34 | 2. Run `npm install` to install the packages
35 | 3. Run `npm start` to start the server
36 |
37 | # VIEWS FILE
38 | In the view are the static html files to be use for `email verfication` and `password reset`.
39 |
40 | 1. This folder is a React App
41 | 2. navigate in the folder and install it dependencies
42 | 3. make changes to suit your preference and run build
43 | 4. copy the build folder into the view folder in the server folder
44 |
45 | **Override the existing one.**
46 | NOTE: During deployment make sure you change the various links in the view file and build it again and replace the files in the view folder of the server folder.
47 |
48 |
49 | # CLINET SIDE
50 |
51 | The client or frontend also has .env filde in the root folder.
52 | Create an environment variable of name `REACT_APP_CLOUDINARY_ID`.
53 | This will store the cloudinary cloud name
54 |
55 | This side also has and env file with `REACT_APP_CLOUDINARY_ID`
56 |
--------------------------------------------------------------------------------
/View Source Code/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "views",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.17.0",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4"
13 | },
14 | "scripts": {
15 | "start": "react-scripts start",
16 | "build": "react-scripts build",
17 | "test": "react-scripts test",
18 | "eject": "react-scripts eject"
19 | },
20 | "eslintConfig": {
21 | "extends": [
22 | "react-app",
23 | "react-app/jest"
24 | ]
25 | },
26 | "browserslist": {
27 | "production": [
28 | ">0.2%",
29 | "not dead",
30 | "not op_mini all"
31 | ],
32 | "development": [
33 | "last 1 chrome version",
34 | "last 1 firefox version",
35 | "last 1 safari version"
36 | ]
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/View Source Code/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
32 | );
33 | }
34 |
35 | export default App;
36 |
--------------------------------------------------------------------------------
/src/assets/data.js:
--------------------------------------------------------------------------------
1 | export const user = {
2 | _id: "64df3c064180b81adfe41d4b",
3 | firstName: "Code",
4 | lastName: "Wave",
5 | email: "codewavewithasante@gmail.com",
6 | friends: [
7 | {
8 | _id: "64df3aec4180b81adfe41d32",
9 | firstName: "John",
10 | lastName: "Bruce",
11 | email: "john@gmail.com",
12 | friends: ["64df3c064180b81adfe41d4b", "64df39704180b81adfe41d0b"],
13 | views: [],
14 | verified: true,
15 | createdAt: "2023-08-18T09:33:32.519Z",
16 | updatedAt: "2023-08-18T09:49:19.475Z",
17 | __v: 2,
18 | profileUrl:
19 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874470/cld-sample.jpg",
20 | },
21 | {
22 | _id: "64df39704180b81adfe41d0b",
23 | firstName: "James",
24 | lastName: "Jackson",
25 | email: "james@gmail.com",
26 | friends: ["64df3c064180b81adfe41d4b", "64df3aec4180b81adfe41d32"],
27 | views: [
28 | "64df39704180b81adfe41d0b",
29 | "64df39704180b81adfe41d0b",
30 | "64df39704180b81adfe41d0b",
31 | "64df39704180b81adfe41d0b",
32 | "64df39704180b81adfe41d0b",
33 | "64df39704180b81adfe41d0b",
34 | ],
35 | verified: true,
36 | createdAt: "2023-08-18T09:27:12.064Z",
37 | updatedAt: "2023-08-21T06:46:26.798Z",
38 | __v: 8,
39 | location: "Mumbai, India",
40 | profession: "Full-Stack Developer",
41 | },
42 | {
43 | _id: "64df424b4a4c0d47b5369f65",
44 | firstName: "User",
45 | lastName: "One",
46 | email: "user!@gmail.com",
47 | friends: ["64df3c064180b81adfe41d4b"],
48 | views: [],
49 | verified: true,
50 | createdAt: "2023-08-18T10:04:59.677Z",
51 | updatedAt: "2023-08-18T10:09:20.006Z",
52 | __v: 1,
53 | },
54 | ],
55 | views: [
56 | "64df39704180b81adfe41d0b",
57 | "64df39704180b81adfe41d0b",
58 | "64df39704180b81adfe41d0b",
59 | "64df39704180b81adfe41d0b",
60 | "64df39704180b81adfe41d0b",
61 | "64df39704180b81adfe41d0b",
62 | "64df39704180b81adfe41d0b",
63 | "64df39704180b81adfe41d0b",
64 | "64df39704180b81adfe41d0b",
65 | "64df39704180b81adfe41d0b",
66 | "64df39704180b81adfe41d0b",
67 | "64df39704180b81adfe41d0b",
68 | "64df39704180b81adfe41d0b",
69 | "64df39704180b81adfe41d0b",
70 | "64df39704180b81adfe41d0b",
71 | "64df39704180b81adfe41d0b",
72 | "64df39704180b81adfe41d0b",
73 | "64df39704180b81adfe41d0b",
74 | "64df39704180b81adfe41d0b",
75 | "64df39704180b81adfe41d0b",
76 | "64df39704180b81adfe41d0b",
77 | "64df39704180b81adfe41d0b",
78 | "64df39704180b81adfe41d0b",
79 | "64df39704180b81adfe41d0b",
80 | "64df39704180b81adfe41d0b",
81 | "64df39704180b81adfe41d0b",
82 | "64df39704180b81adfe41d0b",
83 | "64df39704180b81adfe41d0b",
84 | ],
85 | verified: true,
86 | createdAt: "2023-08-18T09:38:14.179Z",
87 | updatedAt: "2023-08-21T06:46:18.258Z",
88 | profileUrl:
89 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874454/samples/people/boy-snow-hoodie.jpg",
90 | token: "hZWFmZmU3NmMiLCJpYXQiOjE2OTIwMzY5",
91 | };
92 |
93 | export const friends = [
94 | {
95 | _id: "64df3aec4180b81adfe41d32",
96 | firstName: "John",
97 | lastName: "Bruce",
98 | email: "john@gmail.com",
99 | profileUrl:
100 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874470/cld-sample.jpg",
101 | },
102 | {
103 | _id: "64df39704180b81adfe41d0b",
104 | firstName: "James",
105 | lastName: "Jackson",
106 | email: "james@gmail.com",
107 | location: "Mumbai, India",
108 | profession: "Full-Stack Developer",
109 | },
110 | {
111 | _id: "64df424b4a4c0d47b5369f65",
112 | firstName: "User",
113 | lastName: "One",
114 | email: "user!@gmail.com",
115 | },
116 | ];
117 |
118 | export const requests = [
119 | {
120 | _id: "64df3aec4180b81adfe41d32",
121 | requestFrom: friends[0],
122 | },
123 | {
124 | _id: "64df39704180b81adfe41d0b",
125 | requestFrom: friends[1],
126 | },
127 | {
128 | _id: "64df424b4a4c0d47b5369f65",
129 | requestFrom: friends[2],
130 | },
131 | ];
132 |
133 | export const suggest = [
134 | {
135 | _id: "64df3aec4180b81adfe41d32",
136 | ...friends[0],
137 | },
138 | {
139 | _id: "64df39704180b81adfe41d0b",
140 | ...friends[1],
141 | },
142 | {
143 | _id: "64df424b4a4c0d47b5369f65",
144 | ...friends[2],
145 | },
146 | ];
147 | export const posts = [
148 | {
149 | _id: "64e2fe620d7868ecff1a6a86",
150 | userId: {
151 | _id: "64df39704180b81adfe41d0b",
152 | firstName: "Chris",
153 | lastName: "Omar",
154 | profileUrl:
155 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874454/samples/people/boy-snow-hoodie.jpg",
156 | location: "New York, USA",
157 | },
158 | description: "Hello everyone, this is a new video. check it out. thank you",
159 | image:
160 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1692597858/SOCIALMEDIA/hdahstpztt1fvobc13st.png",
161 | likes: ["64df3c064180b81adfe41d4b"],
162 | comments: [],
163 | createdAt: "2023-08-21T06:04:18.297Z",
164 | updatedAt: "2023-08-21T06:04:18.297Z",
165 | __v: 0,
166 | },
167 | {
168 | _id: "64e1cdd64baffca670364c8c",
169 | userId: {
170 | _id: "64df39704180b81adfe41d0b",
171 | firstName: "Love",
172 | lastName: "Banks",
173 | profileUrl:
174 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874454/samples/people/boy-snow-hoodie.jpg",
175 | location: "Mumbai, India",
176 | },
177 | description:
178 | "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, ",
179 | likes: ["64df39704180b81adfe41d0b"],
180 | comments: [],
181 | createdAt: "2023-08-20T08:24:54.330Z",
182 | updatedAt: "2023-08-21T03:23:24.809Z",
183 | __v: 0,
184 | },
185 | {
186 | _id: "64df437e4a4c0d47b536a002",
187 | userId: {
188 | _id: "64df424b4a4c0d47b5369f65",
189 | firstName: "User",
190 | lastName: "One",
191 | },
192 | description:
193 | "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, ",
194 | likes: ["64df424b4a4c0d47b5369f65"],
195 | comments: ["64e2d1c977e497bd3a0bf67b"],
196 | createdAt: "2023-08-18T10:10:06.969Z",
197 | updatedAt: "2023-08-21T02:54:01.806Z",
198 | __v: 0,
199 | image:
200 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874458/samples/imagecon-group.jpg",
201 | },
202 | {
203 | _id: "64df43714a4c0d47b5369fef",
204 | userId: {
205 | _id: "64df3c064180b81adfe41d4b",
206 | firstName: "Code",
207 | lastName: "Wave",
208 | profileUrl:
209 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874454/samples/people/boy-snow-hoodie.jpg",
210 | },
211 | description:
212 | "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, ",
213 | likes: ["64df39704180b81adfe41d0b"],
214 | comments: [],
215 | createdAt: "2023-08-18T10:09:53.009Z",
216 | updatedAt: "2023-08-21T03:35:18.541Z",
217 | __v: 0,
218 | },
219 | {
220 | _id: "64df42dc4a4c0d47b5369f8a",
221 | userId: {
222 | _id: "64df424b4a4c0d47b5369f65",
223 | firstName: "User",
224 | lastName: "One",
225 | },
226 | description:
227 | " What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text,",
228 | likes: ["64df424b4a4c0d47b5369f65"],
229 | comments: [],
230 | createdAt: "2023-08-18T10:07:24.023Z",
231 | updatedAt: "2023-08-18T10:11:00.348Z",
232 | __v: 0,
233 | image:
234 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874457/samples/ecommerce/leather-bag-gray.jpg",
235 | },
236 | {
237 | _id: "64df42b04a4c0d47b5369f77",
238 | userId: {
239 | _id: "64df424b4a4c0d47b5369f65",
240 | firstName: "User",
241 | lastName: "One",
242 | },
243 | description:
244 | "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, ",
245 | likes: [],
246 | comments: [],
247 | createdAt: "2023-08-18T10:06:40.339Z",
248 | updatedAt: "2023-08-18T10:06:40.339Z",
249 | __v: 0,
250 | },
251 | {
252 | _id: "64df41114a4c0d47b5369f02",
253 | userId: {
254 | _id: "64df3aec4180b81adfe41d32",
255 | firstName: "Jomes",
256 | lastName: "Gardener",
257 | profileUrl:
258 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874470/cld-sample.jpg",
259 | },
260 | description:
261 | " What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).",
262 | likes: ["64df39704180b81adfe41d0b"],
263 | comments: [],
264 | createdAt: "2023-08-18T09:59:45.876Z",
265 | updatedAt: "2023-08-18T10:01:35.333Z",
266 | __v: 0,
267 | },
268 | {
269 | _id: "64df3ef86c2bd953c7b43193",
270 | userId: {
271 | _id: "64df3c064180b81adfe41d4b",
272 | firstName: "Code",
273 | lastName: "Wave",
274 | profileUrl:
275 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874454/samples/people/boy-snow-hoodie.jpg",
276 | },
277 | description:
278 | "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, ",
279 | likes: [
280 | "64df3aec4180b81adfe41d32",
281 | "64df424b4a4c0d47b5369f65",
282 | "64df39704180b81adfe41d0b",
283 | ],
284 | comments: [
285 | "64df41304a4c0d47b5369f0d",
286 | "64df41b14a4c0d47b5369f4d",
287 | "64df43e04a4c0d47b536a02a",
288 | ],
289 | createdAt: "2023-08-18T09:50:48.398Z",
290 | updatedAt: "2023-08-21T03:36:36.745Z",
291 | __v: 0,
292 | image:
293 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874455/samples/animals/three-dogs.jpg",
294 | },
295 | {
296 | _id: "64df3ed06c2bd953c7b43172",
297 | userId: {
298 | _id: "64df39704180b81adfe41d0b",
299 | firstName: "John ",
300 | lastName: "Smith",
301 | profileUrl:
302 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874453/samples/bike.jpg",
303 | location: "Mumbai, India",
304 | },
305 | description:
306 | " What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).",
307 | likes: ["64df39704180b81adfe41d0b"],
308 | comments: ["64e2dc8577e497bd3a0bf843"],
309 | createdAt: "2023-08-18T09:50:08.431Z",
310 | updatedAt: "2023-08-21T03:44:36.962Z",
311 | __v: 0,
312 | image:
313 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874453/samples/bike.jpg",
314 | },
315 | ];
316 |
317 | export const postComments = [
318 | {
319 | _id: "64df43e04a4c0d47b536a02a",
320 | userId: {
321 | _id: "64df424b4a4c0d47b5369f65",
322 | firstName: "User",
323 | lastName: "One",
324 | },
325 | postId: "64df3ef86c2bd953c7b43193",
326 | comment: "hahahah",
327 | from: "User One",
328 | likes: ["64df39704180b81adfe41d0b"],
329 | replies: [],
330 | createdAt: "2023-08-18T10:11:44.091Z",
331 | updatedAt: "2023-08-21T03:37:03.927Z",
332 | __v: 0,
333 | },
334 | {
335 | _id: "64df41b14a4c0d47b5369f4d",
336 | userId: {
337 | _id: "64df39704180b81adfe41d0b",
338 | firstName: "MTech",
339 | lastName: "Solutions",
340 | profileUrl:
341 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1692299991/SOCIALMEDIA/fvws1unsqytcqketv78w.png",
342 | location: "Mumbai, India",
343 | },
344 | postId: "64df3ef86c2bd953c7b43193",
345 | comment: "i would like to have them in my house",
346 | from: "MTech Solutions",
347 | likes: ["64df39704180b81adfe41d0b"],
348 | replies: [],
349 | createdAt: "2023-08-18T10:02:25.492Z",
350 | updatedAt: "2023-08-21T03:27:57.602Z",
351 | __v: 0,
352 | },
353 | {
354 | _id: "64df41304a4c0d47b5369f0d",
355 | userId: {
356 | _id: "64df3aec4180b81adfe41d32",
357 | firstName: "Akwasi",
358 | lastName: "Asante",
359 | profileUrl:
360 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1683874470/cld-sample.jpg",
361 | },
362 | postId: "64df3ef86c2bd953c7b43193",
363 | comment: "This dogs are too serious!",
364 | from: "Akwasi Asante",
365 | likes: ["64df39704180b81adfe41d0b"],
366 | replies: [
367 | {
368 | userId: {
369 | _id: "64df39704180b81adfe41d0b",
370 | firstName: "MTech",
371 | lastName: "Solutions",
372 | profileUrl:
373 | "https://res.cloudinary.com/djs3wu5bg/image/upload/v1692299991/SOCIALMEDIA/fvws1unsqytcqketv78w.png",
374 | location: "Mumbai, India",
375 | },
376 | from: "MTech Solutions",
377 | replyAt: "Akwasi Asante",
378 | comment: "Not easy, hahahah",
379 | created_At: "2023-08-18T10:01:08.771Z",
380 | updated_At: "2023-08-18T09:56:38.344Z",
381 | likes: [],
382 | _id: "64df41644a4c0d47b5369f24",
383 | },
384 | ],
385 | createdAt: "2023-08-18T10:00:16.352Z",
386 | updatedAt: "2023-08-18T10:01:14.090Z",
387 | __v: 1,
388 | },
389 | ];
390 |
--------------------------------------------------------------------------------
/src/assets/img.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeWaveWithAsante/FullStackSocialMedia/e1170e017257f69e18dea7e2294c03fba3cbc79a/src/assets/img.jpeg
--------------------------------------------------------------------------------
/src/assets/index.js:
--------------------------------------------------------------------------------
1 | import NoProfile from "./userprofile.png";
2 | import BgImage from "./img.jpeg";
3 | export { NoProfile, BgImage };
4 |
--------------------------------------------------------------------------------
/src/assets/userprofile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeWaveWithAsante/FullStackSocialMedia/e1170e017257f69e18dea7e2294c03fba3cbc79a/src/assets/userprofile.png
--------------------------------------------------------------------------------
/src/components/CustomButton.jsx:
--------------------------------------------------------------------------------
1 | const CustomButton = ({ title, containerStyles, iconRight, type, onClick }) => {
2 | return (
3 |
12 | );
13 | };
14 |
15 | export default CustomButton;
16 |
--------------------------------------------------------------------------------
/src/components/EditProfile.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import { useForm } from "react-hook-form";
3 | import { MdClose } from "react-icons/md";
4 | import { useDispatch, useSelector } from "react-redux";
5 | import TextInput from "./TextInput";
6 | import Loading from "./Loading";
7 | import CustomButton from "./CustomButton";
8 | import { UpdateProfile } from "../redux/userSlice";
9 |
10 | const EditProfile = () => {
11 | const { user } = useSelector((state) => state.user);
12 | const dispatch = useDispatch();
13 | const [errMsg, setErrMsg] = useState("");
14 | const [isSubmitting, setIsSubmitting] = useState(false);
15 | const [picture, setPicture] = useState(null);
16 |
17 | const {
18 | register,
19 | handleSubmit,
20 | formState: { errors },
21 | } = useForm({
22 | mode: "onChange",
23 | defaultValues: { ...user },
24 | });
25 |
26 | const onSubmit = async (data) => {};
27 |
28 | const handleClose = () => {
29 | dispatch(UpdateProfile(false));
30 | };
31 | const handleSelect = (e) => {
32 | setPicture(e.target.files[0]);
33 | };
34 |
35 | return (
36 | <>
37 |