A Modern Platform for Academic Resource Sharing
π Live Demo β’ π Documentation β’ π Report Bug β’ β¨ Request Feature
- Overview
- Key Features
- Tech Stack
- Live Deployment
- Getting Started
- API Documentation
- Project Structure
- Screenshots
- Contributing
- License
StudyShare is a comprehensive full-stack web application designed to revolutionize how students share and discover academic resources. Built with the MERN stack and powered by AWS S3, it provides a secure, scalable, and user-friendly platform for educational content collaboration.
- π€ Seamless Sharing: Upload and organize study materials with rich metadata
- π Smart Discovery: Advanced search and filtering to find exactly what you need
- π₯ Community Driven: Upvote, comment, and engage with educational content
- π Secure & Reliable: JWT authentication and AWS S3 for enterprise-grade security
- β‘ Lightning Fast: Built with modern tech stack for optimal performance
- β Secure user registration with email verification
- β JWT-based authentication system
- β Password reset via email with secure tokens
- β Protected routes and role-based access control
- β Multi-format file uploads (PDF, DOCX, PPTX, images)
- β Rich metadata tagging (subject, department, semester)
- β Intelligent categorization system
- β Full CRUD operations on resources
- β Cloud storage with AWS S3 integration
- β Full-text search across resources
- β Filter by department, semester, and file type
- β Sort by recency, popularity, or engagement
- β Tag-based discovery system
- β Upvote system to highlight quality content
- β Threaded comment discussions
- β User profiles and contribution tracking
- β Activity dashboard
- β Personal profile management
- β Upload history and analytics
- β Favorite resources collection
- β Activity timeline
|
|
StudyShare is deployed on Render using a microservices architecture:
| Service | URL | Status |
|---|---|---|
| π¨ Frontend | study-share-frontend.onrender.com | |
| βοΈ Backend API | study-share-backend.onrender.com/api |
Despite being developed as a monorepo, the application is deployed as two independent services:
graph LR
A[User] --> B[Frontend - Render]
B --> C[Backend API - Render]
C --> D[MongoDB Atlas]
C --> E[AWS S3]
style A fill:#61DAFB
style B fill:#646CFF
style C fill:#339933
style D fill:#47A248
style E fill:#FF9900
Build Command: npm install && npm run build
Publish Directory: dist
Environment Variables:
VITE_API_URL: https://study-share-backend.onrender.com/apiBuild Command: npm install && npm run build
Start Command: node dist/server.js
Environment Variables:
PORT: 10000
MONGODB_URI: <mongodb_connection_string>
JWT_SECRET: <jwt_secret>
AWS_ACCESS_KEY_ID: <aws_key>
AWS_SECRET_ACCESS_KEY: <aws_secret>
AWS_REGION: <aws_region>
S3_BUCKET_NAME: <bucket_name>
FRONTEND_URL: https://study-share-frontend.onrender.comExpress 5.x Path-to-RegExp Error
If you encounter this error:
TypeError: Missing parameter name at 1: https://git.new/pathToRegexpError
Solution: Ensure all routes follow Express 5.x path syntax. See the Express 5 Migration Guide.
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher) - Download
- MongoDB (local or Atlas) - Setup Guide
- AWS Account with S3 access - Create Account
- Git - Download
git clone https://github.com/yourusername/study-share.git
cd study-share# Navigate to backend directory
cd Backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Configure your .env file (see configuration below)
nano .env
# Start development server
npm run devBackend Environment Variables (.env):
# Server Configuration
PORT=5000
NODE_ENV=development
# Database
MONGODB_URI=mongodb://localhost:27017/studyshare
# Or for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/studyshare
# Frontend URL
FRONTEND_URL=http://localhost:5173
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-here
JWT_EXPIRY=7d
# AWS S3 Configuration
AWS_ACCESS_KEY_ID=your-aws-access-key-id
AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-s3-bucket-name
# Email Configuration (for password reset)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-specific-password
EMAIL_FROM=noreply@studyshare.com# Open a new terminal and navigate to frontend directory
cd Frontend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Configure your .env file
nano .env
# Start development server
npm run devFrontend Environment Variables (.env):
# API Configuration
VITE_API_URL=http://localhost:5000/api
VITE_APP_ENV=development
# For Production (Render deployment)
# VITE_API_URL=https://study-share-backend.onrender.com/api
# VITE_APP_ENV=productionOpen your browser and navigate to:
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000/api
-
Create an S3 Bucket
- Login to AWS Console
- Navigate to S3 service
- Click "Create bucket"
- Choose a unique bucket name
- Select your preferred region
- Uncheck "Block all public access" (we'll use bucket policy for security)
-
Configure CORS Policy
Add this CORS configuration to your bucket:
[ { "AllowedHeaders": ["*"], "AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"], "AllowedOrigins": [ "http://localhost:5173", "https://study-share-frontend.onrender.com" ], "ExposeHeaders": ["ETag"], "MaxAgeSeconds": 3000 } ] -
Set Bucket Policy
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": ["s3:GetObject"], "Resource": ["arn:aws:s3:::your-bucket-name/*"] } ] } -
Create IAM User
- Navigate to IAM service
- Create a new user with programmatic access
- Attach policy:
AmazonS3FullAccess - Save the Access Key ID and Secret Access Key
Development: http://localhost:5000/api
Production: https://study-share-backend.onrender.com/api
POST /auth/register - Register a new user
Request Body:
{
"name": "John Doe",
"email": "john@example.com",
"password": "securePassword123",
"department": "Computer Science",
"semester": 3
}Response:
{
"success": true,
"message": "User registered successfully",
"data": {
"user": {
"id": "user_id",
"name": "John Doe",
"email": "john@example.com"
},
"token": "jwt_token"
}
}POST /auth/login - User login
Request Body:
{
"email": "john@example.com",
"password": "securePassword123"
}Response:
{
"success": true,
"data": {
"user": {
"id": "user_id",
"name": "John Doe",
"email": "john@example.com"
},
"token": "jwt_token"
}
}POST /auth/forgot-password - Request password reset
Request Body:
{
"email": "john@example.com"
}Response:
{
"success": true,
"message": "Password reset code sent to email"
}POST /resources - Upload a resource (π Protected)
Request: Multipart form-data
file: [File]
title: "Introduction to Algorithms"
description: "Comprehensive guide to algorithms"
subject: "Data Structures"
department: "Computer Science"
semester: 3
tags: ["algorithms", "data structures", "tutorial"]
Response:
{
"success": true,
"data": {
"id": "resource_id",
"title": "Introduction to Algorithms",
"fileUrl": "https://s3.amazonaws.com/...",
"uploadedBy": {
"id": "user_id",
"name": "John Doe"
}
}
}GET /resources - Get all resources
Query Parameters:
page: Page number (default: 1)limit: Items per page (default: 10)sort: Sort by (recent, popular, comments)
Response:
{
"success": true,
"data": {
"resources": [...],
"pagination": {
"total": 100,
"page": 1,
"pages": 10
}
}
}GET /resources/search - Search resources
Query Parameters:
q: Search querydepartment: Filter by departmentsemester: Filter by semesterfileType: Filter by file typetags: Filter by tags (comma-separated)
Response:
{
"success": true,
"data": {
"resources": [...],
"count": 25
}
}POST /resources/:id/upvote - Upvote a resource (π Protected)
Response:
{
"success": true,
"data": {
"upvoted": true,
"upvoteCount": 42
}
}POST /resources/:id/comment - Add a comment (π Protected)
Request Body:
{
"text": "Great resource! Very helpful."
}Response:
{
"success": true,
"data": {
"comment": {
"id": "comment_id",
"text": "Great resource! Very helpful.",
"user": {
"name": "John Doe"
},
"createdAt": "2025-01-30T10:00:00Z"
}
}
}GET /users/me - Get current user profile (π Protected)
Response:
{
"success": true,
"data": {
"user": {
"id": "user_id",
"name": "John Doe",
"email": "john@example.com",
"department": "Computer Science",
"semester": 3,
"resourcesUploaded": 15,
"createdAt": "2025-01-01T00:00:00Z"
}
}
}Backend/
βββ src/
β βββ app.ts # Express app configuration
β βββ server.ts # Application entry point
β βββ config/
β β βββ aws.ts # AWS S3 configuration
β β βββ database.ts # MongoDB connection
β βββ controllers/
β β βββ auth.controller.ts
β β βββ resource.controller.ts
β β βββ user.controller.ts
β βββ models/
β β βββ User.ts # User schema
β β βββ Resource.ts # Resource schema
β β βββ Comment.ts # Comment schema
β βββ routes/
β β βββ auth.routes.ts
β β βββ resource.routes.ts
β β βββ user.routes.ts
β βββ middlewares/
β β βββ auth.middleware.ts # JWT verification
β β βββ upload.middleware.ts # Multer S3 config
β β βββ validation.middleware.ts
β βββ utils/
β βββ jwt.ts # JWT utilities
β βββ email.ts # Email service
β βββ validators.ts # Input validators
βββ package.json
βββ tsconfig.json
Frontend/
βββ src/
β βββ main.tsx # Application entry
β βββ App.tsx # Root component
β βββ components/
β β βββ ui/ # shadcn-ui components
β β βββ layout/
β β β βββ Navbar.tsx
β β β βββ Footer.tsx
β β βββ resources/
β β βββ ResourceCard.tsx
β β βββ ResourceList.tsx
β β βββ UploadForm.tsx
β βββ pages/
β β βββ Home.tsx
β β βββ Dashboard.tsx
β β βββ Resources.tsx
β β βββ ResourceDetail.tsx
β β βββ Upload.tsx
β β βββ Auth/
β β βββ Login.tsx
β β βββ Register.tsx
β βββ context/
β β βββ AuthContext.tsx # Authentication state
β βββ hooks/
β β βββ useAuth.ts
β β βββ useResources.ts
β βββ services/
β β βββ api.ts # Axios instance
β β βββ auth.service.ts
β β βββ resource.service.ts
β βββ utils/
β βββ constants.ts
β βββ helpers.ts
βββ package.json
βββ vite.config.ts
βββ tailwind.config.js
Clean, modern landing page with featured resources
Comprehensive dashboard with upload history and analytics
Intuitive file upload with rich metadata options
We welcome contributions from the community! Here's how you can help:
-
Fork the repository
git clone https://github.com/yourusername/study-share.git
-
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Write clean, documented code
- Follow existing code style
- Add tests if applicable
-
Commit your changes
git commit -m 'Add some amazing feature' -
Push to the branch
git push origin feature/amazing-feature
-
Open a Pull Request
- Follow TypeScript best practices
- Use meaningful variable and function names
- Write comments for complex logic
- Ensure all tests pass before submitting PR
- Update documentation if needed
Found a bug or have a feature idea?
- Bug Reports: Create an issue with the "bug" label
- Feature Requests: Create an issue with the "enhancement" label
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2025 Viraj Gavade
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Viraj Gavade
- GitHub: @VirajGavade
- LinkedIn: Viraj Gavade
- Email: your.email@example.com
- Thanks to all contributors who have helped shape this project
- Inspired by the need for better academic resource sharing
- Built with β€οΈ for students, by students

