๐ SaraFiles
SaraFiles is a stripped-down personal storage service, inspired by Google Drive.
It allows users to securely authenticate, create folders, upload files, and share content.
The project is built with a React frontend and a Node.js + Express + Prisma backend.
๐ข Live Demo: https://link.sarawebs.com/top-files
๐ Tech Stack
- Frontend: React (Vite/CRA), TailwindCSS
- Backend: Node.js, Express
- Database: PostgreSQL (via Prisma ORM)
- Authentication: Passport.js (session-based)
- File Uploads: Multer (filesystem for local dev, optional cloud storage for production)
- Storage Options: Cloudinary Storage (recommended for production)
โจ Features
- ๐ Session-based authentication using Passport.js (persisted in DB via Prisma session store)
- ๐ Folder management (CRUD for folders)
- ๐ค File uploads with Multer
- ๐ File details view (name, size, upload time)
- โฌ๏ธ Download files directly from the app
- โ๏ธ Cloud storage support (store URLs in DB, e.g. Cloudinary or Supabase)
- ๐ Share folders with public links that expire after a set duration (extra credit)
๐ Project Structure
SaraFiles/
โ
โโโ client/ # React frontend
โ โโโ src/
โ โโโ package.json
โ
โโโ server/ # Express + Prisma backend
โ โโโ src/
โ โ โโโ routes/ # Express routes
โ โ โโโ middleware/ # Multer, auth, etc.
โ โ โโโ prisma/ # Prisma schema
โ โ โโโ app.js
โ โโโ package.json
โ
โโโ README.md
โ๏ธ Setup & Installation
1. Clone repo
git clone https://github.com/mdahamshi/top-file-upload.git
cd top-file-upload2. Backend (server)
cd server
cp .env.example .env
npm install
npx prisma migrate dev
npm run dev3. Frontend (client)
cd client
npm install
npm run dev๐ Environment Variables
Backend .env file:
DATABASE_URL="postgresql://user:password@localhost:5432/sarafiles"
SESSION_SECRET="supersecretkey"
CLOUDINARY_URL="your_cloudinary_url" # or Supabase storage keys
๐ก API Endpoints
POST /auth/loginโ Login userPOST /auth/registerโ Register userPOST /files/uploadโ Upload file (requires auth)GET /files/:idโ Get file detailsGET /files/:id/downloadโ Download filePOST /foldersโ Create folderGET /folders/:idโ View folder contentsPOST /shareโ Generate shareable link
๐ ๏ธ Development Notes
- Local dev saves files to filesystem using Multer.
- Production deployment should use cloud storage (Cloudinary / Supabase).
- Prisma migrations handle schema changes.
๐ง Roadmap
- Authentication
- File upload (local)
- Folder CRUD
- File metadata & download
- Cloud storage integration
- Public folder sharing with expiring links
- UI polish (React)
๐ธ Screenshots
๐ License
MIT License ยฉ 2025 Mohammad Dahamsheh
On this page
Languages
JavaScript91.5%Shell4.0%CSS2.1%HTML1.6%TypeScript0.4%Dockerfile0.4%
Contributors
Created August 16, 2025
Updated August 29, 2025

