A modern, secure file management platform that allows users to upload, organize, and share files with enterprise-grade security and a beautiful user interface.
- File Upload - Upload files up to 50MB with real-time progress tracking
- Folder Management - Create, rename, and delete folders with nested structure support
- Secure Sharing - Generate expirable share links (1, 7, or 30 days)
- Authentication - Secure JWT-based authentication with HTTP-only cookies
- Storage Tracking - Real-time storage usage monitoring
- Modern UI - Beautiful dark theme with smooth Framer Motion animations
| Technology | Purpose |
|---|---|
| React 19 | UI Framework |
| Vite | Build Tool |
| Tailwind CSS 4 | Styling |
| Framer Motion | Animations |
| React Router | Navigation |
| Axios | HTTP Client |
| Technology | Purpose |
|---|---|
| Node.js + Express | Server Framework |
| Prisma ORM | Database Access |
| PostgreSQL | Database |
| Cloudinary | File Storage |
| JWT | Authentication |
| bcrypt | Password Hashing |
| Mutler Middleware | File Uploads |
rosync/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom React hooks
│ │ └── services/ # API service modules
│ └── package.json
│
├── backend/ # Express backend API
│ ├── controller/ # Route controllers
│ ├── routes/ # API route definitions
│ ├── prisma/ # Database schema
│ ├── config/ # Configuration files
│ └── package.json
│
└── README.md
- Node.js 18+
- PostgreSQL database
- Cloudinary account
git clone https://github.com/yourusername/rosync.git
cd rosynccd backend
npm installCreate a .env file with the following variables:
DATABASE_URL="postgresql://user:password@host:port/database"
JWT_SECRET="your-super-secret-jwt-key"
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"
FRONTEND_URL="http://localhost:5173"Run database migrations:
npx prisma generate
npx prisma db pushStart the backend server:
npm run devcd frontend
npm install
npm run devThe app will be available at http://localhost:5173
Rosync implements a secure, time-limited file sharing system:
- User Action: Click "Share" on any folder in the dashboard
- Duration Selection: Choose link validity (1, 7, or 30 days)
- Link Generation: Server creates a unique UUID-based share link
- Database Entry: A
ShareLinkrecord is created with:- Unique ID (UUID)
- Reference to the shared folder
- Expiration timestamp
- Public Access: Anyone with the link can access
/share/{shareId} - Validation: Server checks if the link exists and hasn't expired
- Content Display: If valid, folder contents (files + subfolders) are displayed
- Download: Users can download any file directly from the shared view
┌─────────────────────────────────────────────────────────────┐
│ User shares folder with 7-day expiry │
│ ↓ │
│ Server calculates: expiresAt = currentDate + 7 days │
│ ↓ │
│ ShareLink stored in database with expiresAt timestamp │
│ ↓ │
│ On access: Server compares current time vs expiresAt │
│ ↓ │
│ If expired → Returns 410 "Share link has expired" │
│ If valid → Returns folder contents + files │
└─────────────────────────────────────────────────────────────┘
Key Points:
- Expiration is validated server-side on every access request
- Expired links return HTTP 410 (Gone) status
- Share links are automatically orphaned when parent folder is deleted (cascade delete)
- No authentication required to access valid share links
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/signup |
Register new user |
| POST | /api/auth/login |
Login user |
| POST | /api/auth/logout |
Logout user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/folders/:parentId |
Get folders |
| POST | /api/folders |
Create folder |
| PUT | /api/folders/:id |
Rename folder |
| DELETE | /api/folders/:id |
Delete folder |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/files/:folderId |
Get files |
| POST | /api/files/upload |
Upload file |
| DELETE | /api/files/:id |
Delete file |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/share/:folderId |
Create share link |
| GET | /api/share/:shareId |
Get shared folder (public) |
model User {
id Int @id @default(autoincrement())
name String
email String @unique
password String
folders Folder[]
files File[]
}
model Folder {
id Int @id @default(autoincrement())
name String
userId Int
parentId Int? // Supports nested folders
files File[]
shareLinks ShareLink[]
}
model File {
id Int @id @default(autoincrement())
name String
size Int
mimeType String
url String // Cloudinary URL
folderId Int?
userId Int
}
model ShareLink {
id String @id @default(uuid())
folderId Int
expiresAt DateTime
}This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Roshiii