0.5.1 • Published 6 years ago

pdb-todo v0.5.1

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 years ago

full-stack todo app

A full-stack todo app with:

  • c++ backend (leveldb + uWebSockets) with java (jni) stored procs
  • dart (flutter) mobile frontend (todo-dart) available here
  • typescript (vuets) web frontend (todo-ts) available here
  • c++ (nana) desktop frontend (todo-cpp)

The frontends above connect to the same rpc endpoint

The web and mobile apps have the same swipe/mouse semantics. Swipe horizontally to nagivate the pages (paginate). Long-press the item to update.

The web and desktop apps have the same keyboard shortcuts.

screenshot screenshot screenshot screenshot screenshot

Desktop-standalone (client+server+jre) downloads:

Server runtime dependencies

  • jdk7

Desktop dev requirements (c++)

Web dev requirements

Common dev requirements

Setup

mkdir -p target/data/main
echo "Your data lives in user/ dir.  Feel free to back it up." > target/data/main/README.txt

# download protostuffdb
yarn add protostuffdb@0.19.0 && mv node_modules/protostuffdb/dist/* target/ && rm -f package.json yarn.lock && rm -r node_modules

wget -O target/fbsgen-ds.jar https://repo1.maven.org/maven2/com/dyuproject/fbsgen/ds/fbsgen-ds-fatjar/1.0.17/fbsgen-ds-fatjar-1.0.17.jar
./modules/codegen.sh
mvn install

To build the c++ desktop frontend, visit todo-cpp/README.md

To build the dart mobile frontend, visit todo-dart/README.md

Web dev setup

cd todo-ts
yarn install

# build css
yarn run ns.b

Dev mode

# produces a single jar the first time (todo-all/target/todo-all-jarjar.jar)
./run.sh

# on another terminal
cd todo-ts
# serves the ui via http://localhost:8080/
yarn run dev

Production mode

If run.sh is still running, stop that process (ctrl+c)

cd todo-ts
# produces a single js and other assets in todo-ts/dist/
yarn run build
# finally, run your production app
nw .
# or
node chrome-app.js

Memory usage on ubuntu 14.04 x64

nana (8mb)

ps_mem.py -p 14073
 Private  +   Shared  =  RAM used	Program

  7.5 MiB + 544.0 KiB =   8.0 MiB	todo
---------------------------------
                          8.0 MiB
=================================

nana + jvm (38mb)

ps_mem.py -p 13930
 Private  +   Shared  =  RAM used	Program

  7.1 MiB + 362.5 KiB =   7.4 MiB	todo-pdb
---------------------------------
                          7.4 MiB
=================================

ps_mem.py -p 13934
 Private  +   Shared  =  RAM used	Program

 30.2 MiB + 387.0 KiB =  30.6 MiB	protostuffdb-rjre
---------------------------------
                         30.6 MiB
=================================

nwjs + jvm (107.5mb)

ps_mem.py -p 13497
 Private  +   Shared  =  RAM used	Program

 37.0 MiB +   8.3 MiB =  45.3 MiB	nw
---------------------------------
                         45.3 MiB
=================================

ps_mem.py -p 13499
 Private  +   Shared  =  RAM used	Program

392.0 KiB +   7.6 MiB =   8.0 MiB	nw
---------------------------------
                          8.0 MiB
=================================

ps_mem.py -p 13532
 Private  +   Shared  =  RAM used	Program

 48.1 MiB +   6.1 MiB =  54.2 MiB	nw
---------------------------------
                         54.2 MiB
=================================

flutter-desktop (106.7mb)

  • engine version: ed303c628fe4b322529f8cf01ecb38135a2bab73 (2018-04-10)
  • build type: host_release (optimized)
ps_mem.py -p 12136
 Private  +   Shared  =  RAM used	Program

105.3 MiB +   1.4 MiB = 106.7 MiB	run
---------------------------------
                        106.7 MiB
=================================

The most basic example app from flutter consumes 100mb