GitHub - MasterYoav/WorkLog: WorkLog is a Web app that helps small businesses track workers attendance and projects with GPS-based clock-in/out, shift management, and timesheets.

WorkLog Logo

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 punches via 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 (projects table)
  • 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

  1. Install dependencies

  2. Configure environment

    cp .env.example .env
    # fill in real Supabase values
  3. Start development server

  4. 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.apk
  • WorkLog-release-unsigned.apk

Note: release-unsigned is 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

  1. Install Expo Go from Play Store.
  2. Run npx expo start on your Mac.
  3. 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:
    adb reverse tcp:8081 tcp:8081
    or start Expo in tunnel mode:

πŸ“ License

MIT Β© 2025 WorkLog Team