Calendaring app for shift-workers to enter their uneven work schedule more easily
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Adam Piontek 2624a32861
use purgecss for much smaller css
2 weeks ago
assets use purgecss for much smaller css 2 weeks ago
config move more fully to runtime config with release, improved docker build, updated phx liveview js 2 weeks ago
lib move more fully to runtime config with release, improved docker build, updated phx liveview js 2 weeks ago
priv use purgecss for much smaller css 2 weeks ago
rel/overlays/bin move more fully to runtime config with release, improved docker build, updated phx liveview js 2 weeks ago
test updated Bamboo references to Swoosh; added runtime.exs config file 6 months ago
.dockerignore move more fully to runtime config with release, improved docker build, updated phx liveview js 2 weeks ago
.formatter.exs Create phoenix project 2 years ago
.gitignore move more fully to runtime config with release, improved docker build, updated phx liveview js 2 weeks ago
.iex.exs month & shift navigation progress 2 years ago
Dockerfile move more fully to runtime config with release, improved docker build, updated phx liveview js 2 weeks ago
README.md move more fully to runtime config with release, improved docker build, updated phx liveview js 2 weeks ago
entrypoint.sh added Dockerfile and entrypoint script 6 months ago
mix.exs move more fully to runtime config with release, improved docker build, updated phx liveview js 2 weeks ago
mix.lock major deps update: phoenix liveview, fixing some minor issues 2 weeks ago

README.md

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