Commit graph

188 commits

Author SHA1 Message Date
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
3d48aa0aac Add docker build for deployment 2025-02-27 22:41:14 +01:00
3e9faa0c03 Signal schedule page is dynamic
Without this the page pre-render is cached, and a hydration error is
thrown when this cached pre-render doesn't match the JS rendered version.
2025-02-27 22:21:08 +01:00
7e395c5616 Fix timestamps for create and update action
The browser strips the timezone indicator to use the datetime picker, so
the server needs to add this back again.
2025-02-27 22:20:03 +01:00
1217104cd2 Colour events to make them visible 2025-02-27 19:18:39 +01:00
093a6816bc Implement editing of the schedule
Cobbled together minimum viable system for editing the schedule in a way
that propogates updates to connected clients.
2025-02-27 18:39:04 +01:00
cdad188233 Implement EventStream for live schedule updates 2025-02-27 15:42:59 +01:00
e5aac858e4 Document timetable terminology 2025-02-27 15:01:30 +01:00
8296f9c17d Remuve unused styles 2025-02-27 02:27:56 +01:00
99d04f4b43 Move schedule data to JSON file 2025-02-26 23:56:19 +01:00
cb2ad42915 Remove example code 2025-02-26 23:43:12 +01:00
484c27ece2 Minimally functional schedule rendering
Add timetable and event listing based on transforming a simple input
data structure.
2025-02-26 22:53:56 +01:00
7d822e4934 Use project TypeScript in VsCode 2025-02-26 21:54:28 +01:00
e20aef2f32 Add editor configs
Add .editorconfig, .vscode and .gitattributes configs to make editors
and tools aware that the files use unix line indeings and are indentent
with tabs.
2025-02-26 12:05:32 +01:00
9163ca63a9 Convert spaces to tabs 2025-02-26 12:05:12 +01:00
64ed7e852e Initial commit from Create Next App 2025-02-26 11:53:10 +01:00