Added weather api preparations and entrypoint for dockerfile

This commit is contained in:
Joren de Graaf
2026-08-12 14:46:12 +02:00
parent 6a20cb80ca
commit 4aaafa7493
14 changed files with 319 additions and 14 deletions
+5
View File
@@ -37,3 +37,8 @@ RUN composer run-script post-install-cmd \
&& chown -R www-data:www-data var
EXPOSE 8080
COPY docker/entrypoint.sh /usr/local/bin/entrypoint
RUN chmod +x /usr/local/bin/entrypoint
ENTRYPOINT ["entrypoint"]
+12 -3
View File
@@ -5,7 +5,12 @@ window.htmx = htmx;
document.addEventListener('click', (event) => {
const button = event.target.closest('[data-weather-location]');
if (!button || !navigator.geolocation) return;
if (!button) return;
const status = document.querySelector('[data-weather-location-status]');
if (!navigator.geolocation) {
if (status) status.textContent = 'Your browser does not support location services.';
return;
}
navigator.geolocation.getCurrentPosition(async ({coords}) => {
const payload = new URLSearchParams({
@@ -18,8 +23,12 @@ document.addEventListener('click', (event) => {
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: payload,
});
if (response.ok) {
window.location.reload();
if (!response.ok) {
if (status) status.textContent = 'Location could not be saved.';
return;
}
window.location.reload();
}, () => {
if (status) status.textContent = 'Location permission was not granted.';
});
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

+19 -1
View File
@@ -15,7 +15,20 @@ body {
--container-max: 1280px;
--container-gutter: clamp(1rem, 3vw, 2rem);
}
header {
display: flex;
align-items: center;
}
.logo {
height: 60px;
width: auto;
}
.mascots {
height: 150px;
width: auto;
margin-left: auto;
}
.container {
width: min(100% - (2 * var(--container-gutter)), var(--container-max));
margin-inline: auto;
@@ -158,12 +171,17 @@ body {
flex-direction: column;
}
}
.weather-forecast {
font-size: 2em;
margin-bottom: 50px;
color: #fff;
}
.task-composer {
background-color: #fff;
border-radius: 10px;
margin-bottom: 50px;
flex-direction: column;
form.task-composer__form {
width: 100%;
max-width: unset;
+3 -1
View File
@@ -27,7 +27,8 @@
"allow-plugins": {
"php-http/discovery": true,
"symfony/flex": true,
"symfony/runtime": true
"symfony/runtime": true,
"phpdocumentor/shim": true
},
"bump-after-update": true,
"sort-packages": true
@@ -77,6 +78,7 @@
}
},
"require-dev": {
"phpdocumentor/shim": "*",
"symfony/maker-bundle": "^1.67",
"symfony/stopwatch": "8.1.*",
"symfony/web-profiler-bundle": "8.1.*"
Generated
+251 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "10ff9f83f3f6050f5acfb976e4ebe9e8",
"content-hash": "2d5ff7449d92b622be5a4168fbc982b1",
"packages": [
{
"name": "doctrine/collections",
@@ -5758,6 +5758,256 @@
},
"time": "2026-07-04T14:30:18+00:00"
},
{
"name": "phar-io/composer-distributor",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/phar-io/composer-distributor.git",
"reference": "dd7d936290b2a42b0c64bfe08090b5c597c280c9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/composer-distributor/zipball/dd7d936290b2a42b0c64bfe08090b5c597c280c9",
"reference": "dd7d936290b2a42b0c64bfe08090b5c597c280c9",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1 || ^2.0",
"ext-dom": "*",
"ext-libxml": "*",
"phar-io/filesystem": "^2.0",
"phar-io/gnupg": "^1.0",
"php": "^7.3 || ^8.0"
},
"require-dev": {
"composer/composer": "^2.0",
"phpunit/phpunit": "^9.4"
},
"type": "library",
"autoload": {
"psr-4": {
"PharIo\\ComposerDistributor\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Andreas Heigl",
"email": "andreas@heigl.org",
"role": "Developer"
},
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
},
{
"name": "Sebastian Feldmann",
"email": "sf@sebastian-feldmann.info",
"role": "Developer"
}
],
"description": "Base Code for a composer plugin that installs PHAR-files",
"homepage": "https://phar.io",
"keywords": [
"bin",
"binary",
"composer",
"distribute",
"phar",
"phive"
],
"support": {
"issues": "https://github.com/phar-io/composer-distributor/issues",
"source": "https://github.com/phar-io/composer-distributor/tree/1.0.2"
},
"funding": [
{
"url": "https://phar.io",
"type": "other"
}
],
"time": "2023-05-31T17:05:49+00:00"
},
{
"name": "phar-io/executor",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/executor.git",
"reference": "5bfb7400224a0c1cf83343660af85c7f5a073473"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/executor/zipball/5bfb7400224a0c1cf83343660af85c7f5a073473",
"reference": "5bfb7400224a0c1cf83343660af85c7f5a073473",
"shasum": ""
},
"require": {
"phar-io/filesystem": "^2.0",
"php": "^7.2||^8.0"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
},
{
"name": "Sebastian Heuer",
"email": "sebastian@phpeople.de",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/phar-io/executor/issues",
"source": "https://github.com/phar-io/executor/tree/1.0.1"
},
"time": "2020-11-30T10:53:57+00:00"
},
{
"name": "phar-io/filesystem",
"version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/filesystem.git",
"reference": "222e3ea432262a05706b7066697c21257664d9d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/filesystem/zipball/222e3ea432262a05706b7066697c21257664d9d1",
"reference": "222e3ea432262a05706b7066697c21257664d9d1",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
},
{
"name": "Sebastian Heuer",
"email": "sebastian@phpeople.de",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/phar-io/filesystem/issues",
"source": "https://github.com/phar-io/filesystem/tree/2.0.1"
},
"time": "2020-11-30T10:16:22+00:00"
},
{
"name": "phar-io/gnupg",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/phar-io/gnupg.git",
"reference": "ed8ab1740ac4e9db99500e7252911f2821357093"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/gnupg/zipball/ed8ab1740ac4e9db99500e7252911f2821357093",
"reference": "ed8ab1740ac4e9db99500e7252911f2821357093",
"shasum": ""
},
"require": {
"phar-io/executor": "^1.0",
"phar-io/filesystem": "^2.0",
"php": "^7.2||^8.0"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Arne Blankerts",
"email": "arne@blankerts.de",
"role": "Developer"
},
{
"name": "Sebastian Heuer",
"email": "sebastian@phpeople.de",
"role": "Developer"
}
],
"description": "Thin GnuPG wrapper class around the gnupg binary, mimicking the pecl/gnupg api",
"support": {
"issues": "https://github.com/phar-io/gnupg/issues",
"source": "https://github.com/phar-io/gnupg/tree/1.0.3"
},
"time": "2024-08-22T20:45:57+00:00"
},
{
"name": "phpdocumentor/shim",
"version": "v3.10.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/shim.git",
"reference": "a577ecbee284c51e38a4c41ceeff7fbd665b7689"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/shim/zipball/a577ecbee284c51e38a4c41ceeff7fbd665b7689",
"reference": "a577ecbee284c51e38a4c41ceeff7fbd665b7689",
"shasum": ""
},
"require": {
"composer-plugin-api": "^2.0",
"phar-io/composer-distributor": "^1.0"
},
"type": "composer-plugin",
"extra": {
"class": "phpDocumentor\\Plugin"
},
"autoload": {
"psr-4": {
"phpDocumentor\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"support": {
"source": "https://github.com/phpDocumentor/shim/tree/v3.10.0"
},
"time": "2026-05-13T19:40:19+00:00"
},
{
"name": "symfony/maker-bundle",
"version": "v1.67.0",
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -e
php bin/console doctrine:migrations:migrate --no-interaction
exec "$@"
+15
View File
@@ -6,6 +6,7 @@
"": {
"dependencies": {
"@fontsource/noto-sans": "^5.3.0",
"core-js": "^3.50.0",
"htmx.org": "^2.0.10",
"material-symbols": "^0.45.10"
},
@@ -2769,6 +2770,20 @@
"license": "MIT",
"peer": true
},
"node_modules/core-js": {
"version": "3.50.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.50.0.tgz",
"integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==",
"hasInstallScript": true,
"license": "MIT",
"engines": {
"node": "*"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/core-js-compat": {
"version": "3.49.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.49.0.tgz",
+1
View File
@@ -8,6 +8,7 @@
},
"dependencies": {
"@fontsource/noto-sans": "^5.3.0",
"core-js": "^3.50.0",
"htmx.org": "^2.0.10",
"material-symbols": "^0.45.10"
},
+1
View File
@@ -20,6 +20,7 @@
{% endif %}
</head>
<body>
<header><img src="{{ asset('build/images/logo.png') }}" class="logo" alt="Logo">TaskNest <img src="{{ asset('build/images/TaskNestMascots.png') }}" class="mascots" alt="Mascots"></header>
{% block body %}{% endblock %}
</body>
</html>
-2
View File
@@ -26,8 +26,6 @@
<div>{{ form_row(form.scheduledFor) }}</div>
<div>{{ form_row(form.isOutdoor) }}</div>
<div>{{ form_row(form.weatherProfile) }}</div>
<div>{{ form_row(form.isOutdoor) }}</div>
<div>{{ form_row(form.weatherProfile) }}</div>
<div class="task-composer__repeat">
{{ form_widget(form.isRecurring, {attr: {class: 'task-composer__repeat-input'}}) }}
{{ form_label(form.isRecurring) }}
+2 -1
View File
@@ -25,10 +25,11 @@
{{ has_saved_location ? 'Update weather location' : 'Use my location for weather' }}
</button>
<p class="weather-location__status" data-weather-location-status aria-live="polite"></p>
{% if weather_forecast %}
{{ include('task/_weather_forecast.html.twig', {forecast: weather_forecast}) }}
{{ include('task/_task_composer.html.twig', {form: form}) }}
{% endif %}
{{ include('task/_task_composer.html.twig', {form: form}) }}
{{ include('task/_task_recommendations.html.twig', {
tasks: tasks,
+4 -5
View File
@@ -21,6 +21,10 @@ Encore
* and one CSS file (e.g. app.css) if your JavaScript imports CSS.
*/
.addEntry('app', './assets/app.js')
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[ext]',
})
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
.splitEntryChunks()
@@ -53,11 +57,6 @@ Encore
// options.minify = MinimizerPlugin.lightningCssMinify;
// })
// configure Babel
.configureBabel((config) => {
config.plugins.push(['polyfill-corejs3', { method: 'usage-global', version: '3.49' }]);
})
// enables Sass/SCSS support
.enableSassLoader()