3 Commits

Author SHA1 Message Date
Space-Banane
60909913a5 Add Docker configuration and entrypoint script for Nginx web service
All checks were successful
Build App / build-android (push) Successful in 7m6s
Build App / build-web (push) Successful in 40s
Build App / release (push) Successful in 31s
2026-03-10 20:44:00 +01:00
Space-Banane
cbf7d08f6a Refactor CI workflow to separate Android and web build jobs, and enhance artifact handling
Some checks failed
Build App / build-web (push) Has been cancelled
Build App / release (push) Has been cancelled
Build App / build-android (push) Has been cancelled
2026-03-10 20:38:55 +01:00
Space-Banane
ad3bd9e5dc Add project guidelines and README for app overview and usage instructions
All checks were successful
Build App / build (push) Successful in 7m8s
2026-03-10 19:05:29 +01:00
5 changed files with 179 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ on:
- main
jobs:
build:
build-android:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
@@ -48,7 +48,6 @@ jobs:
--platform=android \
--profile=preview
# Neuer Schritt: Rename das Binary, damit es wie eine echte App aussieht
- name: 📝 Rename build to APK
run: mv app-build app-release.apk
@@ -59,6 +58,62 @@ jobs:
path: app-release.apk
if-no-files-found: error
build-web:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 22
- name: 🏗 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
token: ${{ secrets.EXPO_TOKEN }}
eas-version: latest
packager: pnpm
- name: 📦 Install dependencies
run: pnpm install
- name: 👷 Build web
run: npx expo export --platform web
- name: 📦 Zip dist
run: cd dist && zip -r ../dist.zip .
- name: 📤 Upload build artifact
uses: actions/upload-artifact@v3
with:
name: web-build
path: dist.zip
if-no-files-found: error
release:
runs-on: ubuntu-latest
needs: [build-android, build-web]
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 📥 Download Android artifact
uses: actions/download-artifact@v3
with:
name: android-preview-build
- name: 📥 Download Web artifact
uses: actions/download-artifact@v3
with:
name: web-build
- name: 🏷 Create tag
run: |
TAG="build-$(git rev-parse --short HEAD)"
@@ -71,7 +126,9 @@ jobs:
with:
tag_name: ${{ env.RELEASE_TAG }}
name: ${{ env.RELEASE_TAG }}
files: app-release.apk
files: |
app-release.apk
dist.zip
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

45
.github/copilot-instructions.md vendored Normal file
View File

@@ -0,0 +1,45 @@
# Project Guidelines
## Code Style
- Keep components as functional React components and use hooks-based state.
- Follow existing naming and structure in `src/screens` and `src/components`:
- Screen files: `*Screen.js`
- Shared UI pieces: `src/components/*.js`
- Keep styling centralized in `src/styles.js` via `createStyles()` and use theme-driven inline color overrides in screens/components.
- Reuse `getTheme(darkMode, pinkMode)` from `src/theme.js` for color values; do not hardcode alternate palettes in individual screens.
## Architecture
- Root orchestration lives in `App.js`:
- App-level state includes current screen, focus mode, theme toggles, and timer/countdown state.
- Screen switching is controlled by the `screen` state (`home`, `timeuntil`, `timer`).
- Screen responsibilities:
- `HomeScreen`: mode selection and top controls.
- `TimeUntilScreen`: target clock-time countdown flow.
- `TimerScreen`: duration countdown flow.
- `FocusScreen`: minimal fullscreen countdown UI.
- Shared presentational components:
- `TopControls`: dark/pink/fullscreen/focus controls.
- `CountdownRow`: reusable HH:MM:SS display.
## Build And Run
- Install dependencies: `npm install`
- Start dev server: `npm start`
- Run on Android: `npm run android`
- Run on iOS: `npm run ios`
- Run on web: `npm run web`
- EAS builds use `eas.json` profiles (`development`, `preview`, `production`).
## Conventions
- Keep timer/countdown behavior in `App.js` unless intentionally refactoring architecture.
- Preserve current time behavior:
- `now` updates every second with `setInterval`.
- Time-until target is based on local device time and rolls to next day when target time has passed.
- Maintain platform guards:
- Web-only fullscreen uses `document.fullscreenElement` APIs.
- Android hardware back behavior is handled in `App.js` and should keep focus/screen fallback behavior.
- For countdown display, continue using `CountdownRow` and 2-digit padded units for consistency.
## Pitfalls
- This project has no test scripts configured; do not claim tests were run unless you add and run them.
- Be careful with web-only globals (`document`) and keep `Platform.OS` guards.
- Avoid introducing timezone assumptions without explicit product requirements; current logic is local-time based.

37
README.md Normal file
View File

@@ -0,0 +1,37 @@
# Time Until
A small Expo React Native app with two countdown modes:
- **Time Until**: count down to a target clock time (local device time)
- **Timer**: count down from a duration you enter (hours/minutes/seconds)
It also includes a minimal focus view, dark mode, and a pink accent theme.
## Download
You can download ready-to-use apk builds from the Releases page:
https://gitea.reversed.dev/space/time-until/releases
## How It Works
- Main app state and countdown logic live in `App.js`.
- Screen components are in `src/screens`.
- Shared UI components are in `src/components`.
- Theme + styling are managed via `src/theme.js` and `src/styles.js`.
### Time Until Mode
- Enter hour/minute in 24-hour format.
- If the selected time has already passed today, it rolls to the next day.
### Timer Mode
- Enter a duration in hours/minutes/seconds.
- Supports start, pause, resume, and reset.
## Notes
- Time calculations are based on local device time.
- Web fullscreen uses browser fullscreen APIs.
- No automated test scripts are currently configured in `package.json`.

8
docker-compose.yml Normal file
View File

@@ -0,0 +1,8 @@
services:
web:
image: nginx:alpine
ports:
- "45554:80"
volumes:
- ./entrypoint.sh:/entrypoint.sh:ro
entrypoint: ["/bin/sh", "/entrypoint.sh"]

29
entrypoint.sh Normal file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
set -e
WEBROOT="/usr/share/nginx/html"
GITEA_URL="https://gitea.reversed.dev"
GITEA_REPO="space/time-until"
echo "Fetching latest release"
RELEASE_JSON=$(wget -qO- \
"$GITEA_URL/api/v1/repos/$GITEA_REPO/releases/latest")
ASSET_URL=$(echo "$RELEASE_JSON" | sed -n 's/.*"browser_download_url" *: *"\([^"]*dist\.zip[^"]*\)".*/\1/p' | head -1)
if [ -z "$ASSET_URL" ]; then
echo "ERROR: No dist.zip found in latest release"
exit 1
fi
echo "Downloading $ASSET_URL ..."
wget -qO /tmp/dist.zip --header="$AUTH_HEADER" "$ASSET_URL"
echo "Extracting to $WEBROOT ..."
rm -rf "${WEBROOT:?}"/*
unzip -o /tmp/dist.zip -d "$WEBROOT"
rm /tmp/dist.zip
echo "Starting nginx ..."
exec nginx -g "daemon off;"