Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ cp apps/api/.env.example apps/api/.env

# Fichier .env pour le frontend web (configuration de l'URL API)
cp apps/web/.env.example apps/web/.env

# Fichier .env pour l'application mobile (configuration de l'URL API)
cp apps/mobile/.env.example apps/mobile/.env

# Pour builder l'app mobile en production, créer également :
cp apps/mobile/.env.example apps/mobile/.env.production
# Puis éditer .env.production avec l'URL publique de votre API
```

### Lancer le projet (développement)
Expand Down
9 changes: 9 additions & 0 deletions apps/mobile/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Configuration API pour l'application mobile
#
# Pour développement local (.env) : utilisez votre IP locale
# EXPO_PUBLIC_API_URL=http://192.168.1.XXX:3000
#
# Pour production (.env.production) : utilisez l'URL publique de votre API
# EXPO_PUBLIC_API_URL=https://api.dropit-app.fr

EXPO_PUBLIC_API_URL=http://192.168.1.XXX:3000
2 changes: 2 additions & 0 deletions apps/mobile/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ yarn-error.*

# local env files
.env*.local
.env
.env.production

# typescript
*.tsbuildinfo
5 changes: 4 additions & 1 deletion apps/mobile/eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"distribution": "internal"
},
"preview": {
"distribution": "internal"
"distribution": "internal",
"env": {
"EXPO_PUBLIC_API_URL": "https://api.dropit-app.fr"
}
},
"production": {
"autoIncrement": true
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';

// Client API pour React Native avec gestion du Bearer token
export const api = initClient(apiContract, {
baseUrl: 'http://192.168.1.147:3000/api',
baseUrl: `${process.env.EXPO_PUBLIC_API_URL || 'http://192.168.1.147:3000'}/api`,
// Configuration pour React Native
// biome-ignore lint/suspicious/noExplicitAny: Better Auth type compatibility
api: async (args: any) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/lib/auth-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';

// Configuration du client d'authentification pour React Native
export const authClient = createAuthClient({
baseURL: 'http://192.168.1.147:3000', // IP locale pour mobile
baseURL: process.env.EXPO_PUBLIC_API_URL || 'http://192.168.1.147:3000',
plugins: [
organizationClient({
// biome-ignore lint/suspicious/noExplicitAny: Better Auth type compatibility
Expand Down