Skip to content

FrankApiyo/liveview-svelte-pwa

 
 

Repository files navigation

Local-first Mental Health Journaling

Logo

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

Analytics server

  • 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

Running Locally

You can run this app locally by following the steps below after cloning the repo.

  1. Install elixir and erlang
  2. Install the Phoenix dependencies.
mix deps.get
  1. Install the Node.js dependencies. The --prefix assets is required when running the command from the root directory in order to install the dependencies in the assets directory.
npm install --prefix assets
  1. Create the database.
docker compose up
mix ecto.create
  1. Start the Phoenix server.
mix phx.server
  1. 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

Technologies Used

Todos

  • 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 syncing from 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)

About

Local-first Mental Health Journaling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 69.1%
  • Svelte 21.6%
  • JavaScript 4.2%
  • TypeScript 4.0%
  • Dockerfile 0.9%
  • Shell 0.1%
  • Other 0.1%