Skip to content

Nexus is a comprehensive social networking platform designed specifically for students and alumni of KIIT University. It provides a secure, feature-rich environment for networking, messaging, and professional development.

License

Notifications You must be signed in to change notification settings

techySPHINX/Nexus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nexus - Student & Alumni Networking Platform

License: UNLICENSED TypeScript React NestJS Prisma SendGrid

Nexus is a comprehensive social networking platform designed specifically for students and alumni of KIIT University. It provides a secure, feature-rich environment for networking, messaging, professional development, mentorship, and community building.

πŸš€ Features

πŸ” Authentication & User Management

  • Registration document-based registration (submit document URLs)
  • JWT-based Authentication with domain-specific email validation (@kiit.ac.in)
  • Role-based Access Control (Student, Alumni, Administrator)
  • Secure Password Hashing using bcrypt
  • Profile Management with skills, interests, location, and bio
  • File Upload System with Google Drive integration

🀝 Connection & Networking

  • Connection System - Send, accept, reject, and manage connection requests
  • User Search & Discovery with advanced filtering
  • Connection Suggestions based on mutual connections and interests
  • Professional Networking tools for career development

πŸ’¬ Real-time Communication

  • WebSocket-based Messaging with Socket.IO
  • Real-time Chat with typing indicators
  • Message Notifications with browser notifications
  • Unread Message Tracking with visual indicators
  • Message History with pagination

πŸ“ Content & Community

  • Post System with likes, comments, and voting
  • Sub-communities for specialized groups
  • Event Management and RSVP system
  • Showcase/Portfolio system for projects and achievements
  • File Sharing and collaboration tools

πŸŽ“ Mentorship & Learning

  • Mentorship System with mentor-mentee matching
  • Mentorship Applications and request management
  • Goal Setting and progress tracking
  • Meeting Scheduling and management
  • Feedback System for mentorship quality

πŸ† Gamification & Engagement

  • Badge System for achievements
  • Points and Rewards for platform engagement
  • Leaderboards and ranking system
  • Engagement Tracking and analytics

πŸ“§ Notifications & Communication

  • Email Notifications via SendGrid
  • In-app Notifications system
  • Real-time Updates for all platform activities
  • Notification Preferences and settings

πŸ› οΈ Tech Stack

Backend Technologies

  • NestJS - Progressive Node.js framework with TypeScript
  • Prisma - Next-generation ORM with PostgreSQL
  • PostgreSQL - Robust relational database
  • Socket.IO - Real-time bidirectional communication
  • JWT - Secure token-based authentication
  • Bcrypt - Password hashing
  • SendGrid - Email service integration
  • SendGrid - Email service integration
  • Google APIs - Google Drive integration
  • Multer - File upload handling
  • Swagger - API documentation

Frontend Technologies

Development Tools

πŸ“‹ Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • PostgreSQL (v12 or higher)
  • Git

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/techySPHINX/Nexus.git
cd Nexus

2. Install Dependencies

# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install

3. Environment Setup

Create environment files for both backend and frontend:

# Backend environment
cd backend
cp .env.example .env

Configure backend/.env:

# Database Configuration
DATABASE_URL="postgresql://username:password@localhost:5432/nexus_db"

# JWT Configuration
JWT_SECRET="your-super-secret-and-long-string-here"
JWT_EXPIRES_IN="7d"

# Application Configuration
PORT=3000
NODE_ENV=development

# Email Configuration (SendGrid)
SENDGRID_API_KEY="SG.your-sendgrid-api-key"
SENDGRID_FROM_EMAIL="noreply@nexus.kiit.ac.in"

# Google Drive Configuration
GOOGLE_DRIVE_CLIENT_ID="your-google-client-id"
GOOGLE_DRIVE_CLIENT_SECRET="your-google-client-secret"
GOOGLE_DRIVE_REDIRECT_URI="http://localhost:3000/auth/google/callback"

