WorkLog Mobile
π± Cross-platform mobile app (React Native + Expo) for employers and workers to track work hours, manage projects, and handle attendance β all powered by Supabase.
π Version 1.0 β Official Release
Data (employers, workers, projects, punches) is synced with Supabase, while media files are stored locally on the device sandbox.
β¨ Features (v1.0)
π₯ Employer & Worker Accounts
- Separate sign-in and registration for employers and workers
- Automatic employer ID assignment (
employer_no) - Worker registration linked to an existing employer
- Password reset flow with clipboard copy
- Prevents duplicate IDs in the cloud (unique per table)
π Attendance Clock
- Employers can punch in/out from anywhere (location always logged)
- Real-time shift timer display
- Stored in Supabase table
punchesvia RPC calls - Location accuracy + haversine validation
- Offline punches queued and synced automatically
π· Worker Management
- View all workers and their total hours (calculated server-side)
- Each worker has an individual attendance policy:
- βFrom workplace onlyβ (default)
- βFrom anywhereβ
- Policy changes update instantly in Supabase (
workers.punch_mode) - Floating βMonthly Summaryβ button on workers page
π§± Projects
- Employers can create / view / delete projects
- Stored in Supabase (
projectstable) - Local fallback with offline cache
- Add media (photos, videos, files) β saved locally, not in the cloud
- Project details open in a centered modal card
- Delete confirmation dialog with Supabase policy check
π Theming
- Auto light/dark mode using
useColorScheme - Manual theme toggle (βοΈ / π) on login screen and personal info page
- All buttons styled consistently:
- π’ Green β main action (login / clock in)
- π΅ Blue β secondary actions (register / update)
- π΄ Red β destructive (delete / logout)
ποΈ Tech Stack
- Expo (React Native runtime)
- expo-router for file-based navigation
- Supabase for backend (Postgres + RLS + RPC)
- AsyncStorage for offline/local data
- expo-file-system for local project media
- expo-clipboard for password recovery
- TypeScript for full type safety
π Environment Variables
Create a .env file at the root (never commit real keys):
EXPO_PUBLIC_SUPABASE_URL="https://xxxx.supabase.co" EXPO_PUBLIC_SUPABASE_ANON_KEY="your-anon-key"
For CI/CD (EAS build):
Use Expo Secrets or GitHub Actions secrets to inject these values securely.
π Project Structure
WorkLog-mobile/
βββ app/
β βββ _layout.tsx # Root layout (theme, router)
β βββ auth.tsx # Worker login & registration
β βββ employer-auth.tsx # Employer login, registration, password reset
β βββ employer-home.tsx # Main employer panel (menu, clock, workers, projects)
β βββ employer-project.tsx # Project modal view + file/media upload + delete
β βββ employer-workers.tsx # Monthly summary per worker
βββ components/
β βββ WLLogo.tsx # Reusable large logo component
βββ src/
β βββ data/
β β βββ repo.ts # Supabase & offline repository logic
β βββ lib/
β β βββ supabase.ts # Supabase client
β β βββ location.ts # GPS + geocode helpers
β β βββ storage.ts # Local storage for media
βββ assets/
β βββ logo.png
βββ README.md
π Running Locally
-
Install dependencies
-
Configure environment
cp .env.example .env # fill in real Supabase values -
Start development server
-
Run verification + tests
npm run verify npm run test:cov
Security baseline and release-hardening checklist: docs/SECURITY_CHECKLIST.md.
π¦ Android APK Releases (GitHub)
APK files are published automatically on version tags via:
.github/workflows/release-apk.yml
Trigger a release
git tag v1.0.1 git push origin v1.0.1
The workflow will attach these artifacts to the GitHub Release:
WorkLog-debug.apkWorkLog-release-unsigned.apk
Note:
release-unsignedis not Play Store-ready by itself. For Play Store production, sign with your release keystore or use EAS signed builds.
π¦ Building (EAS)
eas build --platform ios eas build --platform android
Secrets are managed via Expo β Project β Secrets.
Ensure your .env is not committed to git.
π§© Supabase Setup Notes
To allow deleting projects directly from the app, make sure you add this policy:
alter table public.projects enable row level security; drop policy if exists projects_delete_all on public.projects; create policy projects_delete_all on public.projects for delete using (true);
If you prefer owner-based deletion:
create policy projects_delete_own on public.projects for delete using (auth.role() = 'authenticated' OR true) with check (true);
π§ͺ Testing Checklist (before release)
β
Register employer β verify appears in Supabase
β
Register worker β verify linked employer_no
β
Change punch policy β test from worker app
β
Clock-in/out β validate GPS stored
β
Create project β verify in DB
β
Delete project β ensure removed after SQL policy
β
Light/dark toggle β persists correctly
β
Logout β returns to login screen
π± Running on Android (Mac)
If Android Studio emulator fails to connect:
Option 1 β Expo Go on real Android phone
- Install Expo Go from Play Store.
- Run
npx expo starton your Mac. - Scan the QR code with the Android device (same Wi-Fi).
β Easiest and most reliable.
Option 2 β Android Emulator
- Open AVD from Android Studio (API 33+).
- In the Expo CLI window press:
- If bundler not loading, run:
or start Expo in tunnel mode:
adb reverse tcp:8081 tcp:8081
π License
MIT Β© 2025 WorkLog Team
