A social network app built with React, NodeJS and MongoDB.
- Authentication: Local and Google OAuth 2.0 using PassportJS
- Publish posts that other users can interact with by liking and commenting
- Add friends to see their posts in your home page
- Customizable user profile page
-
Clone this repository.
-
Open a terminal and navigate into the root directory of your local repository.
-
Install dependencies:
npm install
-
Create a MongoDB database. See Get started with MongoDB Atlas.
-
Create a .env file in the backend directory and add a MONGODB_URL variable with your MongoDB connection string:
echo "MONGODB_URL=<Your mongodb connection string>" > backend/.env
Note: at this point the app is ready to be launched. If you do not need any of the features below, skip to step 8.
-
Set up Google OAuth:
-
Register your app in the Google Cloud platform. Check Setting up OAuth 2.0.
-
Add GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET environment variables to the backend .env file:
GOOGLE_CLIENT_ID=<Your google client ID> GOOGLE_CLIENT_SECRET=<Your google client secret>
-
-
Enable user image upload:
-
Navigate to the cloudinary dashboard.
-
Copy the cloudinary environment variable into the backend .env file:
CLOUDINARY_URL=<Your cloudinary URL>
-
Start the app:
npm start
Client will be available at localhost:3000.
This app features unit and integration tests with jest and testing-library.
The test runner can be launched in the root directory by running:
npm test