ZCloud is a self-hosted cloud storage web application that allows users to upload, organize, and download files through a web interface. It was built as a full-stack project to explore backend infrastructure, containerization, and deployment workflows while providing a simple alternative to commercial cloud storage services.
- User authentication (signup and login)
- Upload and download files
- Folder creation and organization
- Web interface for browsing stored files
- Self-hosted deployment
- Dockerized backend
- CI/CD style auto-deployment using bash scripts
- Reverse proxy using Nginx
Frontend
- React (Vite)
- JavaScript
- TailwindCSS
- zustand
Backend
- Node.js
- Express
Database
- PostgreSQL
Infrastructure
- Docker
- Docker Compose
- Nginx
- Bash scripts for CI/CD
- GitHub repository with deploy keys
ZCloud is structured as a typical full-stack application.
Client (React)
|
v
Nginx
|
v
Express Backend (Docker)
|
v
PostgreSQL
Frontend
- React application compiled into static files
- Served through Nginx
Backend
- Express REST API
- Handles authentication, file uploads, and metadata
Database
-
PostgreSQL stores:
- users
- file metadata
- folder structure
- file contents
Server
- Nginx serves the frontend
- API requests are proxied to the backend container
The project is designed to run on a single Linux server.
Deployment flow:
- Server checks the Git repository for updates
- If changes are detected:
- Backend Docker image is rebuilt
- Containers are restarted using Docker Compose
- Frontend is rebuilt and served via Nginx
This creates a simple self-hosted CI/CD pipeline.
Environment variables are stored on the server and not committed to the repository.
Example backend environment file:
PORT=5000
DATABASE_URL=postgres://user:password@localhost:5432/zcloud
JWT_SECRET=your_secret
Frontend environment variables are injected during the build process.
Clone the repository:
git clone https://github.com/yourusername/zcloud.git
cd zcloud
Install dependencies:
npm install
Run backend:
npm start
Run frontend:
npm run dev
Build backend image:
docker build -t zcloud-backend .
Run container:
docker run -p 5000:5000 zcloud-backend
Using Docker Compose:
docker compose up --build
This project is for educational and personal use.