Social Posts Manager is a full-stack web application that integrates user-created content with interactive features. The application allows users to create and manage posts, register and log in, and “like” posts. The application is built using React, Redux Toolkit, React Query, Material UI, Node.js, Express, MongoDB, and JWT.
You can also see the demo video here:
git clone
cd social-posts-manager
cd client
npm install
cd server
npm install
You can either use a local MongoDB instance or set up a free MongoDB Atlas cluster.
In my case I am using MongoDB Atlas.
-
Create an account on MongoDB Atlas.
-
Follow the steps.
-
Create a Project.
-
Inside the Project, create a new cluster.
-
Click on
Connect
and then click onConnect your application
. -
Copy the connection string and replace the password with your password. It should look something like this:
mongodb+srv://<username>:<db_password>@<cluster-url>/?retryWrites=true&w=majority&appName=<cluster-name>
-
You will need to replace only the
db_password
, because Atlas already fills the others fields. -
You are done. Keep the string, because you are going to need in on the
.env
of ourserver
.
Don't forget to add your IP address to the IP Whitelist in the Network Access tab of your cluster.
You can easily do it in the Dashboard of the cluster, on the Network Access
and there add your ip address.
Create a .env
file in the server
directory and add the following environment variables:
PORT=3000
MONGO_URI=your_mongo_uri // mongodb connection string
JWT_SECRET=your_jwt_secret // can be any string, we are using this for jwt token generation
Create a .env
file in the client
directory and add the following environment variables:
VITE_SERVER_URL=http://localhost:3000 // server url
cd server
npm start
cd client
npm run dev
The application will be running at http://localhost:5173/ and the server will be running at http://localhost:3000/
If you see these messages on the terminal of the server, you have successfully set up the application:
🏃💨 Server is running at http://localhost:3000 👀
🍃 MongoDB connected
and also for the client:
VITE v6.1.0 ready in 552 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
You can test the application by running the following command:
cd client
npm run cy:open
You can test the application by running the following command:
cd server
npm test
You can now enjoy the application. You can create an account, login, create posts, like posts, populate 100 posts, and much more.
You can read the full requirements here.
- User Registration & Authentication
- Posts Management
- Post Interaction
- Data Persistence
The client is built using React, Redux Toolkit, React Query, Material UI, and Vite. It provides a responsive and interactive user interface for managing social posts. The application leverages Redux Toolkit for state management, React Query for data fetching and caching, Material UI for UI components, and Vite for fast development and build processes.
You can read the full documentation here.
The server is built using Node.js, Express, MongoDB, and JWT. It handles the backend logic, including user authentication, post management, and data persistence. The server uses MongoDB for the database, Express for the web framework, and JWT for secure authentication and authorization.
You can read the full documentation here.