Commit graph

165 commits

Author SHA1 Message Date
bb306ee938 Pass headers when server fetches the schedule
Fix the inital server side load of the schedule not including crew only
items due to headers not being passed from the client to server side
request made to fetch the schedule.
2025-03-10 20:59:22 +01:00
5256f3fcf8 Remove unused items in Timetable 2025-03-10 20:59:04 +01:00
a9ba0c55e1 Implement role based shifts for crew 2025-03-10 20:58:33 +01:00
f69ca520c0 Refetch schedule and stream if session is updated 2025-03-10 16:43:21 +01:00
4806343250 Filter crew events to only be visible for crew 2025-03-10 16:26:52 +01:00
13f344472e Move schedule fetching into useSchedule composable 2025-03-10 15:41:32 +01:00
ddecfa3805 Set seed when generating interests into events
Prevent adding accounts from changing who's interestin in what in the
generated demo schedule.
2025-03-10 14:42:40 +01:00
6c4107a1cb Fix incorrect time offset in generated schedule
When correcting for a timezone being ahead of UTC the start has to be
moved backwards in time, not forward.  Fixes the generated schodule
not using central european times.
2025-03-10 14:40:52 +01:00
db8393c3a9 Add crew designator to events
Distinguish between events for attendees to see and events that are
meant only for the crew.
2025-03-10 14:40:02 +01:00
40c25f8990 Fix logic inversion braking interested 2025-03-09 23:56:39 +01:00
e8226e0062 Implement account type restricted page
Add allowedAccountTypes page metadata which the authenticated middleware
uses to further restrict the types of accounts that can access the page.

If the account type is insufficent to access the page it will return an
HTTP 403 Forbidden status, which is rendered using the error page.
2025-03-09 22:37:07 +01:00
245169950a Fixes on reading the session object 2025-03-09 22:18:42 +01:00
41528e8193 Display time in timezone configured on the account
Use the timezone configured on the account, or the default timezone if
no timezone is confirude to display the timetable and events in local
time.
2025-03-09 18:35:38 +01:00
1ac607a712 Use unix timestamps in timetable logic
Parse the iso date strings into millseconds from the unix epoch and use
that through the timetable logic instead of reparsing the strings over
and over.
2025-03-09 16:49:57 +01:00
c4a6f6b3f9 Add per account overridable timezone setting
To make it possible to render the timetable in the user's local time we
need to know the timezone to render it in on the server.  Otherwise
there will be hydration errors and paint flashing as the client renders
a different timezone.

Add a server global default timezone that can be overriden on a
per-account bases to prepare for timezone handling the timetable.
2025-03-09 15:53:51 +01:00
264c97b586 Fix server redirectng to login when logged in
When rendering on the server the session is not eagerly loaded when the
authenticated middleware runs, causing it to think the user is not
logged in.  Fix by awaiting the session composable.
2025-03-09 15:51:00 +01:00
8c8f340553 Type false session as null
Make the typing for the session work again by telling TypeScript the
false value is actually null.
2025-03-09 15:50:18 +01:00
c71841801b Use deleteCookie to remove session cookie 2025-03-08 00:36:10 +01:00
2897542823 Cache session data
The session is always explicitly updated when it changes, cache it on
the client if it has already been loaded.
2025-03-08 00:34:46 +01:00
ed74f4bb0e Use false instead of null for empty session
The caching layer of Nuxt assumes no entry exists if it's nullish.  This
causes null to be treated as if the resource needs to be fetched.  Use
false instead.
2025-03-08 00:33:35 +01:00
8ef4636635 Add create account functionality 2025-03-07 23:53:57 +01:00
598b9fd7d6 Add delete account function 2025-03-07 22:28:55 +01:00
3535105744 Pull Log Out button into its own component 2025-03-07 21:46:44 +01:00
db9a12250e Track which account is interested in which events
Store a list of ids of events and slots that accounts have marked as
being interested in, and show aggeregate counts in the schedule.
2025-03-07 20:15:41 +01:00
ca51c07065 Move push notification setting to separate page
Set up a dedicated Account Setttings page to hold account specific
settings such as the push notifications.
2025-03-07 18:43:24 +01:00
d4cbbcbc2d Fix session being double requested
If the returned value of the fetched endpoint is blank that gets
converted to undefined, which confuses the request sharing between the
client and server causing the session to be requested on both sides.

