# WinCloud **Repository Path**: wuaxcn/win-cloud ## Basic Information - **Project Name**: WinCloud - **Description**: 一键将 Windows 电脑变成局域网 NAS 文件服务器。安装运行后,手机、平板、其他电脑只需在浏览器输入 IP 地址即可访问和管理文件,无需安装任何客户端。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-08 - **Last Updated**: 2026-07-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # One-Click NAS (WindowsNas) Turn any Windows PC into a LAN file server with one click. After installation, access and manage files from your phone, tablet, or other computers through a browser — no client app required. ## Features - **File Management** — Browse, upload, download, create/delete folders, rename, and search files - **Online Preview** — View images, videos (with seek support), audio, text/code, and PDFs directly in the browser - **Mobile Access** — Open the IP address in your phone browser on the same network, no app needed - **Multiple Storage Paths** — Add multiple folders as NAS storage directories - **Drag & Drop Upload** — Drag files directly into the window to upload - **Service Control** — Built-in start/stop/restart controls for the Node service with real-time status - **Runtime Logs** — Full request logging and error tracking, viewable in the settings page - **Custom Port** — Change the service port (takes effect after restart) - **Desktop App** — Built with Electron, frameless window with custom titlebar ## Tech Stack | Layer | Technology | |-------|-----------| | Desktop Shell | Electron 30 | | Frontend | Vue 3 + Vite 5 | | UI Library | Arco Design Vue | | State Management | Pinia | | Router | Vue Router 4 | | Backend API | Express 4 + Multer | | Packaging | electron-builder | ## Project Structure ``` WindowsNas/ ├── electron/ # Electron main process │ ├── main.js # Entry (window, service, IPC management) │ └── preload.mjs # Preload script (secure API exposure) ├── server/ # Express backend API │ ├── index.js # API service (file ops, system info, logging) │ └── data/ # Runtime data (config, logs) ├── src/ # Vue frontend │ ├── components/ # Components (FilePreview overlay) │ ├── views/ # Pages (FileBrowser, Settings) │ ├── router/ # Route configuration │ ├── Tools/ # API client, utility functions │ └── App.vue # Main layout ├── public/ # Static assets (icons) ├── vite.config.ts # Vite configuration ├── electron-builder.json5 # Build configuration └── package.json ``` ## Getting Started ### Prerequisites - Node.js >= 18 - npm >= 9 ### Install Dependencies ```bash npm install ``` ### Development Mode ```bash npm run dev ``` The Vite dev server runs at `http://localhost:5173` and the Express API at `http://localhost:3006`. Vite automatically proxies `/api` requests to Express. ### Build Frontend Only (Web) ```bash npm run build:web ``` Output goes to the `dist/` directory. The Express server automatically serves this as static files, allowing mobile access at `http://:3006`. ### Run Backend Standalone ```bash npm run server ``` Runs the Express server without Electron. Useful for deploying to a server or NAS device. ### Package Desktop App ```bash npm run build ``` Installer output goes to the `release/` directory. ## Usage ### Desktop 1. Launch the app — Express service starts automatically 2. Go to **Settings** and add storage paths (e.g. `D:\Movies`, `E:\Documents`) 3. Switch to **File Management** to browse and manage files ### Mobile 1. Make sure your phone and PC are on the same network 2. Check the **Web Access URL** in the desktop app's Settings page 3. Open the URL in your phone browser (e.g. `http://192.168.1.100:3006`) 4. Browse, upload, and download files ## API Endpoints | Method | Path | Description | |--------|------|-------------| | GET | `/api/system/info` | System info (IPs, port, web URLs) | | GET | `/api/system/settings` | Get configuration | | POST | `/api/system/settings` | Save configuration | | GET | `/api/system/logs` | View runtime logs | | GET | `/api/paths` | List storage paths | | POST | `/api/paths` | Add storage path | | DELETE | `/api/paths` | Remove storage path | | GET | `/api/files` | List files (supports search) | | GET | `/api/files/info` | File details | | GET | `/api/files/preview` | File preview (supports Range requests) | | GET | `/api/files/download` | File download | | POST | `/api/files/upload` | File upload (Multer) | | POST | `/api/files/mkdir` | Create folder | | POST | `/api/files/rename` | Rename file/folder | | DELETE | `/api/files` | Delete file/folder | ## Data Storage | Environment | Path | |-------------|------| | Development | `server/data/` | | Packaged | `%APPDATA%/一键Nas/server-data/` | Contains `settings.json` (user configuration) and `logs/server.log` (runtime logs). ## FAQ **Q: Can't access from my phone?** Ensure your phone and PC are on the same Wi-Fi network. Check that Windows Firewall allows the service port (default 3006). **Q: ENOENT error after packaging?** After packaging, the data directory is at `%APPDATA%/一键Nas/server-data/`, not inside the installation directory. Check the runtime logs in the Settings page for details. **Q: Port still in use after closing the app?** Electron normally cleans up the Express process on exit. If a process persists, end it manually via Task Manager. **Q: Video won't play?** Browsers only support certain codecs (H.264/AAC). Formats like MKV or RMVB may need transcoding for browser playback. ## License [MIT License](./LICENSE)