An open source self hosted web app for your notes and bookmarks side by side.
This project is currently in Beta. You may encounter bugs or errors.
- URLs are automatically saved with an image, title and description
- can be installed as a PWA on your mobile devices (and desktop)
- collections can be shared via a public available URL
- supports both markdown and a rich text editor experience
- links can be pasted (by pressing only one button)
- can be hosted almost anywhere thanks to its use of the lightweight Lumen framework and well supported PHP language
Prerequisite:
- git (https://git-scm.com)
- composer (https://getcomposer.org)
- PHP ≥ 7.2.5
- MySQL, Postgres, SQLite or SQL Server (currently only MySQL is tested)
Installation:
- git clone https://github.com/fr0tt/benotes (download files version-controlled)
- composer install (install dependencies accordingly to your php version.
Please note that php8-cli will fail, use instead something similar to the likes of: /usr/bin/php7.4 /usr/local/bin/composer install or any other php-cli version between 7.2.5 and 7.4) - cp .env.example .env (copy configuration file)
- generate a random string for APP_KEY in your .env file e.g. openssl rand -base64 32 (for security reasons)
- create a database
- also edit DB_DATABASE, DB_USERNAME and DB_PASSWORD in .env file accordingly (in order to be able to connect to your database)
- php artisan install (amongst other: create database tables and fill them)
- ln -sfn ../storage/app/public/ public/storage (create symlink for storage)
- chown -R :www-data storage && chmod -R 774 storage (make storage directory writable for webserver if your webserver runs as user www-data)
- if you wish to use it on a production server change in your .env file APP_ENV from local to production
- git pull (upgrade files)
- composer install (upgrade dependencies. See composer part of Installation for information about php8 above)
- php artisan migrate (upgrade database schemas)
Feel free to contact me if you need any help or write an issue.
POST /api/auth/login
Logs in a user
Attribute | Value |
---|---|
Required. | |
password | Required. |
POST /api/auth/refresh
Refreshes the JWT Token
GET /api/auth/me
Returns the authenticated user
POST /api/auth/logout
Logs out the authenticated user
GET /api/posts
Get multiple posts
Attribute | Value |
---|---|
collection_id | Optional. Specify a collection of which you want to request posts. If collection_id is not specified you will get all posts from all collections from your user |
is_uncategorized | Optional. Specify if you wish to get all posts without a collection. |
limit | Optional. Limit the amount of requested posts by number |
GET /api/posts/{id}
Get one post by its id
POST /api/posts
Create a new post
Attribute | Value |
---|---|
collection_id | Optional. Specify a collection you wish to save your new post to, if not, your post will not be part of a collection. |
title | Optional. Specify a title, gets automatically filled if your content is a link |
content | Required. Specify a link, post, message, .. |
PATCH /api/posts/{id}
Update an existing post
Attribute | Value |
---|---|
collection_id | Optional. Specify a collection you want to save your post to instead. To patch a post from the uncategorized collection simply use 0 as value for the collection_id |
title | Optional. Change your posts title |
content | Optional. Change your posts content |
order | Optional. Specify a new order you wish to move your post to |
DELETE /api/posts/{id}
Delete a post by its id