21 Commits

Author SHA1 Message Date
f2d8ab81e9 🚀Bumped version to 0.3.0
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:16:08 +02:00
c546a96c4d feat(registration): drop privacy checkbox [privacy is linked on page]
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:15:34 +02:00
c82fdf3823 🚀Bumped version to 0.2.0
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:12:29 +02:00
a46a67793c Merge branch 'main' of https://git.odit.services/lfk/kiosk
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:11:12 +02:00
898d3595a0 feat(registration): cleanup finished page 2023-04-19 12:11:05 +02:00
3aa6f0473b 🚀Bumped version to 0.1.0
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:10:42 +02:00
22be68311b typo 2023-04-19 12:10:31 +02:00
5d7a25e54f updated release hook 2023-04-19 12:10:01 +02:00
16deab5308 pnpx -> npx
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:08:54 +02:00
45eb4b0828 Merge branch 'main' of git.odit.services:lfk/kiosk 2023-04-19 12:08:28 +02:00
c0a39bdabe release from main 2023-04-19 12:08:07 +02:00
e25aaf3e5e Moved config into call 2023-04-19 12:07:27 +02:00
d68e88ec9a Updated typing 2023-04-19 12:06:13 +02:00
1a0f52f31f Added bwip types 2023-04-19 12:05:19 +02:00
1c5e246095 fix(registration): typo
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:05:13 +02:00
74970c4c5b Merge branch 'main' of https://git.odit.services/lfk/kiosk
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:05:00 +02:00
fffe290360 fix(a11y): input borders 2023-04-19 12:04:43 +02:00
3d110e8f48 Moved barcode height to main config
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 12:03:28 +02:00
0bd83f8000 Added readme 2023-04-19 12:01:51 +02:00
910fa3867b pinned dependency 2023-04-19 11:57:47 +02:00
2e355dbb46 Package project info 2023-04-19 11:57:36 +02:00
8 changed files with 10444 additions and 94 deletions

56
CHANGELOG.md Normal file
View File

