A modern, secure file sharing platform built with React, Node.js, Express, MongoDB, and React Native. Features advanced link sharing with access controls, user management, and beautiful glassmorphism UI across web and mobile platforms.
- JWT-based authentication with refresh tokens
- Role-based access control (User/Superuser)
- Rate limiting and security headers
- Activity logging and audit trails
- GridFS storage for large files (50MB limit)
- Custom filename support
- File favorites and search
- Bulk operations and download tracking
- Custom link names with unique validation
- Multiple expiration options (time/date/never)
- Access limits and usage tracking
- Verification systems (password/username)
- Scope control (public/users/selected)
- Download permission control
- Web: Glassmorphism design with live lightning effects
- Mobile: Native iOS/Android experience with React Native
- Dark/light theme support
- Fully responsive design
- Advanced search and filtering
- Real-time updates and notifications
- User account management
- Role assignment and permissions
- Activity monitoring and logs
- System-wide overview
- Native iOS and Android support via Expo Go
- Offline data persistence with AsyncStorage
- Real-time synchronization with WebSocket
- Touch-optimized interface
- Pull-to-refresh functionality
- File upload with progress tracking
- Bottom tab navigation
- Web Client: React + TypeScript + Vite
- Mobile Client: React Native + Expo Go
- Styling: Tailwind CSS (Web) + React Native StyleSheet (Mobile)
- State Management: Context API + Custom Hooks
- Real-time: Socket.io Client
- Server: Node.js + Express
- Database: MongoDB + GridFS
- Authentication: JWT + bcrypt
- Real-time: Socket.io
- File Storage: GridFS (MongoDB)
- Node.js (v16 or higher)
- MongoDB (local or Atlas)
- Expo CLI (for mobile development)
- iOS Simulator or Android Emulator (optional)
-
Clone the repository
git clone <repository-url> cd guardshare
-
Install dependencies
npm install cd server && npm install cd ../client-mobile && npm install cd ..
-
Environment Setup
cp .env.example .env
Edit
.env
with your configuration:# Database MONGODB_URI=mongodb://localhost:27017/guardshare # JWT JWT_SECRET=your-super-secure-jwt-secret-key-here JWT_EXPIRES_IN=7d # Server PORT=5000 NODE_ENV=development # Client URL (for CORS) CLIENT_URL=http://localhost:5173
-
Create Superuser Account
cd server npm run create-superuser
This creates:
- Superuser:
admin
/admin123
- Demo User:
demo
/demo123
- Superuser:
-
Start All Services
npm run dev
This starts:
- Web Client: http://localhost:5173
- Server: http://localhost:5000
- Mobile: Expo development server
-
Install Expo CLI globally
npm install -g @expo/cli
-
Start the mobile development server
cd client-mobile npm run dev
-
Run on device/simulator
- iOS: Press
i
in terminal or scan QR code with Camera app - Android: Press
a
in terminal or scan QR code with Expo Go app - Web: Press
w
in terminal
- iOS: Press
client-mobile/
βββ src/
β βββ components/ # Reusable components
β β βββ common/ # Common UI components
β β βββ ...
β βββ contexts/ # React contexts
β β βββ AuthContext.jsx
β β βββ ThemeContext.jsx
β β βββ DataContext.jsx
β βββ screens/ # Screen components
β β βββ auth/ # Authentication screens
β β βββ main/ # Main app screens
β β βββ public/ # Public screens
β βββ services/ # API services
β β βββ api.js
β β βββ socketService.js
β βββ ...
βββ App.jsx # Main app component
βββ app.json # Expo configuration
βββ package.json # Dependencies
guardshare/
βββ src/ # React web frontend
β βββ components/ # Reusable components
β βββ contexts/ # React contexts
β βββ pages/ # Page components
β βββ services/ # API services
β βββ styles/ # Global styles
βββ client-mobile/ # React Native mobile app
β βββ src/ # Mobile app source
β βββ App.jsx # Mobile app entry
β βββ app.json # Expo configuration
βββ server/ # Node.js backend
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ middleware/ # Express middleware
β βββ scripts/ # Utility scripts
β βββ utils/ # Helper functions
βββ docs/ # Documentation
npm run dev
- Start all services (web, server, mobile)npm run client
- Start web client onlynpm run server
- Start backend server onlynpm run mobile
- Start mobile development servernpm run build
- Build web client for production
cd client-mobile && npm run dev
- Start Expo development servercd client-mobile && npm run android
- Run on Androidcd client-mobile && npm run ios
- Run on iOScd client-mobile && npm run web
- Run mobile app in web browser
cd server && npm run create-superuser
- Create admin account
- Authentication: Login/Register with secure token storage
- File Management: Upload, view, delete files with progress tracking
- Link Sharing: Create and manage shareable links
- Real-time Updates: Live synchronization across devices
- Offline Support: Local data persistence with AsyncStorage
- Bottom Tab Navigation: Intuitive navigation between main sections
- Pull-to-Refresh: Refresh data with native pull gesture
- Modal Interfaces: Full-screen modals for complex interactions
- Touch Feedback: Proper haptic and visual feedback
- Responsive Design: Adapts to different screen sizes
- Dark/Light Theme: System-aware theme switching
- File Upload: Progress tracking with FormData
- Image Caching: Optimized image loading and caching
- Socket Integration: Real-time updates via WebSocket
- Error Handling: Comprehensive error states and recovery
- Loading States: Proper loading indicators throughout
The API documentation is available in api-routes.txt
with complete endpoint details, request/response formats, and authentication requirements.
- Authentication:
/api/auth/*
- File Management:
/api/files/*
- Link Sharing:
/api/links/*
- User Management:
/api/users/*
(Superuser only)
- Upload and manage files
- Create and manage shareable links
- Access shared links (based on permissions)
- Update profile settings
- All user permissions
- Manage all users and their data
- View system-wide statistics
- Access admin panels and logs
- Rate Limiting: Prevents API abuse
- CORS Protection: Configured for production
- Input Validation: Comprehensive data validation
- File Security: Safe file upload and storage
- Access Control: Granular permission system
- Activity Logging: Complete audit trail
- Secure Storage: Encrypted token storage on mobile
npm run build
cd client-mobile
expo build:android # For Android APK
expo build:ios # For iOS IPA
Ensure all production environment variables are set:
MONGODB_URI
: Production MongoDB connectionJWT_SECRET
: Strong, unique secret keyNODE_ENV=production
CLIENT_URL
: Production client URL
- Web Frontend: Netlify, Vercel, or CDN
- Mobile App: App Store / Google Play Store
- Backend: Railway, Heroku, or VPS
- Database: MongoDB Atlas
- File Storage: GridFS (included) or cloud storage
npm run test
cd client-mobile
npm run test
- Test on multiple devices and screen sizes
- Verify API integration across platforms
- Test offline functionality
- Validate real-time updates
- Check responsive layouts
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please check the documentation or create an issue in the repository.
GuardShare - Secure file sharing reimagined across all platforms β‘π‘οΈπ±