Calendaring app for shift-workers to enter their uneven work schedule more easily
Find a file
2022-08-14 14:33:42 -04:00
assets npm update, remove runtime.exs as not using for now 2022-08-14 13:58:41 -04:00
config npm update, remove runtime.exs as not using for now 2022-08-14 13:58:41 -04:00
lib fixed user delete error by correcting foreign key constraint; updated liveview modals to use component directly & removed deprecated @socket parameters 2022-08-14 12:49:25 -04:00
priv fixed user delete error by correcting foreign key constraint; updated liveview modals to use component directly & removed deprecated @socket parameters 2022-08-14 12:49:25 -04:00
test updated Bamboo references to Swoosh; added runtime.exs config file 2022-08-13 06:39:14 -04:00
.formatter.exs Create phoenix project 2020-09-12 19:47:24 -03:00
.gitignore updated gitignore & readme 2021-03-16 11:39:53 -04:00
.iex.exs month & shift navigation progress 2021-03-15 15:46:59 -04:00
mix.exs updated deps & switched from Mix.Config to Config 2022-08-13 06:19:56 -04:00
mix.lock updated deps & switched from Mix.Config to Config 2022-08-13 06:19:56 -04:00
README.md npm update, remove runtime.exs as not using for now 2022-08-14 13:58:41 -04: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.

TODO

  • Proper modal to delete shifts? [2022-08-14]
  • Update tests, which are probably all way out of date. But I also don't care that much for this project...

Deploying

The below notes are old; I'm using a docker build to deploy this now. Will document when I have time.

New versions

When improvements are made, we can update the deployed version like so:

cd ${SHIFT73K_BASE_DIR}
# update from master
/usr/bin/git pull 73k master
# fetch prod deps & compile
/usr/bin/mix deps.get --only prod
MIX_ENV=prod /usr/bin/mix compile
# perform any migrations
MIX_ENV=prod /usr/bin/mix ecto.migrate
# update node packages via package-lock.json
/usr/bin/npm --prefix ./assets/ ci
# rebuild static assets:
rm -rf ./priv/static/*
/usr/bin/npm --prefix ./assets/ run build
MIX_ENV=prod /usr/bin/mix phx.digest
# rebuild release
MIX_ENV=prod /usr/bin/mix release --overwrite
# restart service
sudo /bin/systemctl restart shift73k.service

systemd unit:

[Unit]
Description=Shift73k service
After=local-fs.target network.target

[Service]
Type=simple
User=runuser
Group=runuser
WorkingDirectory=/opt/shift73k/_build/prod/rel/shift73k
ExecStart=/opt/shift73k/_build/prod/rel/shift73k/bin/shift73k start
ExecStop=/opt/shift73k/_build/prod/rel/shift73k/bin/shift73k stop
#EnvironmentFile=/etc/default/myApp.env
Environment=LANG=en_US.utf8
Environment=MIX_ENV=prod
#Environment=PORT=4000
LimitNOFILE=65535
UMask=0027
SyslogIdentifier=shift73k
Restart=always

[Install]
WantedBy=multi-user.target

nginx config:

upstream phoenix {
  server 127.0.0.1:4000 max_fails=5 fail_timeout=60s;
}
server {
  location / {
    allow all;
    # Proxy Headers
    proxy_http_version 1.1;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-Cluster-Client-Ip $remote_addr;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_redirect off;
    # WebSockets
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_pass http://phoenix;
  }
}