A modern web application for managing and sharing university course materials, featuring a dark theme, lab management system, and advanced book visibility controls.
- Node.js & Express.js (Backend)
- Handlebars, HTML/CSS/JS (Frontend)
- PostgreSQL with JSONB (Database)
- mbkauthe (Authentication)
- PDF-lib & Sharp (PDF/Image processing)
- 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
- Node.js (v16+)
- PostgreSQL
-
Clone and install:
git clone https://github.com/MIbnEKhalid/UnilibWebApp.git cd UnilibWebApp npm install -
Configure:
- Set up
.env(seeenv.md) — optionally add Upstash credentials (UPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKEN) to enable caching for public pages. UseREDIS_ENABLED=falseto explicitly turn off Redis caching if needed. - Initialize database using
model.sql
- Set up
-
Run:
npm start
Access at http://localhost:3333
Convert images to WebP format:
npm run convertToWebp # Keep originals
npm run convertToWebp --delete-old # Delete originalsExtract specific pages from PDF files as high-quality images:
npm run convertPageImages <pdfPath> <pageNumber> <outputFormat> [outputPath]Arguments:
pdfPath- Path to the PDF filepageNumber- Page number to extract (starting from 1)outputFormat- Output image format:png,jpg,jpeg,webp,tiff, oravifoutputPath- (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.jpgFeatures:
- 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>
- Browse materials by semester
- Download individual labs
- Stream PDFs in browser
- Use search/filter features
- 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
- 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 on Vercel using included vercel.json or any Node.js server.
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.