Skip to content

Aura++ (Social Media Application) is a full-featured Instagram clone built with modern web technologies. Experience social media like never before with real-time messaging, photo sharing, and seamless user interactions.

Notifications You must be signed in to change notification settings

sparshsharma81/Aura

Repository files navigation

🌟 Aura - Instagram Clone

React Node.js MongoDB Socket.IO License

Aura is a full-featured Instagram clone built with modern web technologies. Experience social media like never before with real-time messaging, photo sharing, and seamless user interactions.

Aura Preview

✨ Features

πŸ” Authentication & Security

  • JWT Authentication - Secure user login/registration
  • Password Encryption - bcrypt hashing for secure storage
  • Cookie-based Sessions - HTTP-only cookies for enhanced security
  • Protected Routes - Role-based access control

πŸ“Έ Post Management

  • Image Upload - Cloudinary integration for image storage
  • Image Optimization - Sharp.js for automatic resizing and compression
  • Create Posts - Upload photos with captions
  • Delete Posts - Remove your own posts (with admin override)
  • View Posts - Instagram-like feed with infinite scroll

πŸ’– Social Interactions

  • Like/Unlike Posts - Heart button functionality with duplicate prevention
  • Comments System - Add, view, and manage comments
  • Bookmark Posts - Save posts for later viewing
  • Follow/Unfollow - Build your social network
  • User Search - Find users with real-time search

πŸ’¬ Real-time Messaging

  • Direct Messages - Instagram-like chat interface
  • Real-time Delivery - Socket.IO powered instant messaging
  • Online Status - See who's online
  • Message Notifications - Live notification system
  • Conversation Management - Organized chat threads

πŸ‘€ User Profiles

  • Profile Customization - Edit bio, profile picture, and privacy settings
  • Private Accounts - Control who can see your content
  • Followers/Following Lists - View social connections
  • User Posts Grid - See all posts from any user

πŸ”§ Admin Features

  • User Management - Admin can remove users with complete data cleanup
  • Content Moderation - Comment filtering for inappropriate content
  • System Monitoring - Comprehensive error handling and logging

πŸ› οΈ Tech Stack

Backend

  • Node.js - Runtime environment
  • Express.js - Web application framework
  • MongoDB - NoSQL database with Mongoose ODM
  • Socket.IO - Real-time bidirectional communication
  • Cloudinary - Cloud-based image management
  • JWT - JSON Web Tokens for authentication
  • bcryptjs - Password hashing
  • Multer - File upload middleware
  • Sharp - Image processing

Frontend

  • React 19 - User interface library
  • Redux Toolkit - State management
  • Tailwind CSS - Utility-first CSS framework
  • Radix UI - Accessible component primitives
  • Axios - HTTP client
  • Lucide React - Icon library
  • Vite - Build tool and development server

πŸš€ Quick Start

Prerequisites

  • Node.js 20+ installed
  • MongoDB database (local or cloud)
  • Cloudinary account for image storage

Installation

  1. Clone the repository
git clone https://github.com/sparshsharma81/Aura.git
cd Aura
  1. Install dependencies
# Install all dependencies (backend + frontend)
npm run build
  1. Environment Setup

Create .env file in the backend directory:

PORT=5000
MONGO_URI=your_mongodb_connection_string
SECRET_KEY=your_jwt_secret_key
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
SPECIAL_USER_ID=admin_user_id_here
NODE_ENV=development
  1. Start the application
# Development mode
npm run dev

# Production mode
npm start

The app will be available at http://localhost:5000

πŸ“ Project Structure

