Skip to content
/ SKU Public

SKU short for Simple Keybased Upload, users needs a key to upload files to the server. Keys are generated by admins and can be validated or deleted by them. Users are only allowed to upload files if they have a valid key.

License

Notifications You must be signed in to change notification settings

v3lip/SKU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SKU (Simple Keybased Upload)

A secure file upload system that uses key-based authentication for file uploads. Users need a valid key to upload files, and administrators can manage these keys through a user-friendly interface.

Features

  • 🔐 Key-based authentication for file uploads
  • 📤 Drag-and-drop file upload interface
  • 👥 Admin panel for key management
  • 🔑 Key generation, validation, and deletion
  • 📱 Responsive design
  • 🔒 Secure file handling
  • 🌐 Environment-based configuration
  • 🔄 Automatic development/production mode switching

Tech Stack

Frontend

  • React.js
  • React Router DOM
  • Modern UI components
  • Drag-and-drop functionality

Backend

  • Node.js
  • Express.js
  • LowDB for data persistence
  • Multer for file handling
  • JWT for authentication
  • bcrypt for security

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn package manager

Installation

  1. Clone the repository:
git clone https://github.com/v3lip/sku.git
cd sku
  1. Install frontend dependencies:
cd client
npm install
  1. Install backend dependencies:
cd ../server
npm install

Configuration

Client Configuration

The client configuration is in client/src/config.js:

const config = {
  // Server connection
  API_URL: process.env.NODE_ENV === 'development' 
    ? 'http://localhost:5000'  // Development server
    : 'http://your-server-ip:5000',  // Production server
  
  // Upload settings
  CHUNK_SIZE: 1 * 1024 * 1024,  // 1MB chunks for file uploads
  
  // UI settings
  MAX_FILE_NAME_LENGTH: 50,     // Maximum length for displayed file names
  UPLOAD_TIMEOUT: 30000,        // Upload timeout in milliseconds (30 seconds)
  
  // Preview settings
  PREVIEWABLE_TYPES: [
    'image/',
    'video/',
    'application/pdf'
  ]
};

Server Configuration

  1. Copy the example environment file:
cd server
cp .env.example .env
  1. Edit the .env file with your settings:
PORT=5000
HOST=0.0.0.0
JWT_SECRET=your_secure_secret_here
  1. For production, make sure to:
    • Set a strong JWT_SECRET
    • Configure CORS_ORIGINS in server/config.js with your client URLs
    • Change the default admin password after first login

Quick Deployment

  1. Clone and install:
git clone https://github.com/v3lip/SKU.git
cd SKU
  1. Configure the client:
cd client
# Edit src/config.js with your server's IP and port
npm install
  1. Configure the server:
cd ../server
cp .env.example .env
# Edit .env with your settings
npm install
  1. Start the services:
# Terminal 1 - Server
cd server
node index.js

# Terminal 2 - Client
cd client
npm start

The application will be available at:

Project Structure

sku/
├── client/                 # Frontend React application
│   ├── public/            # Static files
│   └── src/              # React source code
│       ├── config.js     # Client configuration
│       └── pages/        # React components
├── server/                # Backend Node.js application
│   ├── uploads/          # Permanent file storage
│   ├── tmpUploads/       # Temporary file storage
│   ├── config.js         # Server configuration
│   └── index.js          # Main server file
└── README.md

Security Features

  • Key-based authentication system
  • Secure file upload handling
  • Temporary file storage for processing
  • Admin-only key management
  • JWT-based authentication for admin panel
  • Environment-based configuration
  • CORS protection
  • Configurable file size limits
  • Automatic key expiration

Images

image image image

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the ISC License - see the LICENSE file for details.

Author

  • v3lip

Acknowledgments

  • Thanks to all contributors who have helped shape this project
  • Special thanks to the open-source community for the amazing tools and libraries

About

SKU short for Simple Keybased Upload, users needs a key to upload files to the server. Keys are generated by admins and can be validated or deleted by them. Users are only allowed to upload files if they have a valid key.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published