You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SmartShare β Intelligent File Compression & Secure Link Sharing Platform
SmartShare is a production-ready, full-stack file management platform that lets users securely upload, compress, deduplicate, version, and share files via protected short links β with real-time analytics, rate limiting, role-based access control, and a fully featured user profile system.
Email/Password Login & Registration via Firebase Authentication
Google OAuth Sign-In / Sign-Up β one-click login with Google; auto-creates a user profile on first login
Firebase ID token verification on every protected API request (server-side via Firebase Admin SDK)
Role-based routing β Admin users redirected to the Admin Dashboard; regular users access the standard workspace
Route guards at both the frontend (React) and backend (Spring Security) layers
π File Management
Smart Upload β files are compressed and deduplicated automatically before storage
File Name Conflict Detection β detects if a file with the same name exists, prompting a version decision
My Files β grid/list view of all uploaded files with download, share, delete, and preview actions
File Preview β in-browser preview for images (PNG, JPEG, GIF, WebP) and PDFs via a tabbed detail panel
File Download β direct download from the file details panel and search results
File Deletion β full cascade cleanup: removes the file record, all short links, all analytics events, the S3 object (if no other references exist), and Redis cache entries
ποΈ File Versioning
Upload New Version β re-upload a file under the same name to create a new version, keeping full history
Version History Panel β view all past versions with timestamps and size info
Switch Active Version β promote any historical version back to "current"; short link caches auto-invalidate
Replace Mode β mark the previous version as replaced when uploading a new one
Deduplication Across Versions β if a new version has identical content (same SHA-256), the existing S3 object is reused
ποΈ Compression & Deduplication
GZIP Compression via a pluggable CompressionStrategy pattern (extensible to other codecs)
Content-aware strategy selection β factory selects the optimal strategy based on file extension
SHA-256 Content Hashing β every file is hashed on upload; existing hash = no re-upload
Per-file compression metrics β original vs. compressed size tracked and displayed in the UI
System-wide Bandwidth Savings β aggregated deduplication and compression savings on the dashboard
π Short Link Sharing
Generate secure short links for any file with a single click
Password protection β protect a link with a password; transmitted via X-Download-Password header, never in the URL
Download limits β set a maximum number of downloads; link auto-deactivates once reached
Expiry dates β expired links show an "Expired" message to the recipient
Link status tracking β ACTIVE, EXPIRED, LIMIT_REACHED, PASSWORD_PROTECTED
Copy link β one-click clipboard copy of the short URL
Delete links β remove any short link, with cascade deletion of its analytics
Redis-cached resolution β sub-millisecond lookup; cache invalidated on version switch or deletion
π Unified Search
Search by file name β partial, case-insensitive match
Search by tag β match against auto-generated content tags
Combined results β single query checks both, merging and deduplicating results
Global search bar β navigates directly to results from the navbar
Search result actions β download, share, or delete files from the results grid
π·οΈ Auto-Tagging
Automatic tag generation on every upload and version switch
Tag-based discovery β browse files by tag from the Search page
User tag summary β all tags across your files, sorted by usage frequency
Popular tags β system-wide leaderboard in the Admin Dashboard
π Analytics & Insights
Dashboard β overview cards: total files, total downloads, total bandwidth saved
File Detail Analytics (/files/:id) β per-file breakdown: download history, short link statuses, compression stats, tags, preview
Top Downloads (/analytics) β ranked list of most-downloaded files
Bandwidth Savings (/bandwidth) β personal and system-wide compression and deduplication metrics
Device & Browser Analytics β events record device type (Desktop/Mobile/Tablet) and browser
π‘οΈ Rate Limiting & Abuse Protection
Redis-backed Sliding Window Rate Limiter β distributed-safe, accurate per-window counting
Protected endpoints:
Action
Limit
Window
File downloads (by IP)
20 requests
60 seconds
File uploads (by user)
10 requests
60 seconds
Authentication attempts (by IP)
15 requests
10 minutes
Password-protected link attempts (by IP)
5 attempts
10 minutes
HTTP 429 responses with Retry-After header on limit exceeded
Automatic lockout clearing on successful password authentication
π€ User Profile & Settings
Account Settings page (/settings) β accessible from the navbar avatar dropdown
Basic profile: Display Name, Profile Image URL
Professional details: Organization, Location, Bio, Job Profile (dropdown), Experience Level
Social links: LinkedIn, GitHub, Portfolio URL (server-side URL prefix validation)
App preferences: Language, Timezone, Default Link Expiry, Email Notifications toggle
Live navbar update β display name and avatar update instantly without a page reload
π Secure Public File Access
Short links are publicly accessible at /f/:shortCode β no login required for recipients
Graceful UI states for: password-protected, download limit reached, expired, not found
Password entry form with retry support for protected links
Auto-downloads on page load for public (non-password) links
π§βπΌ Admin Dashboard
System overview β total users, total files, total downloads, total storage used
Upload trends β daily upload count chart for the past 7 days
Top uploaders β ranked list of most active users
Popular tags β system-wide top-20 tags by usage
Recent activity log β last 10 download events (privacy-safe)
Active users β unique users active in the last 24 hours
A Firebase project with Email/Password and Google sign-in enabled
An AWS account with an S3 bucket
1. Infrastructure (Docker)
Start PostgreSQL and Redis locally:
cd infrastructure
docker-compose up -d
Service
Port
PostgreSQL
5432
Redis
6379
2. Backend Setup
Firebase Service Account (local dev)
Go to Firebase Console β Project Settings β Service Accounts
Click Generate new private key and download the JSON
Place it at backend/src/main/resources/firebase-service-account.json
Environment Variables
Create backend/.env:
# DatabaseDB_URL=jdbc:postgresql://localhost:5432/smartshareDB_USERNAME=postgresDB_PASSWORD=postgres# RedisREDIS_HOST=localhostREDIS_PORT=6379REDIS_PASSWORD=REDIS_SSL=false# AWS S3AWS_S3_BUCKET_NAME=your-bucket-nameAWS_ACCESS_KEY_ID=your-access-keyAWS_SECRET_ACCESS_KEY=your-secret-keyAWS_REGION=us-east-1# FirebaseFIREBASE_PROJECT_ID=your-firebase-project-id# Leave FIREBASE_SERVICE_ACCOUNT_JSON blank to use the local JSON file
Note: The spring-dotenv library automatically loads .env on startup β no manual export needed.
Run
cd backend
# Windows
.\mvnw.cmd spring-boot:run
# Linux / macOS
./mvnw spring-boot:run
API available at http://localhost:8080.
3. Frontend Setup
Create frontend/.env:
VITE_API_BASE_URL=http://localhost:8080/api# Firebase β from Firebase Console β Project Settings β Your AppsVITE_FIREBASE_API_KEY=your_api_keyVITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.comVITE_FIREBASE_PROJECT_ID=your_project_idVITE_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.appVITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_idVITE_FIREBASE_APP_ID=your_app_id# Comma-separated admin emailsVITE_ADMIN_EMAILS=admin@yourdomain.com
cd frontend
npm install
npm run dev
App available at http://localhost:5173.
π Production Deployment
1. Backend on Render
Connect your GitHub repo to Render β New Web Service
Root directory:backend
Runtime: Docker (uses the Dockerfile in backend/)
Health check path:/api/health
Set environment variables (see table below)
Render automatically injects PORT β no action needed.
2. Frontend on Vercel
Connect your GitHub repo to Vercel β New Project
Root directory:frontend
Framework: Vite (auto-detected)
Set environment variables (see table below)
frontend/vercel.json configures SPA routing so page refreshes and direct URL access work correctly on all React Router routes.