Skip to content

MIbnEKhalid/UnilibWebApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

263 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnilibWebApp

Node.js Version License: MIT Version

MBK Chat Platform

Handlebars

A modern web application for managing and sharing university course materials, featuring a dark theme, lab management system, and advanced book visibility controls.

Tech Stack

  • Node.js & Express.js (Backend)
  • Handlebars, HTML/CSS/JS (Frontend)
  • PostgreSQL with JSONB (Database)
  • mbkauthe (Authentication)
  • PDF-lib & Sharp (PDF/Image processing)

Key Features

  • Browse & search course materials by semester
  • Admin dashboard for content management
  • Book visibility controls with bulk actions (new in v1.4)
  • Lab management with individual downloads
  • PDF streaming with browser preview
  • Modern dark theme UI
  • User authentication & role-based access

Setup

Prerequisites

  • Node.js (v16+)
  • PostgreSQL

Quick Start

  1. Clone and install:

    git clone https://github.com/MIbnEKhalid/UnilibWebApp.git
    cd UnilibWebApp
    npm install
  2. Configure:

    • Set up .env (see env.md) — optionally add Upstash credentials (UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN) to enable caching for public pages. Use REDIS_ENABLED=false to explicitly turn off Redis caching if needed.
    • Initialize database using model.sql
  3. Run:

    npm start

    Access at http://localhost:3333

Tools

Convert Images to WebP

Convert images to WebP format:

npm run convertToWebp            # Keep originals
npm run convertToWebp --delete-old   # Delete originals

Convert PDF Pages to Images

Extract specific pages from PDF files as high-quality images:

npm run convertPageImages <pdfPath> <pageNumber> <outputFormat> [outputPath]

Arguments:

  • pdfPath - Path to the PDF file
  • pageNumber - Page number to extract (starting from 1)
  • outputFormat - Output image format: png, jpg, jpeg, webp, tiff, or avif
  • outputPath - (Optional) Custom output file path

Examples:

# Extract page 1 as PNG (auto-named output)
npm run convertPageImages tool/edc.pdf 1 png

# Extract page 2 as WebP with custom output path
npm run convertPageImages tool/edc.pdf 2 webp ./output.webp

# Extract page 5 as JPEG
npm run convertPageImages ./document.pdf 5 jpg ./page5.jpg

Features:

  • High-quality output (300 DPI equivalent)
  • Multiple format support
  • Automatic output directory creation
  • If no output path is specified, saves as <pdfName>_page<number>.<format>

Usage

Students

  • Browse materials by semester
  • Download individual labs
  • Stream PDFs in browser
  • Use search/filter features

Admins

  • Manage content via /dashboard
  • Hide/show books individually or in bulk (new in v1.4)
  • Select multiple books for batch operations (new in v1.4)
  • Handle lab content at /dashboard/Book/:bookId/Labs
  • Organize labs with page ranges
  • Perform bulk operations

What's New in v1.6.0

Book Visibility Management

  • Hide/Show Books: Control which books are visible to students
  • Bulk Actions: Select multiple books and hide/show them at once
  • Visual Indicators: Hidden books display a red "Hidden" badge
  • Smart Filtering: Public users only see visible books; admins see all books

Deploy

Deploy on Vercel using included vercel.json or any Node.js server.

Contact

For questions or contributions, please contact Muhammad Bin Khalid at mbktech.org/Support, support@mbktech.org or chmuhammadbinkhalid28@gmail.com.

Developed by Muhammad Bin Khalid at mbktech.org.

About

Website For My Uni Classmates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors