A Community-Driven Social Media Platform for Students
StudentHub is a specialized social media platform designed to connect students, foster collaboration, and build a vibrant community around project-based learning. Whether you're looking to showcase your latest project, find collaboration partners, or engage with fellow students through interactive content, StudentHub provides the perfect environment for academic and creative growth.
- π Project Posts: Share detailed project updates with rich media support
- π¬ Reels & Videos: Create and share engaging short-form content to showcase your work
- π₯ User Profiles: Comprehensive profiles with project portfolios and achievement tracking
- β€οΈ Social Interactions: Like, comment, and engage with community content
- π€ Follow System: Build your network by following other students and creators
- π¬ Real-time Chat: Instant messaging powered by Socket.io for seamless communication
- π€ Collaboration Requests: Find and connect with project partners based on skills and interests
- π Live Notifications: Stay updated with real-time notifications for interactions and messages
- π― Project Discovery: Advanced search and filtering to find relevant projects and collaborators
- π Secure Authentication: JWT-based authentication with secure user sessions
- π± Responsive Design: Optimized for both desktop and mobile devices
- β‘ Real-time Updates: Live feed updates and instant message delivery
- π¨ Modern UI: Clean, intuitive interface built with modern web technologies
- React.js - Component-based UI library for building interactive interfaces
- Material-UI - Modern React component library for consistent design
- Socket.io Client - Real-time communication on the client side
- Axios - HTTP client for API requests
- React Router - Client-side routing and navigation
- Node.js - JavaScript runtime for server-side development
- Express.js - Fast, unopinionated web framework for Node.js
- Socket.io - Real-time bidirectional event-based communication
- JWT (JSON Web Tokens) - Secure authentication and authorization
- bcrypt - Password hashing for security
- MongoDB - NoSQL database for flexible data storage
- Mongoose - MongoDB object modeling for Node.js
- dotenv - Environment variable management
- CORS - Cross-origin resource sharing
- Multer - File upload handling
- Render account
- Your project pushed to a GitHub repository
-
Log in to Render
- Go to Render Dashboard
- Sign in or create an account
-
Create a New Web Service
- Click "New +" and select "Web Service"
- Connect your GitHub repository
- Select the repository with your StudentHub project
-
Configure the Web Service
- Name: Choose a name for your service (e.g., studenthub)
- Environment: Select "Node"
- Build Command:
npm install && npm run build - Start Command:
npm start
-
Set Environment Variables
- Scroll down to the "Environment" section
- Add all required environment variables:
Note: Render automatically sets the PORT environment variable, but you can specify a custom one if needed.
NODE_ENV=production MONGO_URI=your_mongodb_connection_string TOKEN_KEY=your_jwt_secret_key ACCESS_TOKEN_SECRET=your_access_token_secret ACCESS_TOKEN_EXPIRY=2h ACCESS_REFRESH_TOKEN=your_refresh_token_secret REFRESH_TOKEN_EXPIRY=7d PORT=10000
-
Deploy the Service
- Click "Create Web Service"
- Wait for the build and deployment to complete
-
Access Your Deployed Application
- Once deployment is successful, your app will be available at the URL provided by Render
- The URL will be in the format:
https://your-service-name.onrender.com
When you push changes to your connected GitHub repository, Render will automatically rebuild and deploy your application. For manual deployments:
- Go to your Web Service in the Render dashboard
- Click "Manual Deploy" and select "Deploy latest commit"
- Node.js (v14 or higher)
- npm or yarn package manager
- MongoDB Atlas account or local MongoDB installation
- Git
-
Clone the Repository
git clone https://github.com/yourusername/StudentHub.git cd StudentHub -
Install Backend Dependencies
npm install
-
Install Frontend Dependencies
cd client npm install cd ..
-
Environment Configuration
Create a
.envfile in the root directory:touch .env
Configure your environment variables:
# Database Configuration MONGO_URI=mongodb+srv://username:[email protected]/studenthub?retryWrites=true&w=majority # Authentication TOKEN_KEY=your_super_secret_jwt_key_here ACCESS_TOKEN_SECRET=your_access_token_secret ACCESS_TOKEN_EXPIRY=2h ACCESS_REFRESH_TOKEN=your_refresh_token_secret REFRESH_TOKEN_EXPIRY=7d # Server Configuration PORT=4000 NODE_ENV=development
-
Database Setup
Ensure your MongoDB connection is properly configured. If using MongoDB Atlas:
- Create a free cluster at MongoDB Atlas
- Whitelist your IP address
- Create a database user
- Replace the MONGO_URI in your
.envfile
-
Start the Development Servers
Backend Server:
npm run server # or npm startFrontend Development Server (New Terminal):
cd client npm start -
Access the Application
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:4000 - Socket.io:
ws://localhost:4000
- Frontend:
- Sign Up: Create your account with username, email, and password
- Complete Profile: Add your bio, skills, and interests
- Explore: Browse the feed to discover projects and connect with other students
- Post Projects: Share your work with detailed descriptions, images, and videos
- Create Reels: Record or upload short videos to showcase quick demos or updates
- Engage: Like, comment, and share content from your network
- Find Partners: Use search filters to find students with complementary skills
- Send Requests: Reach out to potential collaborators through the platform
- Real-time Chat: Communicate instantly with your connections
- Follow Users: Build your network by following interesting creators
- Get Followers: Share quality content to attract followers
- Stay Updated: Receive notifications for interactions and new content
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β React Client β β Express Server β β MongoDB β
β βββββΊβ βββββΊβ Database β
β - Components β β - REST APIs β β - User Data β
β - State Mgmt β β - Authenticationβ β - Posts β
β - Socket.io β β - Socket.io β β - Messages β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
Frontend Structure:
- Components: Reusable UI components (Header, Post, UserCard, etc.)
- Pages: Main application views (Home, Profile, Chat, etc.)
- Hooks: Custom React hooks for state management and API calls
- Utils: Helper functions and Socket.io configuration