feat: implement StaySense MVP backend, frontend, imports, and deployment docs

This commit is contained in:
Oliver 2026-02-15 13:08:56 +01:00
commit 902988276c
No known key found for this signature in database
24 changed files with 2536 additions and 0 deletions

View file

@ -0,0 +1,18 @@
server {
listen 80;
server_name staysense.example.com;
root /opt/staysense/src;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://127.0.0.1:8787/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

View file

@ -0,0 +1,18 @@
[Unit]
Description=StaySense API Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/opt/staysense/backend
Environment=STAYSENSE_SERVER_SALT=CHANGE_ME
Environment=STAYSENSE_SIGNAL_COOLDOWN_HOURS=24
ExecStart=/usr/bin/python3 /opt/staysense/backend/server.py
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=StaySense Data Import Job
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
User=www-data
Group=www-data
WorkingDirectory=/opt/staysense/backend
ExecStart=/usr/bin/python3 /opt/staysense/backend/run_import_jobs.py --config /opt/staysense/docs/open_data_sources.json --prune-legacy

View file

@ -0,0 +1,11 @@
[Unit]
Description=Run StaySense import every 6 hours
[Timer]
OnBootSec=5min
OnUnitActiveSec=6h
Unit=staysense-import.service
Persistent=true
[Install]
WantedBy=timers.target