@@ -0,0 +1,56 @@
### Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
#### [0.3.0](https://git.odit.services/lfk/kiosk/compare/0.2.0...0.3.0)
- feat(registration): drop privacy checkbox [privacy is linked on page] [`c546a96`](https://git.odit.services/lfk/kiosk/commit/c546a96c4d959b41181c34d6affccafdf84a221a)
#### [0.2.0](https://git.odit.services/lfk/kiosk/compare/0.1.0...0.2.0)
> 19 April 2023
- feat(registration): cleanup finished page [`898d359`](https://git.odit.services/lfk/kiosk/commit/898d3595a032c87615e1825d0023299b029fc19e)
- 🚀Bumped version to 0.2.0 [`c82fdf3`](https://git.odit.services/lfk/kiosk/commit/c82fdf3823acf0ea49f0218ba57805e5d15fae97)
#### 0.1.0
> 19 April 2023
- 🚀Bumped version to 0.1.0 [`3aa6f04`](https://git.odit.services/lfk/kiosk/commit/3aa6f0473bd8767cbe33277643a5778d2b68a8ae)
- Basic sveltekit project [`e0c0cbb`](https://git.odit.services/lfk/kiosk/commit/e0c0cbbbd8b2c4cb7db0a8ae3aa295083ae636d1)
- Release config [`6b98ee9`](https://git.odit.services/lfk/kiosk/commit/6b98ee96341def78447317a39e1ff30f9db73a9d)
- Added basic welcome page [`5ed21bb`](https://git.odit.services/lfk/kiosk/commit/5ed21bb13d30cc43bc16fd6357f2e92e031c3273)
- Bump ts [`50764bc`](https://git.odit.services/lfk/kiosk/commit/50764bca472a441c2e84fc3273771303a94759ae)
- Basic registration page [`09aee15`](https://git.odit.services/lfk/kiosk/commit/09aee15f60bec58ca3cc3b9ce392774a7ff77219)
- Added basic drone docker build, build checks and typechecks [`eca9966`](https://git.odit.services/lfk/kiosk/commit/eca9966e29f5222189e0f10a6874e3c9e5f32b56)
- Basic userstore [`88f3657`](https://git.odit.services/lfk/kiosk/commit/88f36575fb81c47b2e88f708890da77dcadde2e1)
- Added login page with logic [`078e8dc`](https://git.odit.services/lfk/kiosk/commit/078e8dcb9af67ea874a7547c9303cb2a831a8486)
- Added license exporter [`28b45f8`](https://git.odit.services/lfk/kiosk/commit/28b45f876877391d466a4a71e0772793bbe02137)
- Added readme [`0bd83f8`](https://git.odit.services/lfk/kiosk/commit/0bd83f8000daeef993764aea29149036b1d80254)
- Added runnerid as barcode [`5a81cb6`](https://git.odit.services/lfk/kiosk/commit/5a81cb64f59ca75264a38d09d54c19e506486e3a)
- Registration feedback logic [`d3d0d17`](https://git.odit.services/lfk/kiosk/commit/d3d0d17b3a99ab8412df3111dc2d4c029fd04908)
- Pin dependencies [`abff31a`](https://git.odit.services/lfk/kiosk/commit/abff31aaee4b6f6a07f4e1292e2b95d13b995fab)
- Register results [`7cecbfe`](https://git.odit.services/lfk/kiosk/commit/7cecbfe80e60bc22cab9f4c0e8e2aa0b33899280)
- Authed page login logic [`7879ca8`](https://git.odit.services/lfk/kiosk/commit/7879ca82fde600fdb9f314b6dd63a324eb308102)
- Added dockerfile + compose [`e5535f1`](https://git.odit.services/lfk/kiosk/commit/e5535f18692d7afc3f2636283722e61aa0437c59)
- Package project info [`2e355db`](https://git.odit.services/lfk/kiosk/commit/2e355dbb46404fe0eccd8409614ec7444933bcae)
- Added bwip types [`1a0f52f`](https://git.odit.services/lfk/kiosk/commit/1a0f52f31f9bdd0fd78756e714f23433e16deb1e)
- Fix in auth [`710cad3`](https://git.odit.services/lfk/kiosk/commit/710cad376eb865a0c82743a7213c3f4097027c23)
- Switched to adapter static [`93bf436`](https://git.odit.services/lfk/kiosk/commit/93bf436e94ad492a1bc1acdaa8958ef9e79e3a73)
- fix(a11y): input borders [`fffe290`](https://git.odit.services/lfk/kiosk/commit/fffe29036045ead825b54f44b38d824d09f039b8)
- Added lfk client [`f927cc9`](https://git.odit.services/lfk/kiosk/commit/f927cc916b07e908c3bd18ee7d16d82cb41ca972)
- Added license [`39fc381`](https://git.odit.services/lfk/kiosk/commit/39fc381343de6d2be4f8e5aa53c9d986f05a99bb)
- Added login error [`8b086c5`](https://git.odit.services/lfk/kiosk/commit/8b086c5aa850f423b19a54499ae636937ff33387)
- Updated typing [`d68e88e`](https://git.odit.services/lfk/kiosk/commit/d68e88ec9a890e418070f0698d5da6d7c75cc0c1)
- Moved barcode height to main config [`3d110e8`](https://git.odit.services/lfk/kiosk/commit/3d110e8f48b9a3df8dba462e2ee71125e47aa875)
- Open footer links in new tab [`c1400c0`](https://git.odit.services/lfk/kiosk/commit/c1400c0120a1b3b0e4358b3c6bb6ac38f4f01e35)
- Moved config into call [`e25aaf3`](https://git.odit.services/lfk/kiosk/commit/e25aaf3e5e0c2ed52413b8289c7d5bdd5b8a54f1)
- Added sample env [`f6dd25c`](https://git.odit.services/lfk/kiosk/commit/f6dd25c988a67b4d826410fea59473ca8d0b718f)
- typo [`22be683`](https://git.odit.services/lfk/kiosk/commit/22be68311baaa3d866106603deb6c7ae3a8ab09b)
- updated release hook [`5d7a25e`](https://git.odit.services/lfk/kiosk/commit/5d7a25e54ffe454ce4e61876acaae7b1a34df3eb)
- pnpx -> npx [`16deab5`](https://git.odit.services/lfk/kiosk/commit/16deab5308b7245860d42b8f49aba0706595d95f)
- release from main [`c0a39bd`](https://git.odit.services/lfk/kiosk/commit/c0a39bdabe9a597823fd28cee059b690bc7e34c3)
- fix(registration): typo [`1c5e246`](https://git.odit.services/lfk/kiosk/commit/1c5e2460958919951968c8c20eb69929cfba81d5)
- pinned dependency [`910fa38`](https://git.odit.services/lfk/kiosk/commit/910fa3867b32918e3791642526d414268049ed38)
- Hide error on successfull signin [`f98a4fc`](https://git.odit.services/lfk/kiosk/commit/f98a4fc2b1a34343353fdc361ef08e92ea046ced)

View File

@@ -1,38 +1,27 @@
# create-svelte
# @lfk/kiosk
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
## Overview 👀
This is a simple kiosk style register form for the LfK runnersystem.
The basic idea is:
1. Create a runnersystem user with only `RUNNER:CREATE` permissions.
2. Login with this user under `/login`
3. Runners can register via their firstnam and lastname
4. The kiosk creates the runner via the backend and shows their id, firstname, lastname and a barcode containing their id
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
## Development 🛠️
```
pnpm i
pnpm dev --open
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
## Build 🚀
```
pnpm i
pnpm build
```
## Building
To create a production version of your app:
```bash
npm run build
## Docker 🐳
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
docker build .
docker-compose up
```

10307
licenses.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,26 @@
{
"name": "@lfk/kiosk",
"version": "0.0.1",
"version": "0.3.0",
"private": false,
"license": "MIT",
"repository": "https://git.odit.services/lfk/kiosk",
"author": {
"name": "ODIT.Services",
"email": "info@odit.services",
"url": "https://odit.services"
},
"contributors": [
{
"name": "Philipp Dormann",
"email": "philipp@philippdormann.de",
"url": "https://philippdormann.de"
},
{
"name": "Nicolai Ort",
"email": "info@nicolai-ort.com",
"url": "https://nicolai-ort.com"
}
],
"scripts": {
"dev": "vite dev",
"build": "vite build",
@@ -17,6 +36,7 @@
"@odit/license-exporter": "0.0.12",
"@sveltejs/adapter-static": "2.0.2",
"@sveltejs/kit": "1.5.0",
"@types/bwip-js": "^3.2.0",
"@typescript-eslint/eslint-plugin": "5.45.0",
"@typescript-eslint/parser": "5.45.0",
"auto-changelog": "2.4.0",
@@ -39,7 +59,7 @@
},
"type": "module",
"dependencies": {
"@odit/lfk-client-js": "^1.0.1",
"@odit/lfk-client-js": "1.0.1",
"bwip-js": "3.4.0"
},
"release-it": {
@@ -47,7 +67,7 @@
"commit": true,
"requireCleanWorkingDir": false,
"commitMessage": "🚀Bumped version to ${version}",
"requireBranch": "dev",
"requireBranch": "main",
"push": true,
"tag": true,
"tagName": null,
@@ -57,7 +77,7 @@
"publish": false
},
"hooks": {
"after:bump": "pnpx auto-changelog --commit-limit false -p -u --hide-credit && pnpm licenses:export && git add CHANGELOG.md licenses.md"
"after:bump": "npx auto-changelog --commit-limit false -p -u --hide-credit && npm run license:export && git add CHANGELOG.md && git add licenses.md"
}
},
"volta": {
@@ -66,4 +86,4 @@
"engines": {
"pnpm": "8"
}
}
}

15
pnpm-lock.yaml generated
View File

@@ -2,7 +2,7 @@ lockfileVersion: '6.0'
dependencies:
'@odit/lfk-client-js':
specifier: ^1.0.1
specifier: 1.0.1
version: 1.0.1
bwip-js:
specifier: 3.4.0
@@ -18,6 +18,9 @@ devDependencies:
'@sveltejs/kit':
specifier: 1.5.0
version: 1.5.0(svelte@3.54.0)(vite@4.2.0)
'@types/bwip-js':
specifier: ^3.2.0
version: 3.2.0
'@typescript-eslint/eslint-plugin':
specifier: 5.45.0
version: 5.45.0(@typescript-eslint/parser@5.45.0)(eslint@8.28.0)(typescript@5.0.4)
@@ -603,6 +606,12 @@ packages:
engines: {node: '>= 6'}
dev: true
/@types/bwip-js@3.2.0:
resolution: {integrity: sha512-UNcuIorD+Cw+jlJm9YExx0fkUeR0z3a6bidcgvK13GmBshShLv6NTWkuzklBeFl+90ZxBvJx1CHkDFNptSCbAA==}
dependencies:
'@types/node': 18.15.11
dev: true
/@types/cookie@0.5.1:
resolution: {integrity: sha512-COUnqfB2+ckwXXSFInsFdOAWQzCCx+a5hq2ruyj+Vjund94RJQd4LG2u9hnvJrTgunKAaax7ancBYlDrNYxA0g==}
dev: true
@@ -615,6 +624,10 @@ packages:
resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
dev: true
/@types/node@18.15.11:
resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==}
dev: true
/@types/pug@2.0.6:
resolution: {integrity: sha512-SnHmG9wN1UVmagJOnyo/qkk0Z7gejYxOYYmaAwr5u2yFYfsupN3sg10kyzN8Hep/2zbHxCnsumxOoRIRMBwKCg==}
dev: true

View File

@@ -5,7 +5,7 @@ type UserState = {
access_token: string;
refresh_token: string;
isLoggedIn: boolean;
refreshInterval: number
refreshInterval: NodeJS.Timer | undefined
};
const userStore = () => {
@@ -13,7 +13,7 @@ const userStore = () => {
access_token: '',
refresh_token: '',
isLoggedIn: false,
refreshInterval: 0
refreshInterval: undefined
};
const { subscribe, set, update } = writable(state);
@@ -75,7 +75,7 @@ const userStore = () => {
state.isLoggedIn = false;
state.access_token = '';
state.refresh_token = '';
state.refreshInterval = 0;
state.refreshInterval = undefined;
localStorage.clear();
return state;
});

View File

@@ -53,7 +53,7 @@
type="username"
id="username"
name="username"
class="py-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400"
class="py-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 border"
required
aria-describedby="username-error"
/>
@@ -72,7 +72,7 @@
type="password"
id="password"
name="password"
class="py-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400"
class="py-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 border"
required
aria-describedby="password-error"
/>

View File

@@ -4,7 +4,6 @@
$: firstname = '';
$: lastname = '';
$: accepted = false;
$: showResult = false;
$: showError = false;
@@ -27,7 +26,6 @@
}
firstname = '';
lastname = '';
accepted = false;
}
function textToBase64Barcode(text: string, is_qrcode: boolean) {
@@ -36,18 +34,15 @@
if (is_qrcode) {
bcid = 'qrcode';
}
let codeconfig = {
bwipjs.toCanvas(canvas, {
bcid,
text: `${text}`,
scale: 10,
includetext: true,
textxalign: 'center',
backgroundcolor: 'ffffff'
};
if (bcid == 'code128') {
codeconfig.height = 10;
}
bwipjs.toCanvas(canvas, codeconfig);
backgroundcolor: 'ffffff',
height: 10
});
return canvas.toDataURL('image/png');
}
</script>
@@ -58,14 +53,13 @@
class="mt-7 bg-white border border-gray-200 rounded-xl shadow-sm dark:bg-gray-800 dark:border-gray-700"
>
<div class="p-4 sm:p-7">
<div class="text-center">
<h1 class="block text-2xl font-bold text-gray-800 dark:text-white">Registrierung</h1>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">Melde dich für den LfK an</p>
</div>
<div class="mt-5">
<!-- Form -->
{#if !showResult}
<div class="text-center">
<h1 class="block text-2xl font-bold text-gray-800 dark:text-white">Registrierung</h1>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">Melde dich für den LfK an</p>
</div>
<form on:submit|preventDefault={register}>
<div class="grid gap-y-4">
<!-- Form Group -->
@@ -76,7 +70,7 @@
type="text"
id="firstname"
name="firstname"
class="py-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400"
class="py-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 border"
required
bind:value={firstname}
aria-describedby="firstname-error"
@@ -117,7 +111,7 @@
type="lastname"
id="lastname"
name="lastname"
class="py-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400"
class="py-3 px-4 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 border"
required
aria-describedby="lastname-error"
bind:value={lastname}
@@ -150,37 +144,9 @@
</div>
<!-- End Form Group -->
<!-- Checkbox -->
<div
class="flex items-center"
on:click={() => {
accepted = !accepted;
}}
on:keydown={() => {}}
>
<div class="flex">
<input
id="remember-me"
name="remember-me"
type="checkbox"
bind:checked={accepted}
class="shrink-0 mt-0.5 border-gray-200 rounded text-blue-600 pointer-events-none focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800"
/>
</div>
<div class="ml-3">
<label for="remember-me" class="text-sm dark:text-white"
>Ich habe die <a
class="text-blue-600 decoration-2 hover:underline font-medium"
href="https://lauf-fuer-kaya.de/datenschutz">Datenschutzerklärung</a
> gelesen und aktzeptiert</label
>
</div>
</div>
<!-- End Checkbox -->
<button
type="submit"
disabled={!firstname || !lastname || !accepted}
disabled={!firstname || !lastname}
class="py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold disabled:opacity-70 bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800"
>Anmelden</button
>
@@ -188,18 +154,17 @@
</form>
<!-- End Form -->
{:else}
<div class="mb-2">
<h3 class="text-xl font-semibold text-center dark:text-white">Läuferdaten</h3>
<p class="text-lg dark:text-white">ID: {response.id}</p>
<p class="text-lg dark:text-white">Vorname: {response.firstname}</p>
<p class="text-lg dark:text-white">Nachname: {response.lastname}</p>
<div class="mb-2 text-center">
<h3 class="text-2xl font-semibold dark:text-white">
{response.firstname}
{response.lastname}
</h3>
</div>
<div class="mb-2 text-center">
<h3 class="text-xl font-semibold dark:text-white">Läufercode</h3>
<img
class="w-full md:w-auto mb-2 mx-auto bg-white p-4"
alt="Runnerid"
alt="runner id"
src={textToBase64Barcode(response.id.toString(), false)}
/>
</div>