Transform value to null if it's blank so that the session fetch is
de-duplicated.
2025-03-07 16:45:40 +01:00
b2a5b67096 Refactor push subscription logic into a composable 2025-03-07 16:08:45 +01:00
52dfde95d1 Tie push subscriptions to current session
If a user logs out from a device the expectation should be that device
no longer having any association with the user's account.  Any existing
push notifications should thefore be removed on server.  For this reason
tie push notifications to a session, and remove them when the session is
deleted.
2025-03-07 15:47:48 +01:00
150cb82f5c Basic account and session system
Provide a basic account system with login and server side session store
identified by a cookie.  Upon successful login a signed session cookie
is set by the server with the session stored on the server identifying
which account it is logged in as.  The client uses a shared useFetch on
the session endpoint to identify if it's logged in and which account it
is logged in as, and refreshes this when loggin in or out.
2025-03-07 12:41:57 +01:00
abdcc83eb9 Refactor subscription format
Place the actual push subscription data into a push property on the
subscription so that other properties can be added to it.
2025-03-07 12:37:47 +01:00
b4934005ae Pull JSON read file logic into a function 2025-03-07 12:27:19 +01:00
8da4b02154 Implement signed cookie helpers
Provide a convenient wrapper for setting SHA-256 HMAC signed cookies and
retreiving them with the signature validated.  The secret key is
configured in the NUXT_COOKIE_SECRET_KEY environment variable.
2025-03-06 22:07:51 +01:00
5044b7b58d Fix day header inserted into break
If a span ended on midnight the next day header would be started on the
break and the sameDay check would match the day of the next span causing
the day header to be inserted into the break column.  Fix by checking
that the last day header has a non-zero span in the same day check.
2025-03-06 00:37:40 +01:00
3da83a7feb Fix demo schedule origin being on Saturday
It was intended to have Monday as the origin point.
2025-03-05 22:54:43 +01:00
e703902c5e Fix generated schedule using wrong date format 2025-03-05 22:43:07 +01:00
228d75db72 Generate a demo schedule if no schedule exists 2025-03-05 22:15:46 +01:00
f42dfcc13d Gracefully handle events with invalid locations 2025-03-05 22:14:58 +01:00
e45e51ef7a EventsEdit: Handle no events existing 2025-03-05 19:10:24 +01:00
5cc310384e Move stored data to a volume
Fix the silly data wipe on re-deployment by writing the data to a
volume instead of the ephemeral container filesystem.
2025-03-05 19:10:13 +01:00
6ea3567c94 Refactor code saving data
Move the code dealing with saving and loading data to server/database to
gather it all up into one place.
2025-03-05 18:41:47 +01:00
754d175ce2 Restore docker deployment pipeline
Adapt the Dockerfile to work with Nuxt and restore the deployment
pipeline.
2025-03-05 17:48:20 +01:00
d8a31db44d Handle event streams being cancelled
h3 doesn't correctly handle unexpected stream closures, bypass h3 and
operate directly on the Node.js ServerResponse object to handle them.
2025-03-05 16:02:26 +01:00
250ca9a1ac Port application from Next.js to Nuxt
Nuxt is based on Vue.js and I find their building blocks to be much
neater compared to the React based Next.js.
2025-03-05 15:36:50 +01:00
8c8b561f1a Convert indents to tabs 2025-03-01 17:06:41 +01:00
5e4ea1be61 Setup defaut Nuxt template 2025-03-01 16:52:23 +01:00
51ff27c569 Move all code to old/ to prepare for Nuxt rewrite 2025-03-01 16:32:51 +01:00
6007f4caeb Implement proof of concept push notifications 2025-02-28 15:32:03 +01:00
e3210afe3a Tag container image with latest instead of branch 2025-02-28 00:22:58 +01:00
e1af97e5e2 Prevent indexing by search engines 2025-02-27 23:44:44 +01:00
dd99b63546 Add deployment workflow 2025-02-27 22:42:28 +01:00