Skip to content

quintet-sdr/dps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

81 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Distributed PDF System (DPS)

A decentralized, peer-coordinated PDF sharing and storage system โ€” inspired by Napster.

Innopolis University S25 System and Network administration


๐Ÿšง Tech Stack Overview

๐Ÿ–ฅ๏ธ Frontend

Next.js React TailwindCSS shadcn/ui TypeScript react-hook-form react-query Zod PM2 pnpm

๐Ÿ› ๏ธ Backend

NestJS TypeORM PostgreSQL JWT argon2


โš™๏ธ Deployment & Monitoring

Docker Grafana Prometheus Nginx


๐Ÿงญ Overview

The Distributed PDF System (DPS) is a full-stack project designed to provide scalable, distributed storage, sharing, and retrieval of PDF documents. It consists of:

  • Backend โ€” NestJS REST API with user and file management
  • Frontend โ€” Next.js web interface for users
  • Sharding Node โ€” Java-based service for file chunking/storage (Coming Soon)
  • Reverse Proxy & Monitoring โ€” NGINX, Prometheus, and Grafana

This system was developed as part of the System & Network Administration course at Innopolis University (S25).


๐Ÿ—๏ธ System Architecture

                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚  Frontend  โ”‚  โ† Next.js Web UI
                   โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚ HTTP
                         โ–ผ
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚   NGINX    โ”‚  โ† Reverse Proxy (routes requests to Backend, Frontend, Sharding)
                   โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ–ผ               โ–ผ               โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Backend   โ”‚  โ”‚  Frontend  โ”‚  โ”‚ Sharding Nodeโ”‚  โ† Java microservices (Coming Soon)
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  File Storage
        โ”‚
        โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ Prometheus โ”‚  โ† Metrics scraping
  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Grafana   โ”‚  โ† Visualization Dashboard
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“‚ Project Structure

dps/
โ”œโ”€โ”€ backend/            # NestJS backend server
โ”œโ”€โ”€ frontend/           # Next.js frontend client
โ”œโ”€โ”€ sharding/           # Java-based sharding node (Coming Soon)
โ”œโ”€โ”€ watchproxy/         # NGINX config, Prometheus & Grafana
โ”œโ”€โ”€ .github/            # CI/CD workflows
โ”œโ”€โ”€ README.md           # โ† you're here

โš™๏ธ Backend (NestJS)

Located in: dps/backend

Features

  • User authentication via JWT & local strategies
  • File & chunk upload, update, delete
  • Node registration (for storage nodes)
  • Dockerized & container-ready

Getting Started

  1. Copy .env.example to .env and fill in your environment variables before starting.
cd backend
pnpm install

# Start in dev mode
pnpm run start:dev

# Start in prod
pnpm run start:prod

API Docs

Visit: http://45.156.22.249/docs โ€” auto-generated Swagger UI proxied via NGINX


๐ŸŒ Frontend (Next.js)

Located in: dps/frontend

Features

  • Upload and manage PDF files
  • Browse stored documents
  • Modern interface using Next.js App Router

Getting Started

  1. Copy .env.example to .env and configure environment variables.
cd frontend
pnpm install
pnpm dev

Open http://45.156.22.249 for production or http://localhost:3000 in development.


๐Ÿงฉ Sharding Node (Java)

Coming Soon...


๐Ÿ”’ Authentication

The backend implements:

  • Local Strategy (username + password)
  • JWT Token issuance
  • Guards for authenticated routes

See /auth/ folder in backend for strategy and guards.


๐Ÿงช Testing

Backend:

# Unit tests
pnpm run test

# E2E tests
pnpm run test:e2e

# Coverage
pnpm run test:cov

Frontend:

# If test setup exists:
pnpm run test

๐Ÿš€ Deployment

Backend, Sharding Node, and Proxy are containerized.

To deploy everything with Docker Compose:

# For backend
cd backend
docker-compose up --build

# For sharding
cd sharding
docker compose up

# For nginx/prometheus/grafana
cd watchproxy
docker-compose up --build

๐Ÿ“Š Monitoring


๐Ÿ”„ CI/CD

GitHub Actions:

  • .github/workflows/ci.yml: Build & test
  • .github/workflows/cd.yml: Deployment pipeline

๐Ÿ“œ License

  • Backend/Frontend: MIT License โ€” see LICENSE
  • Sharding node: BSD โ€” see LICENSE-BSD

๐Ÿ“ฎ Maintainers

Developed at Innopolis University as part of the S25 System & Network Administration course.


Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •