Calendaring app for shift-workers to enter their uneven work schedule more easily
Find a file
2023-01-28 08:14:32 -05:00
assets move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
config move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
lib move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
priv move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
rel/overlays/bin move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
test updated Bamboo references to Swoosh; added runtime.exs config file 2022-08-13 06:39:14 -04:00
.dockerignore move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
.formatter.exs Create phoenix project 2020-09-12 19:47:24 -03:00
.gitignore move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
.iex.exs month & shift navigation progress 2021-03-15 15:46:59 -04:00
Dockerfile move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
Dockerfile.bak move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
entrypoint.sh added Dockerfile and entrypoint script 2022-08-14 15:14:14 -04:00
mix.exs move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00
mix.lock major deps update: phoenix liveview, fixing some minor issues 2023-01-27 18:01:18 -05:00
README.md move more fully to runtime config with release, improved docker build, updated phx liveview js 2023-01-28 08:14:32 -05:00

Shift73k

Calendaring app for shift-worker shift tracking, with support for CSV export and sharing work schedule with others.

Written in Elixir & Phoenix LiveView, with Bootstrap v5.

Production

To run in production, you'll need to provide several environment variable values:

MIX_ENV=prod \
PHX_SERVER=true \
TZ=America/New_York \
DB_SOCK=[postgres unix socket path] \
DB_NAME=[postgres db name] \
DB_USER=[postgres db user] \
DB_PASS=[postgres db user password] \
SECRET_KEY_BASE=[phoenix secret key base] \
PHX_HOST=[server fqdn (e.g., shift.73k.us)] \
PORT=4000 \
SMTP_RELAY=[smtp server] \
SMTP_PORT=[smtp port] \
SMTP_USER=[smtp username] \
SMTP_PASS=[smtp user password] \
MAIL_REPLY_TO=reply@73k.us \
MAIL_FROM_FRIENDLY=Shift73k \
MAIL_FROM_ADDR=shift73k@73k.us \
ALLOW_REG=[open for registration? true/false] \
iex -S mix phx.server

Rebuilding assets for production

# rebuild static assets:
MIX_ENV=prod mix phx.digest.clean --all
rm -rf ./priv/static/*
npm --prefix assets run build
MIX_ENV=prod mix phx.digest
# then do a new commit and push...

TODO

  • Proper modal to delete shifts? [2022-08-14]
  • move runtime config out of compile-time config files, to move towards supporting releases [2023-01-28]
  • bootstrap dark mode?
  • update tests, which are way out of date? Also I don't care?

Deploying with docker

The Dockerfile will enable building a new container. I do it all with docker compose, here's an example compose yml:

version: '3.9'
services:
  shift73k:
    build:
      context: ./shift73k  # relative path from docker-compose.yml to shift73k repo
      network: host
    container_name: www-shift73k
    restart: unless-stopped
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /srv/dck/postgres/sock/postgres:/var/run/postgresql # if using unix socket
    # env_file: ./shift73k.env  # optionally, put your env vars in a separate file
    environment:
      - PHX_SERVER=true
      - TZ=America/New_York
      - DB_SOCK=/var/run/postgresql # if using unix socket instead of db url
      - DB_NAME=[postgres db name]  # if using unix socket instead of db url
      - DB_USER=[postgres db user]  # if using unix socket instead of db url
      - DB_PASS=[postgres db user password] # if using unix socket instead of db url
      - SECRET_KEY_BASE=[phoenix secret key base]
      - PHX_HOST=[server fqdn (e.g., shift.73k.us)]
      - PORT=4000
      - SMTP_RELAY=[smtp server]
      - SMTP_PORT=[smtp port]
      - SMTP_USER=[smtp username]
      - SMTP_PASS=[smtp user password]
      - MAIL_REPLY_TO=reply@73k.us
      - MAIL_FROM_FRIENDLY=Shift73k
      - MAIL_FROM_ADDR=shift73k@73k.us
      - ALLOW_REG=[open for registration? true/false]
    ports:
      - 4000:4000