Skip to content

Commit

Permalink
Merge branch 'dev' into #697-aws-sdk-v3-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
predict-woo committed Jan 30, 2024
2 parents 8877526 + fcf0786 commit 715cfb8
Show file tree
Hide file tree
Showing 383 changed files with 9,364 additions and 9,892 deletions.
29 changes: 2 additions & 27 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,2 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
*.swp

# testing
/coverage

# production
/build

# misc
.DS_Store
.vscode
.idea
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/node_modules
**/build
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
**/node_modules
/.pnp
.pnp.js
package-lock.json
Expand All @@ -11,7 +11,7 @@ package-lock.json
/coverage

# production
/build
**/build

# misc
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ RUN apt-get -qq update; \
nvm use --delete-prefix default
ENV PATH /root/.nvm/versions/node/$NODE_VERSION/bin:$PATH

# Install base dependencies
RUN npm install --global [email protected] [email protected] [email protected]

# Copy lockfile and prefetch depdendencies
COPY pnpm-lock.yaml .
RUN pnpm fetch

# Copy repository
COPY . .

# Install requirements
RUN npm install --global [email protected] [email protected]; \
pnpm install; \
pnpm install [email protected] --save

# Build
RUN pnpm run build; \
chmod 711 /root
RUN pnpm --filter @taxi/web... install --offline; \
pnpm --filter @taxi/web... build

# Move built files to root
RUN mv /root/packages/web/build .
RUN chmod 711 /root

# Set default environment variables
ENV REACT_APP_BACK_URL=https://taxi.sparcs.org/api \
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,32 @@ $ pnpm install
See [notion page](https://www.notion.so/sparcs/Environment-Variables-1b404bd385fa495bac6d5517b57d72bf).
Refer to [.env.example](.env.example) and write your own `.env`.


## Development

Run scoped scripts

```bash
pnpm <scope> <script>
```

Valid scopes are:
- `web`: Corresponds to `@taxi/web`
- ~~`app`: (intended) Corresponds to `@taxi/app`~~
- ~~`core`: (intended) Corresponds to `@taxi/core`~~

### Examples

Run `web` development server
```bash
pnpm web start
```

Install new dependency to `app`
```bash
pnpm app install <package_name>
```

## Testing

This project contains E2E tests with Cypress. To run the test, start React development server with `npm start` and run test script by `npm run test` on another shell.
Expand Down
88 changes: 10 additions & 78 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,83 +2,22 @@
"name": "taxi-front",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/css": "^11.10.6",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@mui/icons-material": "^5.14.1",
"@mui/material": "^5.4.1",
"antd": "^5.4.6",
"axios": "^0.21.1",
"browser-image-compression": "^2.0.0",
"dayjs": "^1.11.7",
"firebase": "^9.15.0",
"heic2any": "^0.0.4",
"i18next": "^22.0.2",
"i18next-browser-languagedetector": "^7.0.1",
"moment": "^2.29.3",
"prop-types": "^15.8.1",
"qs": "^6.11.0",
"react": "^18.2.0",
"react-cookie": "^4.1.1",
"react-dom": "^18.2.0",
"react-ga4": "^1.4.1",
"react-i18next": "^12.0.0",
"react-qr-code": "^2.0.11",
"react-router-dom": "^5.3.3",
"react-toastify": "8.2.0",
"recoil": "^0.7.5",
"socket.io-client": "^4.3.2",
"use-state-with-callback": "^3.0.2"
},
"scripts": {
"start": "vite",
"build": "tsc && vite build",
"preinstall": "npx only-allow pnpm",
"test": "cypress open",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"app": "pnpm --filter @taxi/app",
"web": "pnpm --filter @taxi/web",
"start:app": "pnpm -r --stream start",
"start:app:prod": "NODE_ENV=production pnpm --filter @taxi/app start",
"start:web": "pnpm --filter @taxi/web... start",
"build:all": "pnpm -r build",
"build:web": "pnpm --filter @taxi/web... build",
"test": "pnpm -r test",
"typecheck": "pnpm -r typecheck"
},
"devDependencies": {
"@storybook/addon-essentials": "^7.5.2",
"@storybook/addon-interactions": "^7.5.2",
"@storybook/addon-links": "^7.5.2",
"@storybook/addon-onboarding": "^1.0.8",
"@storybook/blocks": "^7.5.2",
"@storybook/react": "^7.5.2",
"@storybook/react-vite": "^7.5.2",
"@storybook/testing-library": "^0.2.2",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/eslint": "^8.44.0",
"@types/eslint-config-prettier": "^6.11.0",
"@types/prop-types": "^15.7.5",
"@types/qs": "^6.9.7",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"@vitejs/plugin-react-swc": "^3.4.1",
"cypress": "^10.3.1",
"cypress-react-selector": "^3.0.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -88,13 +27,6 @@
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-storybook": "^0.6.15",
"storybook": "^7.5.2",
"typescript": "^5.1.6",
"vite": "^4.5.0",
"vite-plugin-svgr": "^3.2.0"
},
"resolutions": {
"@types/react": "^17.0.2",
"react-error-overlay": "6.0.9"
"typescript": "^5.1.6"
}
}
35 changes: 35 additions & 0 deletions packages/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

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

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo
40 changes: 40 additions & 0 deletions packages/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import type { ConfigContext, ExpoConfig } from "@expo/config";
import ip from "internal-ip";

const isDev = process.env.NODE_ENV === "development";

export default ({ config }: ConfigContext): Partial<ExpoConfig> => ({
...config,
name: "Taxi for KAIST",
slug: "Taxi-for-KAIST",
version: "1.0.0",
orientation: "portrait",
icon: "./assets/icon.png",
userInterfaceStyle: "light",
splash: {
image: "./assets/splash.png",
resizeMode: "contain",
backgroundColor: "#ffffff",
},
assetBundlePatterns: ["**/*"],
ios: {
supportsTablet: true,
},
android: {
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#ffffff",
},
},
web: {
favicon: "./assets/favicon.png",
},
experiments: {
tsconfigPaths: true,
},
extra: {
SERVER_URL: isDev
? `http://${ip.v4.sync()}:3000`
: "https://taxi.sparcs.org",
},
});
Binary file added packages/app/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 packages/app/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 packages/app/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 packages/app/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.
6 changes: 6 additions & 0 deletions packages/app/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
26 changes: 26 additions & 0 deletions packages/app/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];
// #3 - Force resolving nested modules to the folders below
config.resolver.disableHierarchicalLookup = true;
// #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;
1 change: 1 addition & 0 deletions packages/app/node.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="@types/node" />
32 changes: 32 additions & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@taxi/app",
"version": "1.0.0",
"main": "src/main.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/native": "^6.1.9",
"@react-navigation/stack": "^6.3.20",
"expo": "~49.0.15",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.6",
"react-native-webview": "^13.6.4",
"shallow-equal": "^3.1.0",
"url-pattern": "^1.0.3",
"uuid": "3.4.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/node": "^20.11.5",
"@types/react": "~18.2.14",
"internal-ip": "^6.2.0",
"typescript": "^5.1.3"
},
"private": true
}
15 changes: 15 additions & 0 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { RootStack } from "@/screens";
import { NavigationContainer } from "@react-navigation/native";
import { StatusBar } from "expo-status-bar";
import { View } from "react-native";

export function App() {
return (
<View style={{ flex: 1 }}>
<NavigationContainer>
<RootStack />
</NavigationContainer>
<StatusBar style="auto" />
</View>
);
}
Loading

0 comments on commit 715cfb8

Please sign in to comment.