Skip to content

About

This is my Real-time chat web application click below for live demo:πŸ‘‡

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

121 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SyncSphere 🌐

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.

🌍 Live Demo

Live Demo


πŸ“± Features

Authentication

  • 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

Feed & Posts

  • Instagram-style photo feed
  • Upload photos with captions
  • Like and unlike posts
  • View posts from followed users
  • Pull to refresh feed

Profile

  • Personal profile with post grid
  • Edit profile (name, bio, website)
  • Followers and following count
  • Public and private account toggle
  • Hamburger menu with settings

Follow System

  • Follow and unfollow users
  • Follow requests for private accounts
  • Accept or decline follow requests
  • Follow request notifications on profile

Messaging

  • Real-time chat between users
  • Message request system
  • Accept or decline message requests
  • Chat threads list
  • Auto reply simulation

Search

  • Search users by username or name
  • View any user's profile from search

Privacy & Safety

  • Private account mode
  • Block and unblock users
  • Report users with reason selection
  • Blocked users management list
  • Message requests from non-followers

UI/UX

  • 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

πŸ› οΈ Tech Stack

Frontend

  • HTML5
  • CSS3
  • Vanilla JavaScript
  • Google Fonts (Playfair Display + DM Sans)

Backend

  • Node.js
  • Express.js
  • MongoDB (Atlas)
  • Mongoose ODM

Packages Used

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

Deployment

  • Frontend: Render (Static Site)
  • Backend: Render (Web Service)
  • Database: MongoDB Atlas (Cloud)
  • Email: Brevo API

πŸ“ Project Structure

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


πŸš€ Getting Started

Prerequisites

  • Node.js v16 or above
  • MongoDB (local or Atlas)
  • Git

Installation

1. Clone the repository

git clone https://github.com/yourusername/SyncSphere.git
cd SyncSphere

2. Install backend dependencies

cd backend
npm install

3. Create .env file in backend folder

4. Start the backend

npm run dev

5. Open the frontend

  • Open frontend/index.html in your browser
  • Or use VS Code Live Server extension

πŸ”‘ Environment Variables

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

πŸ“‘ API Endpoints

Auth

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

Users

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

Posts

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

Messages

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

πŸ”’ Security Features

  • 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

πŸ“Έ Screenshots

Add your screenshots here


πŸ—ΊοΈ Roadmap

  • 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

🀝 Contributing

Pull requests are welcome. For major changes please open an issue first to discuss what you would like to change.


πŸ“„ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Developer

Built by Madhusudan Yadav


SyncSphere β€” Connect, Share, Sync 🌐

About

This is my Real-time chat web application click below for live demo:πŸ‘‡

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages