Rework client UI state: move and update showLogin/showApp in public/app.js to explicitly set display styles when toggling screens and ensure user info and file load on app show. Remove the theme toggle from public/index.html and simplify CSS by collapsing color variable definitions (dark-theme-focused) in public/style.css. Add a VS Code workspace file. Remove the old uploads/Think app (Dockerfile, package.json, server.js and associated lockfile).
Simple File Server
A lightweight, self-hosted file server built with Node.js, Express, and Vanilla JS. Designed for easy deployment via Docker with a focus on a clean, modern user interface.
🚀 Features
Core Functionality
- File Management: Upload (Drag & Drop), Download, Delete files.
- Folder Management: Create, Delete, Move (Drag & Drop), and Navigate folders.
- Bulk Actions: Select multiple files and download them as a single ZIP archive.
- Previews:
- Media: View images and videos directly in the browser.
- Archives: Preview ZIP file contents without downloading.
UI / UX
- Modern Interface: Clean design with a responsive layout.
- Views: Toggle between Grid View (great for media) and List View (great for details).
- Dark Mode: Automatically respects system preferences, with a manual toggle.
- Breadcrumbs: Easy navigation through deep directory structures.
- Search/Sort: (Planned/In-progress)
Security & Backend
- Authentication: Simple session-based login system (Default:
admin/admin). - Database Integration: Connects to MariaDB for persistent user management and action logging.
- Dockerized: specific
Dockerfileanddocker-compose.ymlincluded for instant deployment.
🛠️ Tech Stack
- Frontend: HTML5, CSS3 (Variables, Flexbox/Grid), Vanilla JavaScript.
- Backend: Node.js, Express.
- Database: MariaDB.
- Containerization: Docker, Docker Compose.
📦 Deployment
Method 1: Docker Compose (Recommended)
-
Clone the repository:
git clone <your-gitea-repo-url> cd simple-file-server -
Configure Environment: Create a
.envfile (or use default fallback) with your database credentials.PORT=3000 SESSION_SECRET=your_secret_key DB_HOST=maria.casademm.de DB_USER=your_db_user DB_PASSWORD=your_db_password DB_NAME=fileserver -
Run with Docker Compose:
docker-compose up --build -dThe server will be available at
http://localhost:8080.
Method 2: Manual (Node.js)
-
Install Dependencies:
npm install -
Start the Server:
npm startThe server will run on
http://localhost:3000.
📁 Project Structure
public/: Frontend assets (HTML, CSS, JS).routes/: Express API routes (auth.js,files.js).db/: Database connection and queries.uploads/: Default directory for stored files (mounted volume in Docker).
🔐 Default Credentials
- Username:
admin - Password:
admin
Note: It is highly recommended to change these in the database or update the auth logic for production use.
Description