4. Database Setup

# Create PostgreSQL database
createdb nexus_db

# Run Prisma migrations
cd backend
npx prisma migrate dev --name init

# Generate Prisma client
npx prisma generate

# Seed the database (optional)
npm run seed

5. Start the Application

# Start backend server (Terminal 1)
cd backend
npm run start:dev

# Start frontend application (Terminal 2)
cd frontend
npm run dev

The application will be available at:

πŸ“ Project Structure

Nexus/
β”œβ”€β”€ backend/                          # NestJS Backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ auth/                     # Authentication module
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.controller.ts     # Auth endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.service.ts       # Auth business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ guards/               # JWT guards
β”‚   β”‚   β”‚   β”œβ”€β”€ strategies/            # Passport strategies
β”‚   β”‚   β”‚   └── dto/                  # Auth DTOs
β”‚   β”‚   β”œβ”€β”€ user/                     # User management
β”‚   β”‚   β”œβ”€β”€ connection/               # Connection system
β”‚   β”‚   β”œβ”€β”€ messaging/                # Real-time messaging
β”‚   β”‚   β”‚   β”œβ”€β”€ messaging.controller.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ messaging.service.ts
β”‚   β”‚   β”‚   └── messaging.gateway.improved.ts  # WebSocket gateway
β”‚   β”‚   β”œβ”€β”€ post/                     # Post system
β”‚   β”‚   β”œβ”€β”€ sub-community/            # Sub-community management
β”‚   β”‚   β”œβ”€β”€ mentorship/               # Mentorship system
β”‚   β”‚   β”œβ”€β”€ showcase/                 # Project showcase
β”‚   β”‚   β”œβ”€β”€ gamification/            # Badges and points
β”‚   β”‚   β”œβ”€β”€ notification/            # Notification system
β”‚   β”‚   β”œβ”€β”€ email/                    # Email service
β”‚   β”‚   β”œβ”€β”€ admin/                    # Admin controllers (document verification)
β”‚   β”‚   β”œβ”€β”€ test/                     # Test utilities and scripts
β”‚   β”‚   β”œβ”€β”€ files/                    # File upload/management
β”‚   β”‚   β”œβ”€β”€ events/                   # Event management
β”‚   β”‚   β”œβ”€β”€ engagement/               # Engagement tracking
β”‚   β”‚   β”œβ”€β”€ referral/                 # Referral system
β”‚   β”‚   β”œβ”€β”€ prisma/                   # Prisma service
β”‚   β”‚   └── common/                   # Shared utilities
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   └── schema.prisma             # Database schema
β”‚   β”œβ”€β”€ data/                         # Seed scripts
β”‚   └── uploads/                      # Uploaded files
β”œβ”€β”€ frontend/                         # React Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/               # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatBox.tsx           # Chat interface
β”‚   β”‚   β”‚   β”œβ”€β”€ MessageList.tsx       # Message display
β”‚   β”‚   β”‚   β”œβ”€β”€ MessageInput.tsx      # Message input
β”‚   β”‚   β”‚   └── Navbar.tsx            # Navigation
β”‚   β”‚   β”œβ”€β”€ pages/                    # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx         # Main dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ Admin/                 # Admin pages (document verification)
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatPage.tsx          # Chat page
β”‚   β”‚   β”‚   β”œβ”€β”€ Connections.tsx       # Connections page
β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.tsx           # User profile
β”‚   β”‚   β”‚   └── Posts/                # Post-related pages
β”‚   β”‚   β”œβ”€β”€ contexts/                 # React contexts
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx       # Authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ ThemeContext.tsx      # Theme management
β”‚   β”‚   β”‚   └── NotificationContext.tsx
β”‚   β”‚   β”œβ”€β”€ hooks/                     # Custom hooks
β”‚   β”‚   β”‚   └── useConnections.ts     # Connections logic
β”‚   β”‚   β”œβ”€β”€ services/                 # API services
β”‚   β”‚   β”‚   β”œβ”€β”€ api.ts                # Axios configuration
β”‚   β”‚   β”‚   └── websocket.improved.ts # WebSocket service
β”‚   β”‚   β”œβ”€β”€ types/                    # TypeScript types
β”‚   β”‚   β”œβ”€β”€ utils/                    # Utility functions
β”‚   β”‚   └── App.tsx                   # Main app component
β”‚   └── public/                       # Static assets
└── README.md                         # This file

