A full-stack social media application inspired by Instagram, built with vanilla HTML/CSS/JavaScript on the frontend and Node.js/Express/MongoDB on the backend.
- User registration with username, email and password
- Secure login with JWT token authentication
- Forgot password with OTP verification via email
- Auto login on page refresh
- Instagram-style photo feed
- Upload photos with captions
- Like and unlike posts
- View posts from followed users
- Pull to refresh feed
- Personal profile with post grid
- Edit profile (name, bio, website)
- Followers and following count
- Public and private account toggle
- Hamburger menu with settings
- Follow and unfollow users
- Follow requests for private accounts
- Accept or decline follow requests
- Follow request notifications on profile
- Real-time chat between users
- Message request system
- Accept or decline message requests
- Chat threads list
- Auto reply simulation
- Search users by username or name
- View any user's profile from search
- Private account mode
- Block and unblock users
- Report users with reason selection
- Blocked users management list
- Message requests from non-followers
- Instagram-inspired design
- Fully responsive for mobile and desktop
- Pull to refresh on all tabs
- Auto refresh every 60 seconds
- Bottom navigation bar
- Toast notifications
- Loading spinners
- HTML5
- CSS3
- Vanilla JavaScript
- Google Fonts (Playfair Display + DM Sans)
- Node.js
- Express.js
- MongoDB (Atlas)
- Mongoose ODM
| Package | Purpose |
|---|---|
| express | Web framework |
| mongoose | MongoDB ODM |
| bcryptjs | Password hashing |
| jsonwebtoken | JWT authentication |
| multer | File uploads |
| cors | Cross origin requests |
| dotenv | Environment variables |
| nodemailer | Email sending |
| axios | HTTP requests |
| nodemon | Development server |
- Frontend: Render (Static Site)
- Backend: Render (Web Service)
- Database: MongoDB Atlas (Cloud)
- Email: Brevo API
SyncSphere/ βββ backend/ β βββ config/ β β βββ db.js # MongoDB connection β βββ middleware/ β β βββ auth.js # JWT middleware β βββ models/ β β βββ User.js # User schema β β βββ Post.js # Post schema β β βββ Message.js # Message schema β β βββ MessageRequest.js # Message request schema β βββ routes/ β β βββ auth.js # Login & register β β βββ users.js # User operations β β βββ posts.js # Post operations β β βββ messages.js # Chat & requests β β βββ forgot.js # Password reset OTP β βββ uploads/ # Uploaded images β βββ .env # Environment variables β βββ .env.example # Environment template β βββ package.json β βββ server.js # Entry point β βββ frontend/ βββ css/ β βββ style.css # All styles βββ js/ β βββ api.js # API helper & utilities β βββ auth.js # Login & register logic β βββ feed.js # Feed & post upload β βββ search.js # User search β βββ chat.js # Messaging system β βββ profile.js # Profile management β βββ refresh.js # Pull to refresh β βββ forgot.js # Forgot password flow βββ logo.png # App logo βββ index.html # Main HTML file
- Node.js v16 or above
- MongoDB (local or Atlas)
- Git
1. Clone the repository
git clone https://github.com/yourusername/SyncSphere.git
cd SyncSphere2. Install backend dependencies
cd backend
npm install3. Create .env file in backend folder
4. Start the backend
npm run dev5. Open the frontend
- Open
frontend/index.htmlin your browser - Or use VS Code Live Server extension
| Variable | Description |
|---|---|
| MONGO_URI | MongoDB connection string |
| JWT_SECRET | Secret key for JWT tokens |
| PORT | Backend server port (default 5000) |
| EMAIL_USER | Gmail address for sending emails |
| BREVO_API_KEY | Brevo API key for OTP emails |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register | Register new user |
| POST | /api/auth/login | Login user |
| POST | /api/forgot/send-otp | Send OTP to email |
| POST | /api/forgot/verify-otp | Verify OTP |
| POST | /api/forgot/reset-password | Reset password |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users/search?q= | Search users |
| GET | /api/users/:username | Get user profile |
| PUT | /api/users/profile/update | Update profile |
| PUT | /api/users/privacy/toggle | Toggle private/public |
| POST | /api/users/:id/follow | Follow or unfollow |
| POST | /api/users/:id/block | Block user |
| POST | /api/users/:id/unblock | Unblock user |
| POST | /api/users/:id/report | Report user |
| GET | /api/users/blocked/list | Get blocked users |
| GET | /api/users/follow-requests/list | Get follow requests |
| PUT | /api/users/follow-requests/:id/accept | Accept follow request |
| PUT | /api/users/follow-requests/:id/decline | Decline follow request |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/posts/feed | Get feed posts |
| POST | /api/posts | Create new post |
| POST | /api/posts/:id/like | Like or unlike post |
| DELETE | /api/posts/:id | Delete post |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/messages/threads | Get chat threads |
| GET | /api/messages/requests | Get message requests |
| GET | /api/messages/:userId | Get conversation |
| POST | /api/messages | Send message |
| POST | /api/messages/request | Send message request |
| PUT | /api/messages/request/:id/accept | Accept message request |
| PUT | /api/messages/request/:id/decline | Decline message request |
- Passwords hashed using bcryptjs
- JWT token authentication on all protected routes
- Environment variables for all secrets
- CORS configured for frontend domain
- Private account system
- Block and report functionality
- Message request system
Add your screenshots here
- Notification system
- Post comments
- Stories feature
- Login with username
- Online/offline status
- Read receipts in chat
- Typing indicator
- Save/bookmark posts
- Explore page
- Hashtag support
- Multiple images per post
- Email verification on signup
- Change password from profile
Pull requests are welcome. For major changes please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License.
Built by Madhusudan Yadav
- GitHub: @madhusudan4321
SyncSphere β Connect, Share, Sync π