A modern file-sharing platform for students to share study materials with their classmates. Built with React, Node.js, and Google Drive integration.
- π Google Authentication - Secure login with Google accounts
- βοΈ Google Drive Storage - Files automatically uploaded to user's Google Drive
- π Multiple File Types - Support for PDF, DOC, PPT, TXT, ZIP, Images, Videos
- π Search - Search files by name, description, or search users by name/username
- π Categories - Browse files by type (Documents, Presentations, Images, Videos, Archives)
- π€ User Profiles - View user profiles and their uploaded files
- π Statistics - Track downloads, views, and file counts
- π Modern UI - Clean, responsive design with smooth animations
- React 18 with Vite
- Tailwind CSS for styling
- Framer Motion for animations
- React Router for navigation
- Axios for API calls
- Node.js with Express
- MongoDB with Mongoose
- Google Drive API for file storage
- JWT for authentication
Before you begin, ensure you have:
- Node.js 18+ installed
- MongoDB installed locally or a MongoDB Atlas account
- A Google Cloud Console account
cd CareToShare
# Install all dependencies (root, client, and server)
npm run install:all-
Go to Google Cloud Console
-
Create a new project or select an existing one
-
Enable the following APIs:
- Google Drive API
- Google+ API (for OAuth)
-
Create OAuth 2.0 Credentials:
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Web application
- Add authorized JavaScript origins:
http://localhost:3000(development)- Your production URL
- Add authorized redirect URIs:
http://localhost:3000(development)- Your production URL
- Copy the Client ID
-
Configure OAuth Consent Screen:
- Go to APIs & Services > OAuth consent screen
- Fill in the required information
- Add scopes:
../auth/userinfo.email../auth/userinfo.profile../auth/drive.file
Client (.env in /client folder):
cd client
cp .env.example .envEdit .env:
VITE_GOOGLE_CLIENT_ID=your-google-client-id
Server (.env in /server folder):
cd server
cp .env.example .envEdit .env:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/caretoshare
JWT_SECRET=your-super-secret-jwt-key-generate-a-random-string
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
If using local MongoDB:
mongodOr use MongoDB Atlas and update the MONGODB_URI in your .env file.
From the root directory:
npm run devThis will start both the client (port 3000) and server (port 5000) concurrently.
Or run them separately:
# Terminal 1 - Server
cd server
npm run dev
# Terminal 2 - Client
cd client
npm run devVisit http://localhost:3000 to see the application!
CareToShare/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable components
β β βββ context/ # React context (Auth)
β β βββ pages/ # Page components
β β βββ utils/ # Utility functions
β β βββ App.jsx # Main app component
β β βββ main.jsx # Entry point
β βββ ...
βββ server/ # Node.js backend
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ middleware/ # Express middleware
β βββ index.js # Server entry point
βββ package.json # Root package.json
POST /api/auth/google/token- Login with Google
GET /api/files/recent- Get recent filesGET /api/files/popular- Get popular filesGET /api/files/category- Get files by categoryGET /api/files/my-files- Get user's files (auth required)GET /api/files/:id- Get single filePOST /api/files/upload- Upload file (auth required)POST /api/files/:id/download- Record downloadDELETE /api/files/:id- Delete file (auth required)
PUT /api/users/profile- Update profile (auth required)GET /api/users/:id- Get user profile
GET /api/search?q=query- Search files and users
GET /api/stats- Get platform statistics
- Build the client:
cd client && npm run build - Deploy the
distfolder - Set environment variable
VITE_GOOGLE_CLIENT_ID
- Deploy the
serverfolder - Set environment variables:
MONGODB_URIJWT_SECRETGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET
- Frontend: Vercel, Netlify, GitHub Pages
- Backend: Railway, Render, Cyclic
- Database: MongoDB Atlas (free tier)
- Sign In: Click "Continue with Google" to sign in
- Upload: Click "Upload" and drag/drop or select a file
- Browse: Explore files by category or use search
- Download: Click on any file to view details and download
- Profile: Update your display name and username
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License.
Made with β€οΈ for students everywhere!