This Journaling app is a demo of an installable Phoenix Progressive Web App (PWA) that can sync real-time across multiple devices while also being able to work locally offline.
Learn more about the architecture of this app here
- This web app also depends on an analytics server which is responsible for generating insights on user journaling
- Please read more about the analytics server here
- The analytics server utilizes API endpoints whose documentation can be accessed once the server is running here
You can run this app locally by following the steps below after cloning the repo.
- Install elixir and erlang
- Install the Phoenix dependencies.
mix deps.get- Install the Node.js dependencies. The
--prefix assetsis required when running the command from the root directory in order to install the dependencies in theassetsdirectory.
npm install --prefix assets- Create the database.
docker compose up
mix ecto.create- Start the Phoenix server.
mix phx.server- Adding pre-commit hooks.
mkdir -p .git/hooks
echo '#!/bin/sh
# Get the Git root directory
GIT_ROOT=$(git rev-parse --show-toplevel)
# Change to assets directory
cd "$GIT_ROOT/assets" || exit 1
# Run Prettier
npx prettier --write .
# Change back to Git root
cd "$GIT_ROOT" || exit 1
# Run mix format
mix format
' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit- Phoenix LiveView, PubSub, and Ecto/PostgreSQL for real-time syncing and data persistence.
- Svelte (via LiveSvelte) for the frontend UI and state management.
- Service Workers, Web Storage, and IndexedDB (via y-indexeddb) for offline support.
- CRDTs (via Yjs) to resolve conflicts between distributed app states.
- Wallaby to run integration tests
- Add some pre-commit hooks to run the following:
-
mix format -
npx prettier --write .
-
- Add APIs with Django
- Add new tables for Journals
- Add API endpoint to get JSON journals
- Add API authentication
- Add some simplistic RBAC
- Fix issue with syncing to the text area
- Remove
syncingfrom settings page - Look into a better field type for documents in PostgreSQL
- Visualizations
- Wordcloud
- Deployment & Documentation
- Include scanning with trivy as a sec. measure
- Add bot and webcrawler detection and prevention strategies
- Add some unit tests for svelte fns (night)
- More FE tests
- Research on how to always make sure that a PWA JS is always up to date
- Remove dev secrets from repo
- More Wallaby tests (nights)
