LikeIt is a social media application that combines features from facebook, instagram, and twitter. The web application deals with client and server side, and uses big stack approach. The global state is managed using redux libray, and uses React Router V6. The app also implements authentication for users, which is implemented using JWT authentication. The website allows the users to create an account, sign up / login, create a profile picture and background picture. It also allows users to follow and unfollow each other, post pictures, and populates their timeline with posts from the users they follow, in chronological order. They are also able to edit a status on thier profile, like other posts, and automatically calculates their number of followers/following.
Back to table of contents
Back to table of contents
Signing up adds the new user to the database, and gives them the default profile and background image. It checks to see if passwords match, and checks if the user already exists in the database before doing so.
Back to table of contents
Logging in simply checks if the user exists in the databse. If so, it checks if the passwords match. If so, then they can move on their own home page. Logging out simply clears the memory of the browser such that the user has to log back in, either with the same credentials or a different one.
Back to table of contents
Following a user and unfollowing them is similar to liking the post. Clicking the follow button allows the user to be added to the userBeingFollowed's array of followers, and adds the userBeingFollowed to the user's array of followings. Pressing the button again reverses this process. This is shown above.
Back to table of contents
The feed is created by appending all the posts of the users who are followed in the database, then ordering the posts using the timestamps so that the most recent post in on top.
Back to table of contents
One can create a post that includes a text, an image, or both. The functionality is supported for any option, and each post has its own ID in the backend, and is timestamped so that they are shown in chronological order.
Back to table of contents
Liking a post is simply done through pressing the like button, which increments the post's number of likes by 1. Clicking the button again removes the like from the post
Back to table of contents
At the click of a button, the user is able to access their status. They can change the fields, their information, and the respective picture, for background and profile.
Back to table of contents
This is performed in the same way as above
Back to table of contents
Useful functionalities implemented by connecting MongoDB to app, and Express server and Node.js used on the server side. Routing and the aggregation of timeline were also taken care of 😎 .
Back to table of contents
- Download the files, then CD into the /client and run the following commands
cd client
npm i redux red ux-thunk react-redux
npm i axios
yarn
yarn add react-roucter-dom
yarn start
)
- Simultaneously open a new terminal, CD into the /server and run the following
npm init
npm i express
npm i mongoose
npm i body-parser
npm i nodemon
yarn
yarn add react-roucter-dom
npm start
)
- The backend is connected to mongo db cloud
- The server runs in port 8080
- The client runs in port 3000
- Make sure these are free before downloading the project
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http:https://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
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.
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.
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.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
Back to table of contents