A social networking application built using the MERN stack (MongoDB, Express.js, React, Node.js).
mern-social/
- Root directorysocial_frontend/
- Contains the React frontend codesocial_backend/
- Houses the Express.js backend server
- Node.js and npm: Make sure you have Node.js and npm installed on your machine.
- MongoDB: You'll need a running MongoDB instance.
-
Clone the repository:
git clone https://github.com/brett-buskirk/mern-social.git cd mern-social
-
Install dependencies:
-
Frontend:
cd social_frontend npm install
-
Backend:
cd ../social_backend npm install
-
-
Set up environment variables:
Create a
.env
file in thesocial_backend
directory.touch .env
Add your MongoDB connection string and any other necessary configuration variables.
Example
.env
file used for this project:MONGODB_URI=mongodb://127.0.0.1:27017/social_backend # Add other variables as needed
-
Start the application:
-
Backend: Make sure you're still in
social_backend
and run:npm start
-
Frontend: Open a new terminal window/tab and run:
cd social_frontend npm start
This should open your default browser and display the MERN Social application.
-
When the app first loads, it won't have any posts yet:
Start by clicking on Create Post
:
Create a post and upload an image if you want:
Click Post
and then click on Home
to see your post:
At the bottom of your post, you can click the Like
button or even add a comment:
Remember that this is only a basic example of a MERN application. Feel free to experiment and make your own changes as you explore how this code works.
This project is licensed under the MIT License - see the LICENSE
file for details.