Orbit is a full-stack social media web application where users can sign up, create posts, follow others, and receive notifications.
- 🔐 User authentication (signup/login)
- 📝 Create, edit, and delete posts
- 👥 Follow/unfollow users
- 🎨 Responsive UI with theme toggle
- 📷 Image uploads with Cloudinary
- 💬 Interactive social features
- React - User interface library
- Vite - Build tool and development server
- Tailwind CSS - Utility-first CSS framework
- DaisyUI - Component library for Tailwind CSS
- React Router Dom - Client-side routing
- React Hot Toast - Toast notifications
- Node.js - JavaScript runtime
- Express - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - Authentication tokens
- Cloudinary - Image storage and management
- bcryptjs - Password hashing
Orbit._/
├── backend/
│ ├── controllers/ # Request handlers
│ ├── db/ # Database connection
│ ├── middleware/ # Authentication middleware
│ ├── models/ # Database schemas
│ ├── routes/ # API routes
│ ├── utils/ # Utility functions
│ └── server.js # Main server file
├── frontend/
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── contexts/ # React contexts
│ │ ├── hooks/ # Custom hooks
│ │ ├── pages/ # Page components
│ │ └── utils/ # Utility functions
│ └── package.json
├── package.json # Root package.json
└── README.md
- Node.js (v14 or higher)
- npm or yarn
- MongoDB (local installation or MongoDB Atlas)
-
Clone the repository
git clone https://github.com/rajanikant04/Orbit._ cd Orbit._ -
Install dependencies
npm install cd frontend npm install cd ..
-
Environment Variables
Create a
.envfile in the root directory with the following variables:NODE_ENV=development PORT=5000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Start the development server
npm run dev
This will start both the backend server (http://localhost:5000) and the frontend development server (http://localhost:5173).
npm run dev- Start development server with nodemonnpm start- Start production servernpm run build- Build the application for production
Visit the live application: https://orbit-8rsw.onrender.com/
POST /api/auth/signup- Register new userPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/me- Get current user
GET /api/users/profile/:username- Get user profileGET /api/users/suggested- Get suggested usersPOST /api/users/follow/:id- Follow/unfollow userPOST /api/users/update- Update user profile
GET /api/posts/all- Get all postsGET /api/posts/following- Get posts from followed usersGET /api/posts/likes/:id- Get users who liked a postGET /api/posts/user/:username- Get posts by userPOST /api/posts/create- Create new postPOST /api/posts/like/:id- Like/unlike postPOST /api/posts/comment/:id- Comment on postDELETE /api/posts/:id- Delete post
GET /api/notifications- Get user notificationsDELETE /api/notifications- Delete all notifications
- Express parsers should be configured before route definitions
- Always use optional chaining (
?) when accessing potentially undefined variables - Proper error handling and validation are crucial for robust applications
Rajanikant - GitHub Profile
