* Paperless office interface
Reads the texts of images and makes them browsable and searchable via HTTP.
** Requirements
On an Ubuntu system run the following to install prerequisites for the OCR
and processing:
#+begin_src shell
sudo apt-get install sqlite3 tesseract-ocr-osd tesseract-ocr-fin tesseract-ocr imagemagick unpaper
#+end_src
Also Golang is required. Tested with go 1.8.
** Building the application
Clone this repository and run the following command:
#+begin_src shell
go build
#+end_src
** Usage
Start the web server with the following:
#+begin_src shell
./paperless
#+end_src
This starts a web-server to the port 8078. See the '--help' argument for
command line options
File uploading happens with a browser. There is the '+' button which opens
a panel where one can drag-and-drop images to OCR.
** Running this inside Docker
If you have Docker properly set up, you can run this inside docker with the
following:
#+begin_src shell
cd docker
./run.sh
#+end_src
This should start an Ubuntu 16.04 Docker instance where the program is
running.
** Uploader application
In the uploader directory there is a go-application that can be used to
send batches of tagged images to the server.
Build it with the following:
#+begin_src shell
cd uploader
go build
#+end_src
Example run:
#+begin_src shell
./uploader -t important,dontremove http://localhost:8078 important-01.jpg important-02.jpg
#+end_src
Usage is printed with the --help argument.
** Developing the frontend
The frontend development requires Nodejs and NPM. Therefore the
environment can be set up with:
#+begin_src shell
cd web/paperless-frontend
npm install
#+end_src
To set up a running environment do the following:
1. Start the paperless -application to get the backend running in port 8078.
2. Start the webpack-dev-server with:
#+begin_src shell
cd web/paperless-frontend
npm run dev
#+end_src
3. This will start the frontend to port 8080 that connects to the backend
in port 8078.
The frontend is embedded in the final binary. To update the changes from
the frontend development files to the binary, do the following:
1. Install the 'esc' file embedder, so the esc can be found in the $PATH.
#+begin_src shell
go get -i github.com/mjibson/esc
#+end_src
2. Build the dist-package of the frontend:
#+begin_src shell
cd web/paperless-frontend
npm run build
#+end_src
3. Regenerate the lib/web-generated.go with:
#+begin_src shell
cd lib
go generate
#+end_src
4. Build normally, test and commit the generated files.
** License
MIT license