This is a LinkedIn clone application with a working login and registration system.
client/- Next.js frontend applicationserver/- Express.js backend API
- Node.js (v14 or higher)
- MongoDB (make sure it's running locally or update the MONGO_URI in server/.env)
- Navigate to the server directory:
cd server- Install dependencies:
npm install- Create a
.envfile in the server directory with your MongoDB connection string:
MONGO_URI=mongodb://localhost:27017/linkedin-clone
- Start the server:
npm run devThe server will start on http://localhost:5000
- Navigate to the client directory:
cd client- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will start on http://localhost:3000
-
"Network error" message:
- Make sure the server is running on port 5000
- Check if MongoDB is running
- Verify the MONGO_URI in your .env file
-
"Invalid email or password":
- Make sure you're using the correct email/password combination
- Check the browser console for detailed error messages
-
"User already exists":
- Try using a different email address for registration
The application includes console logging for debugging:
- Login attempts are logged to the browser console
- Registration attempts are logged to the browser console
- API responses and errors are logged
Check the browser's developer tools console for detailed information about API calls and responses.
POST /login- User loginPOST /register- User registrationGET /get_user_and_profile- Get user profile (requires token)
- Frontend: Next.js, React, Redux Toolkit, Axios
- Backend: Express.js, MongoDB, Mongoose, bcrypt
- Authentication: JWT-like tokens stored in database