5.0.1 • Published 2 years ago

@thinktool/client v5.0.1

Weekly downloads
198
License
UNLICENSED
Repository
github
Last release
2 years ago

Thinktool

This repository contains the source code of Thinktool, an associative note-taking application inspired by TheBrain and Roam Research.

This is not open source!

Please note that this software is not open source. The omission of a LICENSE file is intentional.

As such, the instructions in this README are mostly written for myself, and may not be sufficient to compile this project on your own. That being said, you may find some hints in .github/workflows.

This project is also not currently accepting issues or pull requests. Please see Thinktool's web page for information about how to contact me with your feedback about Thinktool. Also, I may occationally force push to this repository, since I'm not expecting anyone else to clone it.

If I abandon this project in the future, I intend to make it open source. If you can see that I have not touched this repository in several months, feel free to send me an email reminding me of this fact!

Directory Structure

Source code:

DirectoryPurpose
/src/share/Code shared between client and server.
/src/server/Code for dynamic Node.js server.
/src/client/Client code shared between web and desktop client.
/src/web/Code specific to web client.
/src/desktopCode specific to desktop client.
/src/markup/Source for HTML markup.
/src/style/Source for CSS stylesheets.
/src/static/Other static resources.

The generated output goes in the /dist/ directory. Each subdirectory is intended to be deployed differently:

DirectoryPurpose
/dist/Output files generated from /src/. Each subdirectory represents a sepearte target.
/dist/static/Static content, including HTML, CSS and JavaScript.
/dist/server/Code for dynamic server running Node.js.

Tools and configuration:

DirectoryPurpose
/tools/Scripts and other tools used for building, development and deployment.
/tools/dev/Tools used for development only.

Deployment

The application consists of two parts:

  1. Static resources, output to /dist/static/
  2. Node.js server, output to /dist/server/
  3. Electron-based desktop client, output to /dist/desktop/

The static resources should be deployed to a static site hosting service, while the server code should be run on an appropriate server using Node.js. The desktop client is bundled as an executable app.

You will need to have the following dependencies installed:

  • Node.js and NPM
  • Docker
  • Bash and the GNU core utilities
  • Curl
  • Azure CLI
  • PostgreSQL

Development

If you don't want to install these dependencies on your development machine, there is a Dockerfile descirbing a Debian system with most of those dependencies installed available in the tools/dev/ directory. Use a separate Docker container for PostgreSQL. For example:

$ docker build tools/dev -t thinktool-dev
$ docker run -e POSTGRES_PASSWORD=password -v postgres-data:/var/lib/postgresql/data -d postgres
$ docker run -ti -v $(pwd):/work thinktool-dev

Static Resources

Set the following environment variables:

  • DIAFORM_API_HOST API server host, including the protocol, e.g. https://api.thinktool.io.

Then build the web client and other static resources with:

$ ./tools/build-client.sh
$ ./tools/build-static.sh

Then, set AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_KEY and run ./tools/deploy-static.sh to deploy static files to Microsoft Azure Storage.

Desktop

The desktop client can currently be built for Linux and Windows. We're planning on supporting macOS in the future. It must be built on the same platform that is being targeted.

Start by setting the following environment variables:

  • DIAFORM_API_HOST API server host, including the protocol, e.g. https://api.thinktool.io.

On Linux, build the desktop client with:

$ ./tools/build-desktop-linux.sh

Even on Windows, you need to use bash as your shell. Run:

$ ./tools/build-desktop-windows.sh

(Note that building the desktop client clears out the dist/static/ directory. This is a temporary hack; see the build-desktop-linux.sh and build-desktop-windows.sh files for more information.)

Once you have built the desktop client, the output will be in dist/. Set AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_KEY and run ./tools/deploy-static.sh to deploy these files to Microsoft Azure Storage.

Server

The server uses a PostgreSQL database. Set the following environment variables before running the server:

  • DIAFORM_POSTGRES_HOST The hostname containing the database, e.g. localhost
  • DIAFORM_POSTGRES_PORT Port that the database is running on, e.g. 5432
  • DIAFORM_POSTGRES_USERNAME Username used to authenticate with the PostgreSQL DB, e.g. postgres
  • DIAFORM_POSTGRES_PASSWORD Password used to authenticate with the PostgreSQL DB, e.g. postgres

You will need to manually set up the database schema. See tools/db/_initialize.sql, though this may be outdated.

For sending emails (used for "Forgot my password" functionality), we use SendGrid. Configure the following environment variables:

  • SENDGRID_API_KEY SendGrid API key; find or create under Settings API Keys

Additionally, the server expects the following environment variables to be set:

  • DIAFORM_STATIC_HOST Base URL of the server hosting static resources, e.g. https://thinktool.io

Build the server as a Docker image:

# docker build -t thinktool -f tools/Dockerfile .

Once you have the thinktool image, run it with the environment variables given above:

# docker run \
    -e DIAFORM_POSTGRES_HOST \
    -e DIAFORM_POSTGRES_PORT \
    -e DIAFORM_POSTGRES_USERNAME \
    -e DIAFORM_POSTGRES_PASSWORD \
    -e SENDGRID_API_KEY \
    -e DIAFORM_STATIC_HOST \
    -p 80:80 \
    thinktool
5.0.1

2 years ago

5.0.0

2 years ago

4.8.5

2 years ago

4.8.4

2 years ago

4.8.1

2 years ago

4.8.0

2 years ago

4.8.3

2 years ago

4.8.2

2 years ago

4.7.0

2 years ago

4.7.1

2 years ago

4.6.0

2 years ago

4.4.1

2 years ago

4.4.0

2 years ago

4.5.0

2 years ago

4.5.1

2 years ago

4.3.0

3 years ago

4.2.0

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago

4.1.2

3 years ago

4.1.1

3 years ago

4.0.0

3 years ago

4.1.0

3 years ago

3.15.0

3 years ago

3.15.1

3 years ago

3.14.1

3 years ago

3.14.0

3 years ago

3.13.0

3 years ago

3.12.0

3 years ago

3.11.0

3 years ago

3.10.1

3 years ago

3.10.0

3 years ago

3.9.0

3 years ago

3.8.0

3 years ago

3.7.0

3 years ago

3.6.3

3 years ago

3.6.2

3 years ago

3.6.1

3 years ago

3.6.0

3 years ago

3.5.1

3 years ago

3.5.0

3 years ago

3.4.10

3 years ago

3.4.9

3 years ago

3.4.8

3 years ago

3.4.7

3 years ago

3.4.6

3 years ago

3.4.5

3 years ago

3.4.4

3 years ago

3.4.3

3 years ago

3.4.2

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

3.3.5

3 years ago

3.3.4

3 years ago

3.3.3

3 years ago

3.3.1

3 years ago

3.3.2

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.0-alpha.4

4 years ago

3.0.0

4 years ago

3.0.0-alpha.3

4 years ago

3.0.0-alpha.1

4 years ago

3.0.0-alpha.2

4 years ago

2.5.4

4 years ago

2.5.3

4 years ago

2.5.2

4 years ago

2.5.1

4 years ago

2.5.0

4 years ago

2.4.1

4 years ago

2.3.2

4 years ago

2.4.0

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.9.0

4 years ago

1.10.0

4 years ago

1.8.0

4 years ago

1.7.4

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago