chore: scaffold Expo project with types and utils

This commit is contained in:
Eddy de Vink 2026-06-27 22:39:55 +02:00
commit 6c0b33f86a
5 changed files with 6474 additions and 1462 deletions

View file

@ -20,6 +20,10 @@
}, },
"web": { "web": {
"favicon": "./assets/favicon.png" "favicon": "./assets/favicon.png"
} },
"plugins": [
"expo-sqlite",
"expo-secure-store"
]
} }
} }

4960
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -3,20 +3,34 @@
"version": "1.0.0", "version": "1.0.0",
"main": "index.ts", "main": "index.ts",
"dependencies": { "dependencies": {
"@react-navigation/native": "^7.3.4",
"@react-navigation/native-stack": "^7.17.6",
"expo": "~56.0.12", "expo": "~56.0.12",
"expo-secure-store": "~56.0.4",
"expo-sqlite": "~56.0.5",
"expo-status-bar": "~56.0.4", "expo-status-bar": "~56.0.4",
"react": "19.2.3", "react": "19.2.3",
"react-native": "0.85.3" "react-native": "0.85.3",
"react-native-chart-kit": "^7.0.1",
"react-native-safe-area-context": "~5.7.0",
"react-native-screens": "4.25.2",
"react-native-svg": "15.15.4"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^30.0.0",
"@types/react": "~19.2.2", "@types/react": "~19.2.2",
"jest-expo": "^56.0.5",
"typescript": "~6.0.3" "typescript": "~6.0.3"
}, },
"scripts": { "scripts": {
"start": "expo start", "start": "expo start",
"android": "expo start --android", "android": "expo start --android",
"ios": "expo start --ios", "ios": "expo start --ios",
"web": "expo start --web" "web": "expo start --web",
"test": "jest"
},
"jest": {
"preset": "jest-expo"
}, },
"private": true "private": true
} }

23
src/types.ts Normal file
View file

@ -0,0 +1,23 @@
export type SyncStatus = 'local' | 'synced'
export type Measurement = {
id: string
weight: number
bmi: number
bodyFatPercentage: number
fatMass: number
musclePercentage: number
muscleMass: number
visceralFat: number
bmr: number
measuredAt: string
createdAt: string
updatedAt: string
syncStatus: SyncStatus
}
export type WebDAVConfig = {
url: string
username: string
password: string
}

13
src/utils/uuid.ts Normal file
View file

@ -0,0 +1,13 @@
export function generateId(): string {
const chars = '0123456789abcdef'
const segments = [8, 4, 4, 4, 12]
return segments
.map(len => {
let s = ''
for (let i = 0; i < len; i++) {
s += chars[Math.floor(Math.random() * 16)]
}
return s
})
.join('-')
}