QTili
git pull https://github.com/devtgit/qtili-service.gitInstall
- Install nodejs - https://nodejs.org/en/download
- Install pnpm - https://pnpm.io/installation
Dev
Web
cd packages/qtili-web
cp .env.template .env # only first time, fill created file with relevant variables
pnpm install # only first time or after dependencies updates
pnpm devAdmin
cd packages/qtili-admin
cp .env.template .env # only first time, fill created file with relevant variables
pnpm install # only first time or after dependencies updates
pnpm devEmulators (local development, backend)
In case you want to run local firebase emulators instead of connecting to cloud firebase project.
Install Firebase CLI - https://firebase.google.com/docs/cli#install-cli-mac-linux Install Java > 11 - https://www.oracle.com/java/technologies/downloads/#java17
pnpm emulatorsFirebase Cheatsheet
firebase install- setup firebase-toolsfirebase login- login into firebase accountfirebase deploy- to deploy built projectfirebase deploy --only firestore:rulesfirebase deploy --only hostingfirebase serve --only hosting:qtili-admin- deploy certain appfirebase target:apply hosting qtili-admin admin-qtili-dev2- assign hosting target to appfirebase functions:config:set service.value="value"firebase functions:config:get > .runtimeconfig.json- to copy remote config to local for emulate functions locallyfirebase emulators:start --import "./tmp-imported-firestore-data" --export-on-exit --only "functions,firestore,auth,database,storage"firebase use --add- add projectfirebase use project_name- add projectfirebase deploy -P project_name- deploy projectfirebase hosting:channel:deploy preview_channel_name- deploy preview channelfirebase functions:log- functions log
How to set up storage cors (gcloud)
gcloud auth login # auth
gcloud storage buckets describe gs://qtili-dev2.appspot.com --format="default(cors)" # get cors config
gcloud storage buckets update gs://qtili-dev2.appspot.com --cors-file=cors.json # set cors configcors.json example:
[
{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]Expo
npx create-expo-app QTili # for now TS can be set up manuallyxcrun simctl list devices- check available simulatorsnpm run ios -- --simulator="iPhone 11"- run in specific simulatornpm install --global expo-cliexpo install react-native-webviewpnpm dev --host 0.0.0.0- make web build available in local network
React Native Web View - https://blog.logrocket.com/react-native-webview-a-complete-guide/ SafeAreView different colors - https://medium.com/reactbrasil/react-native-set-different-colors-on-top-and-bottom-in-safeareaview-component-f008823483f3