A full-stack application for uploading, storing, and managing files using React, Node.js, and PostgreSQL.
- File upload with drag-and-drop support
- File listing with metadata (name, size, type, upload date)
- File download functionality
- Modern UI with Tailwind CSS
- Real-time notifications
- PostgreSQL for data persistence
- Node.js >= 14
- PostgreSQL database server
- Bun package manager
- Create a PostgreSQL database:
CREATE DATABASE file_upload_db;- Update backend/.env with your database credentials if needed:
PGUSER=postgres
PGHOST=localhost
PGPASSWORD=your_password
PGDATABASE=file_upload_db
PGPORT=5432
PORT=5000- Install dependencies:
cd backend
bun install- Start the server:
bun run devThe server will start on http://localhost:5000
- Install dependencies:
cd frontend
bun install- Start the development server:
bun run devThe frontend will be available at http://localhost:5173
- Visit http://localhost:5173 in your browser
- Use the upload form to select and upload files
- View the list of uploaded files below
- Download files by clicking the download button
- Node.js with Express
- PostgreSQL for database
- Multer for file upload handling
- RESTful API endpoints
- React with Vite
- Tailwind CSS for styling
- React Icons for icons
- React Hot Toast for notifications
POST /api/upload- Upload a fileGET /api/files- Get list of all filesGET /api/files/:id/download- Download a specific file
.
├── backend/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ └── uploads/
└── frontend/
├── src/
│ ├── components/
│ └── assets/
└── public/