upd: pake env

Deskripsi:
- ganti app.json menjadi app.config.js agar bisa pake env
- membuat env
- ganti url pake env > api url, storage url, firebase database url, otp url

No Issues
This commit is contained in:
2025-08-15 17:20:23 +08:00
parent 0956dea846
commit 7810eb1686
10 changed files with 93 additions and 17 deletions

3
.gitignore vendored
View File

@@ -32,6 +32,9 @@ yarn-error.*
# local env files
.env*.local
#env
.env
# typescript
*.tsbuildinfo

72
app.config.js Normal file
View File

@@ -0,0 +1,72 @@
import 'dotenv/config';
export default {
expo: {
name: "mobile-darmasaba",
slug: "mobile-darmasaba",
version: "1.0.0",
jsEngine: "jsc",
orientation: "portrait",
icon: "./assets/images/icon.png",
scheme: "myapp",
userInterfaceStyle: "automatic",
newArchEnabled: false,
ios: {
supportsTablet: true,
bundleIdentifier: "mobiledarmasaba.app",
infoPlist: {
ITSAppUsesNonExemptEncryption: false
},
googleServicesFile: "./ios/mobiledarmasaba/GoogleService-Info.plist"
},
android: {
package: "mobiledarmasaba.app",
adaptiveIcon: {
foregroundImage: "./assets/images/splash-icon.png",
backgroundColor: "#ffffff"
},
googleServicesFile: "./google-services.json"
},
web: {
bundler: "metro",
output: "static",
favicon: "./assets/images/favicon.png"
},
plugins: [
"expo-router",
[
"expo-splash-screen",
{
image: "./assets/images/splash-icon.png",
imageWidth: 200,
resizeMode: "contain",
backgroundColor: "#ffffff"
}
],
"expo-font",
"expo-image-picker",
"expo-web-browser",
[
"@react-native-firebase/app",
{
ios: {
googleServicesFile: "./ios/mobiledarmasaba/GoogleService-Info.plist"
}
}
]
],
experiments: {
typedRoutes: true
},
extra: {
router: {},
eas: {
projectId: "cfe34fb8-da8c-4004-b5c6-29d07df75cf2"
},
URL_API: process.env.URL_API,
URL_OTP: process.env.URL_OTP,
URL_STORAGE : process.env.URL_STORAGE,
URL_FIREBASE_DB : process.env.URL_FIREBASE_DB
}
}
};

BIN
bun.lockb

Binary file not shown.

View File

@@ -90,12 +90,6 @@ export default function SectionFile({ status, member, refreshing }: { status: nu
}
}
// async function download() {
// const destination = new Directory(Paths.document, 'pdfs');
// const filename = "dummy.pdf";
// const result = await File.downloadFileAsync('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf', destination);
// }
const openFile = () => {
setModal(false)

View File

@@ -1,8 +1,3 @@
/**
* Below are the colors that are used in the app. The colors are defined in the light and dark mode.
* There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc.
*/
const tintColorLight = '#19345E';
const tintColorDark = '#fff';

5
constants/ConstEnv.ts Normal file
View File

@@ -0,0 +1,5 @@
import Constants from 'expo-constants';
export const ConstEnv = {
url_storage : Constants?.expoConfig?.extra?.URL_STORAGE
}

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,11 @@
import axios from 'axios';
import Constants from 'expo-constants';
const api = axios.create({
// baseURL: 'http://10.0.2.2:3000/api',
// baseURL: 'https://stg-darmasaba.wibudev.com/api',
baseURL: 'http://192.168.154.198:3000/api',
// baseURL: 'http://192.168.154.198:3000/api',
baseURL: Constants?.expoConfig?.extra?.URL_API
});
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
@@ -12,7 +14,7 @@ export const apiCheckPhoneLogin = async (body: { phone: string }) => {
}
export const apiSendOtp = async (body: { phone: string, otp: number }) => {
const res = await axios.get(`https://wa.wibudev.com/code?nom=${body.phone}&text=*DARMASABA*%0A%0A
const res = await axios.get(`${Constants.expoConfig?.extra?.URL_OTP}/code?nom=${body.phone}&text=*DARMASABA*%0A%0A
JANGAN BERIKAN KODE RAHASIA ini kepada siapa pun TERMASUK PIHAK DARMASABA. Masukkan otentikasi: *${encodeURIComponent(body.otp)}*`)
return res.status
}

View File

@@ -32,6 +32,7 @@
"crypto-es": "^2.1.0",
"crypto-js": "^3.1.9-1",
"dayjs": "^1.11.13",
"dotenv": "^17.2.1",
"expo": "^53.0.9",
"expo-blur": "~14.1.4",
"expo-clipboard": "^7.1.4",