Skip to content

Node.js service to serve images and videos as slideshow from the filesystem

License

Notifications You must be signed in to change notification settings

frncsdrk/lenscast

Repository files navigation

lenscast

Serve images and videos directly from filesystem to a browser

Usage

Default Port: 9000

Configuration

Environment Variables

  • LENSCAST_PORT -- Overwrite port via environment

Configuration Files

lenscast uses the config package. Add a file called local.EXT, e.g. local.yml like described here.

Deployment

Quick

pnpm run bootstrap
pnpm run start -- port=9000

pm2

pnpm i -g pm2
pnpm run bootstrap
pm2 start bin/www

Development

Documentation

Setup

pnpm i -g apidoc

Generate docs

pnpm run docs:generate

Why?

Usecase

The goal with this is to configure a Raspberry Pi with an external hard drive, optional Samba share and a Node.js installation with reverse proxy to serve images and videos in a simple way in a home network. I consider a home network relatively safe and photos and videos as non-sensitive data, thus there is no need for authentication, user-management or RBAC and whatnot. There is probably a considerable amount of data but still manageable via the good old filesystem and the help of modern hardware, i.e. SSDs. There is no need for fancy stuff like sorting photos by faces or locations. The main purpose is to sort images and videos into directories and present them as a slideshow. Thus no AI, databases or external APIs are necessary.

Code

The code is certainly not optimal but it works. The project is practical and my approach to the code is the same. Still, contributions and improvements are very welcome.

TODO

  • Setup
    • git repo
    • pnpm
    • nodemon
    • pm2
    • express
    • apidoc
    • logging
    • i18next
  • Configuration
    • Base directory
    • Video autoplay
    • Slideshow: Display photo for n seconds
  • List files
    • File names
    • Differentiate between directories and files
    • Preview (Thumbnails)
  • Thumbnails
  • Overlay (full-screen)
    • Controls
      • Close
      • Forward
      • Back
      • Play / Pause
    • Photos
    • Videos
  • Detail page
    • Photos
    • Videos
    • Controls
      • Back
  • Slideshow
    • Photos
    • Videos
    • Controls
      • Close
      • Forward
      • Back
      • Play / Pause
    • Calculate max display size of photos and videos
  • Responsiveness (Mobile / TV friendliness)
    • meta scale to device width

Thumbnails

Module: NPM

Resources

Contributing

See CONTRIBUTING

Credits

See CREDITS

License

Unlicense (c) 2024 frncsdrk and contributors

About

Node.js service to serve images and videos as slideshow from the filesystem

Resources

License

Stars

Watchers

Forks