Skip to content
Open
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
60 changes: 60 additions & 0 deletions mobile/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
x-db-env: &db-env
MYSQL_DATABASE: "mydb"
MYSQL_USER: "django"
MYSQL_PASSWORD: "djangopass"
MYSQL_ROOT_PASSWORD: "rootpass"

services:
db:
image: mysql:8.0
container_name: mysql-db-mobile
restart: always
environment:
<<: *db-env
volumes:
- mysql_data-mobile:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "django", "-pdjangopass"]
interval: 5s
timeout: 5s
retries: 5

backend:
build:
context: ../backend
container_name: django-app-mobile
expose:
- "9000"
ports:
- "9001:9000"
depends_on:
db:
condition: service_healthy
environment:
<<: *db-env
DJANGO_SECRET_KEY: "super-secret-key"
volumes:
- static_volume-mobile:/project/staticfiles
- media_volume-mobile:/project/media

mobile:
build:
context: ./nutrihub/
container_name: mobile-frontend
environment:
- EXPO_PUBLIC_API_BASE_URL=http://localhost:9001/api
- EXPO_DEVTOOLS_LISTEN_ADDRESS=0.0.0.0
- NODE_OPTIONS=--max-old-space-size=4096
mem_limit: 2g
ports:
- "8081:8081"
- "19000-19002:19000-19002"
tty: true
depends_on:
- backend

volumes:
mysql_data-mobile:
static_volume-mobile:
media_volume-mobile:

5 changes: 5 additions & 0 deletions mobile/nutrihub/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Backend API Configuration
# For Android emulator, use: http://10.0.2.2:8080/api
# For iOS simulator, use: http://localhost:8080/api
# For physical device, use your computer's IP address
EXPO_PUBLIC_API_BASE_URL=http://10.0.2.2:8080/api
1 change: 1 addition & 0 deletions mobile/nutrihub/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ yarn-error.*
*.pem

# local env files
.env
.env*.local

# typescript
Expand Down
22 changes: 22 additions & 0 deletions mobile/nutrihub/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Minimal Dockerfile for Expo React Native dev
FROM node:20

# Install watchman (optional but recommended for RN)
RUN apt-get update && apt-get install -y \
watchman \
&& rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy package files and install deps
COPY package*.json ./
RUN npm install

# Copy the rest of the project
COPY . .

# Expose Metro + Expo ports
EXPOSE 19000 19001 19002 8081

CMD ["npx", "expo", "start", "--host", "localhost"]
44 changes: 44 additions & 0 deletions mobile/nutrihub/app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export default {
expo: {
name: "nutrihub",
slug: "nutrihub",
version: "1.0.0",
orientation: "portrait",
icon: "./assets/icon.png",
userInterfaceStyle: "light",
splash: {
image: "./assets/splash-icon.png",
resizeMode: "contain",
backgroundColor: "#0d7c5f",
},
ios: {
supportsTablet: true,
bundleIdentifier: "com.y4z1c1.nutrihub",
infoPlist: {
NSCameraUsageDescription: "This app needs access to camera to take profile photos.",
NSPhotoLibraryUsageDescription: "This app needs access to photo library to select profile photos.",
},
},
android: {
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#0d7c5f",
},
package: "com.y4z1c1.nutrihub",
permissions: [
"android.permission.CAMERA",
"android.permission.READ_EXTERNAL_STORAGE",
"android.permission.WRITE_EXTERNAL_STORAGE",
],
},
web: {
favicon: "./assets/favicon.png",
},
extra: {
eas: {
projectId: "082f0add-9ca4-42a3-9133-e8b160fa4c7f",
},
apiBaseUrl: process.env.EXPO_PUBLIC_API_BASE_URL || "http://10.0.2.2:8080/api",
},
},
};
Loading