πŸ”§ Development Workflow

Code Quality Tools

  • Prettier - Consistent code formatting
  • ESLint - Code quality and style enforcement
  • Husky - Git hooks for pre-commit checks
  • lint-staged - Run linters on staged files
  • Commitlint - Conventional commit message enforcement

Git Workflow

# Create feature branch
git checkout -b feature/your-feature-name

# Make changes and commit
git add .
git commit -m "feat: add new feature"

# Push and create PR
git push origin feature/your-feature-name

Commit Message Format

Follow Conventional Commits:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • style: - Code style changes
  • refactor: - Code refactoring
  • test: - Test additions/changes
  • chore: - Build/tooling changes

πŸ§ͺ Testing

# Backend tests
cd backend
npm run test              # Unit tests
npm run test:e2e         # End-to-end tests
npm run test:cov         # Coverage report

# Frontend tests
cd frontend
npm run test             # Run tests
npm run test:coverage    # Coverage report

πŸ“Š API Documentation

The API is documented using Swagger/OpenAPI. Access the interactive documentation at:

Key API Endpoints

Authentication

  • POST /auth/login - User login
  • POST /auth/register - User registration
  • POST /auth/refresh - Refresh JWT token

Users

  • GET /users - Get all users (paginated)
  • GET /users/:id - Get user by ID
  • PUT /users/:id - Update user profile
  • GET /users/search - Search users

Connections

  • GET /connection - Get user connections
  • POST /connection/send - Send connection request
  • PATCH /connection/status - Accept/reject connection
  • GET /connection/suggestions - Get connection suggestions

Messaging

  • GET /messages/conversations/all - Get all conversations
  • GET /messages/conversation/:userId - Get conversation with user
  • POST /messages - Send message
  • WebSocket /ws - Real-time messaging

πŸ”’ Security Features

  • JWT Authentication with secure token handling
  • Password Hashing using bcrypt with salt rounds
  • Domain Validation restricting emails to @kiit.ac.in
  • CORS Protection with configurable origins
  • Input Validation using class-validator DTOs
  • Role-based Access Control with guards and decorators
  • SQL Injection Prevention via Prisma ORM
  • XSS Protection with proper input sanitization

πŸš€ Deployment

Backend Deployment

# Build for production
cd backend
npm run build

# Start production server
npm run start:prod

Frontend Deployment

# Build for production
cd frontend
npm run build

# Serve static files
npm run preview

Environment Variables for Production

Ensure all environment variables are properly configured for production:

  • Database connection strings
  • JWT secrets
  • Email service credentials
  • Google API credentials
  • CORS origins

🀝 Contributing

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

Development Guidelines

  • Follow TypeScript best practices
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Follow the existing code style

πŸ“ License

This project is licensed under the UNLICENSED license - see the LICENSE file for details.

πŸ†˜ Support

  • Documentation: Check this README and inline code comments
  • Issues: Open an issue on GitHub for bugs or feature requests
  • Discussions: Use GitHub Discussions for questions and ideas

πŸ™ Acknowledgments

  • KIIT University for providing the platform requirements
  • All contributors who have helped build this platform
  • Open source libraries and frameworks used in this project

Built with ❀️ for the KIIT Community

About

Nexus is a comprehensive social networking platform designed specifically for students and alumni of KIIT University. It provides a secure, feature-rich environment for networking, messaging, and professional development.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •