KD NAS Project is a comprehensive Network Attached Storage (NAS) solution designed to turn your machine (Mac or Windows) into a powerful home server. It integrates multiple services into a unified dashboard for easy management of photos, files, documents, and system health.
This flowchart illustrates how the components of the NAS interact:
graph TD
User[User] -->|Access via Browser| Dashboard["Dashboard (Frontend)"]
User -->|Access Photos| Immich["Immich (Photos)"]
User -->|Access Files| FileBrowser["File Browser"]
User -->|Manage Docs| Paperless[Paperless-ngx]
User -->|Manage Containers| Portainer[Portainer]
subgraph "Frontend Interface (Port 5178)"
Dashboard
end
subgraph "Backend Services"
Dashboard -->|Fetch Stats API| Backend["Node.js Backend (Port 3001)"]
Backend -->|Get System Info| System["System Resources (CPU/RAM)"]
Backend -->|Get Storage Info| Storage["Disk Usage (/Volumes/KD)"]
Backend -->|Manage Links| SmartLinks["Smart Links (JSON DB)"]
end
subgraph "Docker Containers"
Immich -->|Store Data| Postgres["Postgres DB"]
Immich -->|Cache| Redis[Redis]
Paperless -->|Store Data| Redis
FileBrowser -->|Read/Write| FileSys["File System"]
end
subgraph "Remote Access"
Cloudflare[Cloudflared] -->|Tunnel| Backend
Cloudflare -->|Tunnel| Immich
Cloudflare -->|Tunnel| Paperless
end
- Centralized Dashboard: View real-time system stats (CPU, RAM, Network), storage usage, and quick links to all services.
- Smart Links: Build-in URL shortener and sharing system to create temporary public links.
- Immich: Self-hosted photo and video management (Google Photos alternative).
- File Browser: Web-based file manager to access your files from anywhere.
- Paperless-ngx: Document management system to go paperless.
- Portainer: UI for managing Docker containers.
- Cross-Platform: Runs on both macOS and Windows.
- Docker Desktop: Must be installed and running. Download Here
- Node.js: Required for the backend and dashboard. Download Here
- Open Terminal in the project directory.
- Run the Install Script:
This will install dependencies and set up the environment.
chmod +x INSTALL_MAC.sh ./INSTALL_MAC.sh
- Start the NAS:
chmod +x start_nas.sh ./start_nas.sh
- Open Command Prompt or PowerShell in the project directory.
- Run the Install Script:
Double-click
INSTALL_WINDOWS.bator run:INSTALL_WINDOWS.bat
- Start the NAS:
Double-click
start_nas.bat.
| File/Folder | Description |
|---|---|
backend/ |
Contains the Node.js server code (server.js) that powers the API for system stats and file operations. |
frontend/ |
Contains the React/Vite dashboard source code. |
docker-compose.yml |
Defines all Docker services (Immich, Redis, Filebrowser, etc.). |
start_nas.sh |
(Mac) Main startup script. Launches Docker, Backend, and Frontend. |
start_nas.bat |
(Windows) Main startup script. Launches Docker, Backend, and Frontend. |
INSTALL_MAC.sh |
(Mac) Installs node_modules for both backend and frontend. |
INSTALL_WINDOWS.bat |
(Windows) Installs node_modules for both backend and frontend. |
cloudflared |
Binary for establishing a secure tunnel to the internet (remote access). |
.env |
Configuration file for environment variables (DB passwords, paths, etc.). |
- The Dashboard (Frontend) running on
port 5178makes HTTP requests to the Backend onport 3001. - Endpoints:
/api/stats: Fetches CPU, Memory, and Network usage./api/storage: Fetches disk usage stats for the specific volume./api/links/*: Manages the Smart Link system.
- Immich: Connects to the
database(Postgres) andrediscontainers defined indocker-compose.yml. - Paperless: Uses
gotenbergandtikafor processing documents andredisfor message brokering. - Data Persistence: All services mount local directories (e.g.,
./filebrowser_data,./local_immich_data) to ensure data is saved even if containers are restarted.
- The
cloudflaredservice creates a secure tunnel between your local ports (e.g., 3001, 2283) and a public domain. - This allows you to access your NAS from anywhere without port forwarding.
Follow these steps to upload this project to your repository:
-
Initialize Git (if not already done):
git init
-
Add Remote Origin:
git remote add origin https://github.com/dkoustubh/KD-NAS-Project.git
-
Add Files:
git add . -
Commit Changes:
git commit -m "Initial commit: Complete NAS Project with Dashboard and Services" -
Push to GitHub:
git branch -M main git push -u origin main