thanhnguyen2187 / cryptaa

Offline-first blazing fast & secure note taking application
https://cryptaa.pages.dev
MIT License
9 stars 0 forks source link

Cryptaa

crypta

(n.) an underground vault or chamber, especially one beneath a church that is used as a burial place.

Or an offline-first blazing fast & secure note taking application. Check the latest development version at: https://cryptaa.pages.dev. Note that the name is "Cryptaa", with two 'a's instead of one. The application has a first version. However, I started from scratch here to explore some better ideas.

Screenshots --- Desktop version: ![](./imgs/1.png) Mobile version: ![](./imgs/2.png) Synchronization: ![](./imgs/3.gif) ---

Motivations and Features

For a note-taking application, I wanted these attributes:

It surprised me that I couldn't find anything that check all the boxes. Some check more than the others, but in the end, all of them are inadequate and served as the inspiration for Cryptaa. Or NIH syndrome kicked in, and I wanted to use that chance to polish my skills/play around with new technologies.

How It Works

Cryptaa uses Triplit under the hood. Triplit runs in your browser (persisting to IndexedDB), and can be run within an independent server (persisting to SQLite) as well.

sequenceDiagram
    actor u as User
    participant c1 as Client 1 (Mobile)
    participant s as Server
    participant c2 as Client 2 (Desktop)

    u ->> c1: create notes
    c1 ->> c1: store the data
    c1 ->> s: send data
    s ->> s: store the data
    s ->> c2: send data

Development

node --version
# v18.18.2
npm --version
# 9.8.1
npm install
npm run dev
npm run server
# or
npx triplit dev

Client Deployment

yarn build

The built files should be available in a folder named build/. You are free to copy this somewhere else and serve it as a static website using a web server like Nginx or Caddy.

npm run preview

Or you can move to the folder and try serving it yourself:

# cd build
python -m http.server

Server Deployment

TRIPLIT_JWT_SECRET=super-secret
TRIPLIT_PROJECT_ID=cryptaa-server
# to run the server at port 5432
npm run server
# or specify another port
PORT=8888 npm run server
Service Token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ4LXRyaXBsaXQtdG9rZW4[...]
URL: https://cryptaa-server-demo.nguyenhuythanh.com
Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ4LXRyaXBsaXQtdG9rZW4tdHlwZSI6InNlY3JldCIsIngtdHJpcGxpdC1wcm9qZWN0LWlkIjoiY3J5cHRhYS1zZXJ2ZXIifQ.IDJB0XN3CjpBbWJxyGpHKbPU6rTQkndsFZYF2h4WEto

Miscellanies

Thanks to JetBrains for granting this project's previous version an Open Source License.

JetBrains logo