Skip to content

Bhargi777/pocket-nas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›°οΈ Pocket NAS

A futuristic, minimal NAS dashboard for managing files on a tablet-based FTP server.

Built with React, TypeScript, and Express β€” deployed on Vercel (frontend) and Railway (backend).


✨ Features

  • πŸ“ Browse files β€” Navigate directories with animated breadcrumbs
  • ⬆️ Upload files β€” Drag-and-drop with multi-file queue
  • ⬇️ Download files β€” One-click downloads
  • πŸ—‘οΈ Delete files β€” Confirmation modal with safety checks
  • πŸ“‚ Create folders β€” Organize your NAS storage
  • πŸ”„ Real-time refresh β€” Instant directory updates
  • 🎨 Futuristic UI β€” Glassmorphism, neon accents, smooth animations

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     HTTPS      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      FTP       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 β”‚  ◄──────────►  β”‚                 β”‚  ◄──────────►  β”‚                 β”‚
β”‚   Frontend      β”‚                β”‚   Backend       β”‚                β”‚   Tablet NAS    β”‚
β”‚   (Vercel)      β”‚                β”‚   (Railway)     β”‚                β”‚   (FTP Server)  β”‚
β”‚                 β”‚                β”‚                 β”‚                β”‚                 β”‚
β”‚   React + Vite  β”‚                β”‚   Express +     β”‚                β”‚   Android/iOS   β”‚
β”‚   TailwindCSS   β”‚                β”‚   basic-ftp     β”‚                β”‚   FTP App       β”‚
β”‚   Framer Motion β”‚                β”‚                 β”‚                β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‚ Project Structure

pocket-nas/
β”œβ”€β”€ frontend/                # React + TypeScript UI
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/             # API client (axios)
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Breadcrumbs.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Toolbar.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ UploadZone.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FileGrid.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FileCard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateFolderModal.tsx
β”‚   β”‚   β”‚   └── DeleteConfirmModal.tsx
β”‚   β”‚   β”œβ”€β”€ utils/           # Helper functions
β”‚   β”‚   β”œβ”€β”€ App.tsx          # Main application
β”‚   β”‚   └── index.css        # Design system
β”‚   β”œβ”€β”€ vercel.json          # Vercel deployment config
β”‚   └── vite.config.ts       # Vite + Tailwind config
β”‚
β”œβ”€β”€ backend/                 # Node.js API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/          # Express route handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ files.ts     # File operations
β”‚   β”‚   β”‚   └── folders.ts   # Folder operations
β”‚   β”‚   β”œβ”€β”€ services/        # Business logic
β”‚   β”‚   β”‚   └── ftp.service.ts  # FTP client wrapper
β”‚   β”‚   └── index.ts         # Server entry point
β”‚   β”œβ”€β”€ Dockerfile           # Docker deployment
β”‚   └── .env.example         # Environment template
β”‚
β”œβ”€β”€ shared/                  # Shared TypeScript types
β”‚   └── types.ts
β”‚
β”œβ”€β”€ docs/                    # Documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md
β”‚   └── DEPLOYMENT.md
β”‚
β”œβ”€β”€ scripts/                 # Dev utilities
β”‚   β”œβ”€β”€ setup.sh
β”‚   └── dev.sh
β”‚
└── .github/workflows/       # CI pipeline
    └── ci.yml

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • npm 10+
  • An FTP server running on your tablet (e.g., Solid Explorer, FTP Server app)

1. Clone & Setup

git clone https://github.com/Bhargi777/pocket-nas.git
cd pocket-nas
chmod +x scripts/setup.sh
./scripts/setup.sh

2. Configure Environment

Edit backend/.env with your FTP server details:

FTP_HOST=192.168.1.100    # Your tablet's IP address
FTP_USER=admin             # FTP username
FTP_PASSWORD=password      # FTP password
FTP_PORT=21                # FTP port (usually 21)
PORT=4000                  # Backend server port
FRONTEND_URL=http://localhost:5173

3. Start Development

# Option A: Both servers at once
./scripts/dev.sh

# Option B: Start separately
cd backend && npm run dev    # Terminal 1
cd frontend && npm run dev   # Terminal 2

4. Open Dashboard

Visit http://localhost:5173


πŸ”Œ API Reference

Method Endpoint Description
GET /health Server health check
GET /api/files?path=/ List files in directory
POST /api/upload Upload file (multipart form)
GET /api/download/:name?path=/ Download a file
DELETE /api/files/:name?path=/ Delete a file
POST /api/folder Create a new folder
DELETE /api/folder/:name?path=/ Delete a folder

🌐 Deployment

Frontend β†’ Vercel

  1. Import this repo on vercel.com
  2. Set root directory to frontend
  3. Add env variable: VITE_API_URL = your backend URL
  4. Deploy

Backend β†’ Railway

  1. Import this repo on railway.app
  2. Set root directory to backend
  3. Add env variables: FTP_HOST, FTP_USER, FTP_PASSWORD, FRONTEND_URL
  4. Deploy

See docs/DEPLOYMENT.md for detailed instructions.


πŸ”’ Security Notes

  • Never commit .env files β€” they contain FTP credentials
  • CORS is configured to allow only the specified frontend origin
  • File size limit is set to 500 MB per upload
  • FTP connections are created per-request and closed immediately after
  • Use FTPS (FTP over TLS) in production when possible

πŸ›  Tech Stack

Layer Technology Purpose
Frontend React 18 UI framework
Frontend TypeScript 5 Type safety
Frontend Vite 7 Build tool
Frontend Tailwind CSS v4 Styling
Frontend Framer Motion Animations
Frontend Axios HTTP client
Backend Node.js Runtime
Backend Express HTTP server
Backend basic-ftp FTP client
Backend Multer File uploads
Infra Vercel Frontend hosting
Infra Railway Backend hosting
Infra Docker Containerization
CI/CD GitHub Actions Automated builds

πŸ“„ License

MIT License β€” see LICENSE for details.


Built with β˜• by Bhargi777

About

A modern NAS dashboard built with React and TypeScript for managing files on a tablet-based FTP NAS server. Includes upload, download, browsing, and folder management through a clean web interface.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors