This project is a web application that allows users to upload and delete media files (images and videos). It leverages Cloudinary for media storage and processing, providing features like file transformations and optimizations.
- Clone the repository:
git clone https://github.com/SlavyanDesu/TempStorage.git
- Navigate to the project directory:
cd TempStorage
- Install the depedencies:
npm install
- Set up environment variables:
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"
SESSION_SECRET="put-any-secret-code-you-like"
PORT=3000
DATABASE_URL="postgresql://your-neondb:[email protected]/dbname?sslmode=require"
- Build application:
npm run build
To start the application, run:
npm start
Visit http://localhost:3000 in your browser to access the application.
- File upload and management
- Image and video transformations
- Cookie-based validation for image deletion, ensuring that only the owner of an uploaded image can delete it
- Responsive design for mobile and desktop
- Node.js
- Express.js
- Cloudinary
- Prisma
- Neon
- TypeScript
- EJS
- HTML/CSS/JavaScript
- POST
/upload
- Request Body: Form data containing the file to upload.
- Response: URL of the uploaded file.
- DELETE
/delete/:publicId
- Parameters:
publicId
of the file to delete. - Response: Success message.
- GET
/files
- Response: Renders a page displaying uploaded files, including thumbnails and download links.
This project is licensed under the MIT License. See the LICENSE file for details.