Expo React Native app for personal office-hour tracking with:
- Email/password auth
- PocketBase cloud sync (Android + iOS for same user)
- Leave tracking (CL/PL)
- Profile setup
- Animated login/signup screens (Lottie)
Use Node 24:
nvm install 24
nvm use 24npm installUse Admin UI: http://127.0.0.1:8090/_/
- Sign in to PocketBase Admin.
- Go to
Collections->+ New collection. - Create auth collection
users:- Type:
Auth - Name:
users - Keep default auth fields (
email,password)
- Type:
- In
users->Fieldsadd:name(text, required, min 2, max 80)timezone(text, required, defaultAsia/Kolkata, max 80)
- In
users->API Rulesset:- List:
id = @request.auth.id - View:
id = @request.auth.id - Update:
id = @request.auth.id - Delete:
id = @request.auth.id - Create can remain default for signup from app.
- List:
- Create
user_statecollection:- Type:
Base - Name:
user_state
- Type:
- In
user_state->Fieldsadd:user(relation ->users, max select 1, required, unique)payload(JSON, required)
- In
user_state->API Rulesset all to:- List:
@request.auth.id != "" && user = @request.auth.id - View:
@request.auth.id != "" && user = @request.auth.id - Create:
@request.auth.id != "" && user = @request.auth.id - Update:
@request.auth.id != "" && user = @request.auth.id - Delete:
@request.auth.id != "" && user = @request.auth.id
- List:
- Save and test:
- Sign up from app on Android.
- Sign in with same account on iOS.
- Add one leave/session on one device and verify it appears on the other device after sync.
This setup keeps data private per user and has no manager/HR approval flow.
You can keep a reusable schema export inside this repo:
- Folder:
pocketbase/ - Guide:
pocketbase/README.md - Placeholder:
pocketbase/collections.template.json - Expected import file name:
pocketbase/pb_schema.json
Once pb_schema.json exists, a new user can directly import from:
Settings -> Import collections -> Load from JSON file.
Create .env:
EXPO_PUBLIC_POCKETBASE_URL=http://127.0.0.1:8090For physical Android/iOS devices, replace 127.0.0.1 with your computer LAN IP (example 192.168.1.10) because phone localhost is not your laptop localhost.
Optional animation overrides:
EXPO_PUBLIC_LOGIN_LOTTIE_URL=https://...
EXPO_PUBLIC_SIGNUP_LOTTIE_URL=https://...Auth screen defaults use LottieFiles CDN URLs configured in App.js:
- Login animation source page: https://lottiefiles.com/free-animation/login-QFhJRgQyEc
- Sign up animation source page: https://lottiefiles.com/free-animation/sign-up-YgekaOmwhu
If you want exact downloadable JSON from these pages, download and replace via env URLs above.
npm run startValidation/privacy-focused tests:
npm testCovers:
- Email and password validation
- Leave date/range validation
- Input sanitization
- Sync-state normalization and conflict choice
- Password is never stored in local AsyncStorage.
- Auth token/model is stored in
expo-secure-store. - Tracker data cache is per-user key.
- Cloud access depends on strict per-user PocketBase rules above.
- Sync conflict resolution uses PocketBase built-in
updatedtimestamp.