Aura/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controllers/          # Business logic
β”‚   β”‚   β”œβ”€β”€ user.controller.js
β”‚   β”‚   β”œβ”€β”€ post.controller.js
β”‚   β”‚   └── message.controller.js
β”‚   β”œβ”€β”€ models/              # Database schemas
β”‚   β”‚   β”œβ”€β”€ user.model.js
β”‚   β”‚   β”œβ”€β”€ post.model.js
β”‚   β”‚   β”œβ”€β”€ comment.model.js
β”‚   β”‚   β”œβ”€β”€ message.model.js
β”‚   β”‚   └── conversation.model.js
β”‚   β”œβ”€β”€ routes/              # API endpoints
β”‚   β”‚   β”œβ”€β”€ user.route.js
β”‚   β”‚   β”œβ”€β”€ post.route.js
β”‚   β”‚   └── message.route.js
β”‚   β”œβ”€β”€ middlewares/         # Custom middleware
β”‚   β”‚   β”œβ”€β”€ isAuthenticated.js
β”‚   β”‚   β”œβ”€β”€ multer.js
β”‚   β”‚   └── isBlueTick.js
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   β”‚   β”œβ”€β”€ db.js
β”‚   β”‚   β”œβ”€β”€ cloudinary.js
β”‚   β”‚   └── datauri.js
β”‚   β”œβ”€β”€ socket/              # Real-time functionality
β”‚   β”‚   └── socket.js
β”‚   └── index.js             # Server entry point
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/          # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Messages.jsx
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ redux/           # State management
β”‚   β”‚   β”‚   β”œβ”€β”€ store.js
β”‚   β”‚   β”‚   β”œβ”€β”€ authSlice.js
β”‚   β”‚   β”‚   β”œβ”€β”€ postSlice.js
β”‚   β”‚   β”‚   └── chatSlice.js
β”‚   β”‚   β”œβ”€β”€ hooks/           # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ lib/            # Utility functions
β”‚   β”‚   └── main.jsx        # App entry point
β”‚   β”œβ”€β”€ public/             # Static assets
β”‚   └── package.json
└── README.md

πŸ”Œ API Endpoints

Authentication

  • POST /api/v1/user/register - User registration
  • POST /api/v1/user/login - User login
  • GET /api/v1/user/logout - User logout

User Management

  • GET /api/v1/user/:id/profile - Get user profile
  • POST /api/v1/user/profile/edit - Edit profile
  • GET /api/v1/user/suggested - Get suggested users
  • GET /api/v1/user/search?query=username - Search users
  • POST /api/v1/user/follow/:id - Follow/unfollow user

Posts

  • POST /api/v1/post/addpost - Create new post
  • GET /api/v1/post/all - Get all posts (feed)
  • GET /api/v1/post/userpost/all - Get user's posts
  • GET /api/v1/post/:id/like - Like post
  • GET /api/v1/post/:id/dislike - Unlike post
  • POST /api/v1/post/:id/comment - Add comment
  • DELETE /api/v1/post/delete/:id - Delete post
  • GET /api/v1/post/:id/bookmark - Bookmark post

Messages

  • POST /api/v1/message/send/:id - Send message
  • GET /api/v1/message/:id - Get conversation messages

🎨 UI Components

Core Components

  • MainLayout - App shell with navigation
  • LeftSideBar - Navigation menu
  • RightSideBar - Suggestions and activity
  • Feed - Main content area
  • Post - Individual post component
  • CreatePost - Post creation modal
  • Profile - User profile page
  • Messages - Chat interface
  • SearchBox - User search functionality

UI Library

  • Radix UI components for accessibility
  • Custom styled components with Tailwind CSS
  • Responsive design for all screen sizes

πŸ”„ Real-time Features

Socket.IO Events

  • newMessage - New chat message received
  • messageNotification - Message notification
  • notification - General notifications (likes, follows, comments)
  • user-online - User online status
  • user-offline - User offline status

πŸ§ͺ Development

Running in Development Mode

# Start backend server (with nodemon)
npm run dev

# Start frontend dev server
cd frontend && npm run dev

Building for Production

# Build frontend and start production server
npm run build
npm start

πŸ”’ Security Features

  • JWT Authentication with HTTP-only cookies
  • Password hashing with bcrypt (10 rounds)
  • CORS configuration for cross-origin requests
  • Input validation and sanitization
  • File upload restrictions (images only)
  • Rate limiting considerations
  • XSS protection with secure headers

πŸ—„οΈ Database Schema

User Model

  • Personal information (username, email, bio)
  • Social connections (followers, following)
  • Content references (posts, bookmarks)
  • Privacy settings (isPrivate)

Post Model

  • Content (image, caption)
  • Engagement (likes, comments)
  • Metadata (author, timestamp)

Message/Conversation Models

  • Real-time chat system
  • Participant management
  • Message history

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Cloudinary for image storage and optimization
  • MongoDB for flexible data storage
  • Socket.IO for real-time communication
  • Radix UI for accessible components
  • Tailwind CSS for rapid styling

πŸ“ž Contact

Sparsh Sharma - @sparshsharma81

Project Link: https://github.com/sparshsharma81/Aura


⭐ Star this repository if you found it helpful! ⭐
=======

About

Aura++ (Social Media Application) is a full-featured Instagram clone built with modern web technologies. Experience social media like never before with real-time messaging, photo sharing, and seamless user interactions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published