Coder Social home page Coder Social logo

sebcode / b Goto Github PK

View Code? Open in Web Editor NEW
52.0 10.0 11.0 223 KB

Minimalistic bookmark manager for your own server written in PHP. Bookmarks are stored in a sqlite database.

License: MIT License

PHP 70.70% JavaScript 19.50% CSS 3.91% HTML 0.92% Dockerfile 0.98% Makefile 3.45% Shell 0.55%
self-hosted bookmarks-manager php sqlite

b's Introduction

b - Bookmark manager

b is a minimalistic bookmark manager for your own server. Written in PHP. Bookmarks are stored in a sqlite database. Features:

  • filtering
  • tagging
  • automatic fetching of page title
  • infinite scrolling (optional)
  • bookmarklet
  • multiple users

Requirements

  • make
  • docker + docker compose

Tested on Ubuntu 21.04 and macOS Big Sur.

Setup

This web app uses HTTP basic auth password protection. Create a htusers file and specify username/password like this:

mkdir db
./htpasswd -c db/htusers peter

The bookmark manager can host multiple databases. To initialize a new database, simply create a subdirectory:

mkdir db/peter

This will make bookmarks accessible via http://localhost:9090/peter.

Use make to start the webserver container and make down to stop it.

To prevent forking the container into the background, use make up instead of make (useful for debugging).

How to use

  • To add a new bookmark, simply paste it into the input field and press return. the url may be followed by hash tags, e.g. http://example.com #example #bla #wurst
  • The website's title is automatically fetched and the bookmark is added to the database.
  • Edit title by double clicking it. This opens a prompt-dialog where you can edit the title. Enter '-' (minus sign) to remove an entry.
  • To edit the URL, double click beside the link.
  • The input field can also be used to filter bookmarks. Filtering is done with a full-text search on all titles. Search terms are separated by spaces and joined with AND.

Infinite scrolling

If you have a massive amount of bookmarks and you don't want to load them all at once, you can activate infinite scrolling. This will load a limited amount of bookmarks initially and load more when you scroll to the bottom of the page. Activate infinite scrolling by adding INFINITE_SCROLLING=200 to .env. Replace 200 with the number of bookmarks you want to load each time you hit the bottom.

Bookmarklet

Visit /[user]/bookmarklet to access the user's bookmarklet, e.g. http://bookmarks.example.com/peter/bookmarklet. (Thanks to nibreh for the suggestion!)

Credits

Copyright (c) 2011-2021 Sebastian Volland http://github.com/sebcode

The source code is licensed under the terms of the MIT license (see LICENSE file).

b's People

Contributors

nibreh avatar sebcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

b's Issues

returning mixed crashes in (at least) php 7.4.26

public function getConfig(string $key): mixed

returning mixed crashes for me in (at least) php 7.4.26

i guess that if you want to use types, you should rather use:

public function getConfig(string $key): ?string

this will work as long as -- i think to understand -- the configs are done by putenv, which will always return a string (or false... but you're catching that branch in putenv())

Pagination

How about to add a pagination system ?

For example, in config.php, we can choose how much link we want to display. Maybe this can be useful when there are many links to display. But I don't know if it's necessary or possible and simple to do.

I don't think it's a good idea to define the namespace in index.php

namespace B;

technically it probably works.

but up to now, I've only seen the namespace used where the functions and classes are defined, not where they are used.

not a big issue, but that did let me wonder what was going on...

this will probably be my last ticket for now.
b now works on my computer and i will upload it to my server and start using it.
thanks for sharing your code!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.