Skip to content

Commit

Permalink
Merge pull request #20 from dmytro-komlyk/mobile
Browse files Browse the repository at this point in the history
Mobile
  • Loading branch information
dmytro-komlyk authored Jun 11, 2024
2 parents f3381d7 + 907d399 commit fbadf28
Show file tree
Hide file tree
Showing 23 changed files with 9,100 additions and 2,728 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ node_modules
.next
dist
out
.expo
android
ios
web-build

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Uploads
apps/server/public
Expand Down
4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
auto-install-peers = true
auto-install-peers=true
public-hoist-pattern[]=*@nextui-org/*
public-hoist-pattern[]=*prisma*
public-hoist-pattern[]=*prisma*
1 change: 1 addition & 0 deletions apps/admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ ENV NEXT_TELEMETRY_DISABLED 1
COPY apps/${APP_NAME}/.env.docker.${BUILD_MODE}.example ./apps/${APP_NAME}/.env.local
# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .
COPY turbo.json turbo.json

RUN pnpm db:generate
RUN turbo build --filter=${APP_NAME}
Expand Down
1 change: 1 addition & 0 deletions apps/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ENV NEXT_TELEMETRY_DISABLED 1
COPY apps/${APP_NAME}/.env.docker.${BUILD_MODE}.example ./apps/${APP_NAME}/.env.local
# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .
COPY turbo.json turbo.json

RUN pnpm db:generate
RUN turbo build --filter=${APP_NAME}
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
11 changes: 11 additions & 0 deletions apps/mobile/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { StatusBar } from 'expo-status-bar';
import { Text, View } from 'react-native';

export default function App() {
return (
<View className="flex-1 bg-[#fff] items-center justify-center">
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
}
2 changes: 2 additions & 0 deletions apps/mobile/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference types="nativewind/types" />
34 changes: 34 additions & 0 deletions apps/mobile/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"expo": {
"name": "mobile",
"slug": "mobile",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"bundleIdentifier": "com.bycedric.expomonorepo",
"buildNumber": "1.0.0",
"supportsTablet": true
},
"android": {
"package": "com.bycedric.expomonorepo",
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Binary file added apps/mobile/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/mobile/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/mobile/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/mobile/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions apps/mobile/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: ['nativewind/babel'],
};
};
3 changes: 3 additions & 0 deletions apps/mobile/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
8 changes: 8 additions & 0 deletions apps/mobile/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { registerRootComponent } from 'expo';

import App from './App';

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in the Expo client or in a native build,
// the environment is set up appropriately
registerRootComponent(App);
26 changes: 26 additions & 0 deletions apps/mobile/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Learn more https://docs.expo.dev/guides/monorepos
const { getDefaultConfig } = require('expo/metro-config');
const { FileStore } = require('metro-cache');
const path = require('path');

const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, '../..');

const config = getDefaultConfig(projectRoot);

// #1 - Watch all files in the monorepo
config.watchFolders = [workspaceRoot];
// #2 - Try resolving with project modules first, then workspace modules
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules'),
];

// Use turborepo to restore the cache when possible
config.cacheStores = [
new FileStore({
root: path.join(projectRoot, 'node_modules', '.cache', 'metro'),
}),
];

module.exports = config;
36 changes: 36 additions & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "mobile",
"version": "1.0.0",
"private": true,
"main": "index.js",
"description": "Mobile based on Expo",
"scripts": {
"metro": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"lint": "eslint .",
"lint:fix": "pnpm lint --fix"
},
"dependencies": {
"@expo/metro-runtime": "^3.2.1",
"expo": "~51.0.11",
"expo-dev-client": "^4.0.15",
"expo-status-bar": "~1.12.1",
"expo-updates": "^0.25.16",
"nativewind": "^2.0.11",
"react": "18.2.0",
"react-dom": "^18",
"react-native": "0.74.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"autoprefixer": "^10.0.1",
"postcss": "^8",
"tailwindcss": "^3.3.2"
},
"lint-staged": {
"**/*.{js,ts,tsx}": [
"pnpm lint:fix"
]
}
}
6 changes: 6 additions & 0 deletions apps/mobile/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
14 changes: 14 additions & 0 deletions apps/mobile/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./App.{js,jsx,ts,tsx}',
'./screens/**/*.{js,jsx,ts,tsx}',
'./pages/**/*.{js,jsx,ts,tsx}',
'./components/**/*.{js,jsx,ts,tsx}',
'./src/**/*.{js,jsx,ts,tsx}',
],
theme: {
extend: {},
},
plugins: [],
};
6 changes: 6 additions & 0 deletions apps/mobile/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true
}
}
1 change: 1 addition & 0 deletions apps/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN --mount=type=cache,id=pnpm,target=~/.pnpm-store pnpm install --frozen-lockfi

# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .
COPY turbo.json turbo.json

COPY .gitignore .gitignore
RUN pnpm db:generate
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
"name": "fullstack-boilerplate-next-nest-vps",
"version": "1.0.0",
"description": "",
"main": "index.js",
"workspaces": [
"apps/*"
],
"scripts": {
"db:generate": "pnpm --filter server db:generate",
"db:push": "pnpm --filter server db:push",
"db:seed": "pnpm --filter server db:seed",
"studio": "pnpm --filter server studio",
"dev": "pnpm run --parallel dev",
"dev:metro": "pnpm --filter mobile metro",
"dev:ios": "pnpm --filter mobile ios",
"dev:android": "pnpm --filter mobile android",
"build": "pnpm run --parallel build",
"start": "pnpm run --parallel start",
"build:server": "pnpm --filter server build",
Expand Down
Loading

0 comments on commit fbadf28

Please sign in to comment.