SHARAEIN is a modern, real-time file sharing application that allows users to create password-protected rooms and share files instantly with other users. Originally created for a backend development assignment, this project was built with genuine passion and addresses a real-world problem.
In our daily lives, people often resort to logging into WhatsApp or Telegram on public computers just to transfer files from their phones to computers. This creates a significant security risk as users frequently forget to log out of their personal accounts on public machines, potentially exposing their private conversations and data.
SHARAEIN eliminates this outdated and risky practice by providing a secure, temporary, and password-protected environment for file sharing without requiring any personal account login. Simply create a room, share the ID and password, transfer your files, and close the session - no personal data left behind.
This project was developed by:
- 5220411082 - Restu Sofyan Ma'arif
- 5220411358 - Musyafa Ali
- 5220411084 - Ahmad Sulaeman
- Create Private Rooms: Generate unique 6-character room IDs
- Password Protection: Secure rooms with custom passwords
- Easy Access: Simple room joining with ID and password
- Real-time Updates: Instant notifications when users join/leave
- Universal File Support: Upload ANY file type without restrictions
- Large File Support: Up to 500MB file size limit
- Drag & Drop: Modern file upload interface
- Real-time Sync: Files appear instantly for all room members
- Smart Icons: Automatic file type detection with appropriate icons
- JWT Authentication: Secure token-based sessions
- Password Hashing: bcrypt encryption for room passwords
- Route Protection: Prevent unauthorized room access
- Token Validation: Secure file download with token verification
- Responsive Design: Works on desktop and mobile devices
- Real-time Status: Live connection status indicators
- Toast Notifications: User-friendly feedback messages
- Tailwind CSS: Beautiful and consistent styling
- Framework: Express.js with TypeScript
- Database: SQLite with Prisma ORM
- Real-time: Socket.IO for live updates
- Authentication: JWT + bcrypt
- Validation: Zod schemas
- File Upload: Multer middleware
- Library: React.js with TypeScript
- Build Tool: Vite for fast development
- Styling: Tailwind CSS
- HTTP Client: Axios
- Routing: React Router
- Icons: Lucide React
- Notifications: React Hot Toast
- Node.js 18+ and npm
- Git (optional)
- Clone the repository
git clone <repository-url>
cd sharaein
- Setup Backend
cd server
npm install
cp .env.example .env
# Edit .env file with your configuration
npx prisma generate
npx prisma migrate dev --name init
npm run dev
- Setup Frontend (in new terminal)
cd client
npm install
cp .env.example .env
# Edit .env file with your backend URLs
npm run dev
- Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
DATABASE_URL="file:./dev.db"
JWT_SECRET="your-super-secret-jwt-key"
PORT=3000
CLIENT_URL="http://localhost:5173"
VITE_API_URL="http://localhost:3000/api"
VITE_SOCKET_URL="http://localhost:3000"
For accessing from external devices or sharing with others:
- Create dev tunnels
# Backend tunnel
devtunnel host -p 3000 --allow-anonymous
# Frontend tunnel
devtunnel host -p 5173 --allow-anonymous
- Update environment variables with tunnel URLs
The application includes auto-detection for dev tunnel environments!
sharaein/
βββ server/ # Backend Express.js
β βββ prisma/
β β βββ schema.prisma # Database schema
β βββ src/
β β βββ controllers/ # API logic
β β βββ routes/ # API endpoints
β β βββ services/ # Socket.IO handlers
β β βββ utils/ # Utilities & middleware
β β βββ index.ts # Server entry point
β βββ uploads/ # File storage
β βββ .env.example # Environment template
βββ client/ # Frontend React.js
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Application pages
β β βββ services/ # API & Socket clients
β β βββ hooks/ # Custom React hooks
β β βββ types/ # TypeScript definitions
β βββ .env.example # Environment template
βββ README.md
POST /api/rooms
- Create new roomPOST /api/rooms/join
- Join existing roomGET /api/rooms/:roomId/files
- Get room files
POST /api/files/rooms/:roomId/upload
- Upload fileDELETE /api/files/:fileId
- Delete fileGET /api/files/:fileId/download
- Download file
GET /api/health
- Server health status
join_room
- Join specific roomleave_room
- Leave room
new_file
- New file uploadedfile_deleted
- File deleteduser_joined
- User joined roomuser_left
- User left room
- Password Protection - All rooms secured with hashed passwords
- JWT Authentication - Secure session management
- Route Guards - Protected routes prevent unauthorized access
- Input Validation - Server-side validation with Zod
- CORS Protection - Configured for secure cross-origin requests
- File Size Limits - 500MB maximum file size
SHARAEIN supports ALL file types including:
- π Documents - PDF, Word, Excel, PowerPoint
- πΌοΈ Images - JPEG, PNG, GIF, SVG, WebP
- π΅ Audio - MP3, WAV, FLAC, OGG
- π¬ Video - MP4, AVI, MOV, MKV
- π¦ Archives - ZIP, RAR, 7Z, TAR, ISO
- π» Code - JS, TS, Python, Java, C++
- π§ Executables - EXE, MSI, APP, DEB
- And ANY other file format!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- File Preview - View images, PDFs, videos directly in browser
- Room Member List - Show who's currently in the room
- User Management - Kick users from room (room creator only)
- Room Settings - Edit room name and change password
- Dark Mode - Toggle between light and dark themes
- File Search - Search and filter files by name/type
- Mobile PWA - Progressive Web App for better mobile experience
Want to help implement these features? Feel free to:
- Pick an item from the TODO list
- Create an issue to discuss implementation
- Submit a pull request
- Built with modern web technologies
- Inspired by the need for simple, secure file sharing
- Thanks to the open-source community
Made with β€οΈ for seamless file sharing
β Star this repo if you find it helpful!