A modern, full-stack file sharing platform built for fast and simple file uploads.
Upload files, store them securely, manage them from your dashboard, and share them instantly with unique links.
- π€ File Uploads β Upload files directly to cloud storage.
- βοΈ Cloudinary Storage β Store uploaded files securely using Cloudinary.
- π Shareable Links β Generate a unique link for every uploaded file.
- π₯ File Downloads β Download shared files through secure generated URLs.
- π Authentication β Google authentication with protected user-specific resources.
- π File Dashboard β View, search, sort, and manage uploaded files.
- ποΈ Trash Management β Move files to trash and restore them when needed.
- β Permanent Deletion β Permanently remove files from Cloudinary and MongoDB.
- π± Responsive UI β Clean interface designed for desktop and mobile screens.
- β‘ Fast Frontend β Built with React, Vite, TypeScript, and Tailwind CSS.
- π Server-Side Secrets β Sensitive Cloudinary credentials and operations remain on the backend.
- React
- TypeScript
- Vite
- Tailwind CSS
- shadcn/ui
- React Router
- Axios
- Lucide React
- Sonner
- Node.js
- Express
- TypeScript
- MongoDB
- Mongoose
- Cloudinary
- JWT
- Zod
- Nanoid
βββββββββββββββββββββββββββ
β React Client β
β Vite + TypeScript β
ββββββββββββββ¬βββββββββββββ
β
β REST API
βΌ
βββββββββββββββββββββββββββ
β Express Backend β
β TypeScript β
βββββββββ¬ββββββββββ¬ββββββββ
β β
βΌ βΌ
ββββββββββββ ββββββββββββββ
β MongoDB β β Cloudinary β
β Metadata β β Files β
ββββββββββββ ββββββββββββββ
The frontend handles the user interface and file-management experience, while the backend manages authentication, authorization, file metadata, Cloudinary signatures, and protected file operations.
The project is organized as a client-server monorepo:
packet-picnic/
β
βββ client/
β βββ public/
β βββ src/
β β βββ api/
β β βββ components/
β β βββ hooks/
β β βββ layout/
β β βββ lib/
β β βββ pages/
β β βββ context/
β β βββ types/
β β βββ utils/
β β βββ App.tsx
β β βββ main.tsx
β β
β βββ package.json
β βββ vite.config.ts
β
βββ server/
β βββ src/
β β βββ config/
β β βββ controllers/
β β βββ middlewares/
β β βββ models/
β β βββ routes/
β β βββ schemas/
β β βββ utils/
β β βββ app.ts
β β βββ server.ts
β β
β βββ package.json
β βββ tsconfig.json
β
βββ README.md
The structure above highlights the main application directories rather than listing every individual component and utility file.
git clone https://github.com/abmdevx/packet-picnic.git
cd packet-picnicInstall dependencies for both the frontend and backend:
cd client
npm install
cd ../server
npm installCreate a .env file inside both client and server.
VITE_API_URL=http://localhost:8000/api/v1
VITE_CLOUDINARY_CLOUD_NAME=your_cloud_name
VITE_CLOUDINARY_API_KEY=your_api_keyPORT=8000
CLIENT_URL=http://localhost:5173
MONGODB_URI=your_mongodb_connection_string
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
JWT_SECRET=your_jwt_secretImportant: Never expose
CLOUDINARY_API_SECRET,JWT_SECRET, or other server-side secrets in the frontend.
cd server
npm run devThe API will run at:
http://localhost:8000
Open another terminal:
cd client
npm run devThe frontend will be available at:
http://localhost:5173
User
β
βΌ
Select File
β
βΌ
React Client
β
β Request upload signature
βΌ
Express Backend
β
β Generate signed request
βΌ
Cloudinary
β
β Store file
βΌ
React Client
β
β Send uploaded file metadata
βΌ
Express Backend
β
β Save metadata
βΌ
MongoDB
β
βΌ
Unique Share Link
Each uploaded file receives a unique identifier generated with nanoid.
Example:
http://localhost:5173/files/abc123xyz
Packet Picnic uses a soft-delete approach for normal deletion.
Active File
β
β Delete
βΌ
Trash
β
βββββββββββββββββ
β β
β Restore β Permanent Delete
βΌ βΌ
Active File Cloudinary
β
βΌ
MongoDB
When a file is moved to trash:
- The file remains in Cloudinary.
- Its MongoDB record remains.
isTrashedis set totrue.- The file is hidden from the main dashboard.
When a file is restored:
isTrashedis set back tofalse.- The file becomes visible again in the dashboard.
When permanently deleted:
- The Cloudinary asset is deleted.
- The MongoDB metadata is deleted.
- The operation cannot be undone.
Packet Picnic protects user-specific resources through authentication and authorization.
Security measures include:
- Google authentication.
- JWT-based authentication.
- Protected dashboard APIs.
- Authenticated file ownership.
- Server-side Cloudinary signatures.
- Server-side Cloudinary deletion.
- Server-side Cloudinary API secret.
- Zod request validation.
- Unique file identifiers using
nanoid. - User ownership checks before modifying or permanently deleting files.
The backend verifies that a file belongs to the authenticated user before allowing protected file-management operations.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/auth/google |
Authenticate with Google |
GET |
/api/v1/auth/me |
Get the authenticated user |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/files/upload/signature |
Generate Cloudinary upload signature |
POST |
/api/v1/files |
Save uploaded file metadata |
GET |
/api/v1/files/:uniqueId |
Get shared file information |
GET |
/api/v1/files/:uniqueId/download |
Generate download URL |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/files/get-all-files |
Get authenticated user's active files |
GET |
/api/v1/files/get-trash-files |
Get authenticated user's trash files |
PATCH |
/api/v1/files/update-trash-status |
Move files to trash or restore them |
DELETE |
/api/v1/files/permanent |
Permanently delete files |
Protected endpoints require authentication.
Packet Picnic provides a clean and minimal interface focused on quick file management and sharing.
- π Landing page
- π Authentication
- π Dashboard
- π My Files
- π Shared File Page
- ποΈ Trash
- π€ Upload Dialog
- π± Responsive navigation
The dashboard supports:
- List view
- Grid view
- File search
- File sorting
- File upload
- File download
- Share-link copying
- Trash management
- File restoration
- Permanent deletion
Packet Picnic uses Cloudinary for file storage.
The upload process uses a server-generated signature so that the Cloudinary API secret never needs to be exposed to the frontend.
Cloudinary stores the uploaded asset while MongoDB stores the associated metadata, including:
originalName
storedName
mimeType
size
storageUrl
cloudinaryPublicId
cloudinaryResourceType
uniqueId
downloadCount
owner
isTrashed
trashedAt
Each uploaded file is associated with metadata stored in MongoDB.
This allows Packet Picnic to provide:
- File ownership
- File search
- File sorting
- Download statistics
- Trash management
- File restoration
- Permanent deletion
- Unique sharing links
In Development
Packet Picnic is an actively developed full-stack project built for learning, experimentation, and portfolio development.
Current functionality includes:
- Authentication
- File uploads
- Cloudinary storage
- File sharing
- File downloads
- Dashboard
- Search and sorting
- List and grid views
- Trash management
- File restoration
- Permanent deletion
- Responsive UI
This project is currently developed for educational and portfolio purposes.
