Skip to content

Siyam-Bhuiyan/UniSphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

189 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

UniSphere

A Modern Social Platform for University Students

πŸ“‹ Table of Contents

🌟 Overview

UniSphere is a social networking platform designed specifically for university students, enabling them to connect, collaborate, and share resources within their academic community.

✨ Features

  • User Authentication

    • Secure email & password authentication
    • OAuth integration (Google, GitHub)
    • JWT-based session management
  • Profile Management

    • Customizable user profiles
    • Academic information integration
    • Skills and interests showcase
  • Social Networking

    • Connect with fellow students
    • Join university-specific groups
    • Real-time messaging system
  • Content Sharing

    • Post updates and announcements
    • Share academic resources
    • Create and join events

πŸ›  Tech Stack

  • Frontend

    • React.js
    • Redux for state management
    • Material-UI components
    • Socket.io client
  • Backend

    • Node.js & Express
    • MongoDB database
    • JWT authentication
    • Socket.io for real-time features

πŸ— System Architecture

Frontend Architecture

  • Component Structure
    • Atomic Design Pattern
    • Reusable UI Components
    • Custom Hooks for Business Logic
    • Redux Store Structure
      • Auth State
      • User State
      • Posts State
      • Messages State

Backend Architecture

  • RESTful API Design
    • Resource-based Routes
    • JWT Authentication Middleware
    • Rate Limiting
    • Request Validation
  • Database Schema
    • Users Collection
    • Posts Collection
    • Messages Collection
    • Groups Collection
  • WebSocket Integration
    • Real-time Message Handling
    • Live Notifications
    • Online Status Management

πŸ”§ Detailed Feature Documentation

Authentication System

  • JWT-based Authentication
    • Access Token (24h expiry)
    • Refresh Token (7 days expiry)
    • Secure HTTP-only Cookies
  • OAuth Providers
    • Google Sign-in
    • GitHub Integration
    • University Email Verification
  • Security Features
    • Password Hashing (bcrypt)
    • Rate Limiting
    • CORS Protection

Profile System

  • User Profiles
    • Basic Information
      • Full Name
      • University
      • Major/Course
      • Year of Study
    • Academic Details
      • Course Schedule
      • Study Groups
      • Academic Achievements
    • Social Features
      • Skills Badge System
      • Endorsements
      • Connection Network

Content Management

  • Post Types
    • Text Posts
    • Media Posts (Images/Videos)
    • Academic Resources
    • Event Announcements
  • Interaction Features
    • Likes and Comments
    • Share Functionality
    • Save for Later
  • Content Moderation
    • Report System
    • Auto-moderation
    • Content Filtering

πŸš€ Getting Started

Prerequisites

  • Node.js (v18.x or higher)
  • npm or yarn
  • MongoDB (local or Atlas URI)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/unisphere.git
    cd unisphere
  2. Install server dependencies

    npm install
  3. Install client dependencies

    cd client
    npm install
  4. Create .env file in root directory

    NODE_ENV=development
    PORT=5000
    MONGODB_URI=your_mongodb_uri
    JWT_SECRET=your_jwt_secret
  5. Create .env file in client directory

    REACT_APP_API_URL=http://localhost:5000

πŸ’» Development

  1. Start the development server

    # In root directory
    npm run dev
  2. Start the client

    # In client directory
    npm start

The application will be available at http://localhost:3000

πŸ§ͺ Testing

Frontend Testing

cd client
npm run test
  • Unit Tests (Jest)
  • Component Tests (React Testing Library)
  • E2E Tests (Cypress)

Backend Testing

npm run test:server
  • API Tests (Supertest)
  • Unit Tests (Mocha/Chai)
  • Integration Tests

πŸ› Troubleshooting

Common Issues

  1. MongoDB Connection Issues

    # Check MongoDB status
    mongo --eval "db.adminCommand('ping')"
  2. WebSocket Connection Errors

    • Ensure correct WebSocket URL
    • Check firewall settings
    • Verify SSL certificates
  3. Build Problems

    # Clear cache and node_modules
    rm -rf node_modules
    rm -rf client/node_modules
    npm cache clean --force

πŸ“Š Performance Optimization

Frontend Optimization

  • Code Splitting
  • Lazy Loading
  • Image Optimization
  • Caching Strategies
  • Bundle Size Analysis

Backend Optimization

  • Database Indexing
  • Query Optimization
  • Caching Layer (Redis)
  • Load Balancing

πŸ” Security Measures

  • CSRF Protection
  • XSS Prevention
  • SQL Injection Protection
  • Input Validation
  • Rate Limiting
  • Security Headers

πŸ“ˆ Monitoring

  • Performance Metrics
  • Error Tracking
  • User Analytics
  • Server Health Monitoring

🚒 Deployment

Deploying to Render

  1. Fork and push your code to GitHub

  2. Create a Render account at render.com

  3. In Render Dashboard:

    • Click "New +" β†’ "Blueprint"
    • Connect your GitHub repository
    • Select the repository
  4. Configure Environment Variables:

    NODE_ENV=production
    MONGODB_URI=your_production_mongodb_uri
    JWT_SECRET=your_production_jwt_secret
    
  5. Deploy:

πŸ“ Project Structure

unisphere/
β”œβ”€β”€ client/                 # React frontend
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   └── package.json
β”œβ”€β”€ server/                 # Node.js backend
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   └── server.js
β”œβ”€β”€ package.json
└── render.yaml

πŸ“š API Documentation

API documentation is available at /api/docs when running the server locally.

🀝 Contributing

  1. Fork the repository
  2. Create a new branch
  3. Make your changes
  4. Submit a pull request

πŸ“ License

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


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages