FortNotes is a web application for secure storage of encrypted notes (such as passwords). The presentation layer consists of two HTML pages:
- A welcome page allowing users to register and log in.
- A main page that performs the remainder of the functionality: client-side decryption and encryption, creating, editing, deleting, and navigating notes, backup, etc. The main editing functions are done through a two-pane view with the list of notes on the left and the currently selected note on the right. Other functions are performed using pop-up dialog boxes.
FortNotes is implemented in JavaScript on the client side and PHP on the server side. Persistent data is stored in a MySQL or SQLite database on the server.
Apart from this page, instructions are available in the blog.
Install dependencies:
apt install php-cli php-sqlite3 php-gd
Start API server:
cd server
php -S 0.0.0.0:8000
Serve release frontend files:
cd client/build/release
python3 -m http.server 8080
Start development:
cd client
npm run develop
There is also an old manual for installation on Windows - https://bitbucket.org/DarkPark/fortnotes/wiki/Home.
The source code repository of FortNotes contains the following directory structure:
- application
- controllers - contains PHP classes for each of the three main resource types (front page, note, and user)
- templates - contains PHP templates for the two HTML pages as well as the "dialog boxes" used by the main page
- lang - a placeholder to support a future multilingual version of the application (currently empty)
- library - contains PHP classes used by the index page and by the controllers
- public - the root of the website
- captcha - a library for generating CAPTCHA images, called simple-php-captcha
- css - contains several Cascading Style Sheets for different parts of the application
- img - contains static PNG image files referenced by the HTML
- lang - these PNG images are used to visually represent different language codes
- js - contains numerous JavaScript modules and libraries
- tests - contains unit test code based on the PHPUnit framework
The only URI visible to the user is the root of the website, which is handled by public/index.php. This source file simply includes some of the library/*.php modules and then invokes app::run(). This dispatches requests based on the following URL pattern:
scheme://host:port/<controller_name>/<method_name>[/<first_arg>[/<second_arg>...]]
Where:
controller_nameis the name of a PHP class, and must match the name of a source code file atapplication/controllers/<controller_name>.phpmethod_nameis the name of a method in the controller classfirst_argis an optional string that will be passed as the first argument to the method- additional arguments may also be specified
The defaults are controller_name = front and method_name = index, therefore the website root is handled by front::index() in application/controllers/front.php.
front::index() simply displays one of two possible HTML pages:
- if no valid login session exists,
application/templates/front.init.phpis rendered - if the user is already logged in,
application/templates/front.main.phpis rendered
In DEBUG mode (set at the top of library/app.core.php), this controller also invokes response::compact() to concatenate all of the CSS files into a single file public/css/all.css, and concatenates all of the JavaScript files into a single file public/js/all.js. This implies that any any change to a CSS or JS file needs to be executed in DEBUG mode first, and then the concatenated file should be deployed to the production server.
The following libraries are used by FortNotes and are included in the source:
- jQuery
- jQuery UI Autocomplete
- SimpleModal jQuery Plugin
- simple-php-captcha
- Stanford Javascript Crypto Library
The following library is used during development but is not included:
The following PHP extensions are required:
fortnotes is released under the GPL-3.0 License.