Skip to main content

ShopShip Store

info

Repository: shopship_app_store

Gitlab: https://gitlab.winds.vn/shopship/shopship_app_store

Requirements

Trước khi chạy project, cần cài đặt các công cụ sau:

Node.js

Project yêu cầu Node.js:

"engines": {
"node": ">=16"
}

Khuyến nghị dùng Node.js 18 hoặc 20 (LTS).

Kiểm tra version:

node -v

Yarn

Project dùng Yarn classic (1.x).

Kiểm tra version:

yarn -v

iOS (macOS)

  • Xcode
  • CocoaPods (Gemfile đang dùng cocoapods ~> 1.12)
  • iOS Deployment Target: 13.4

Android

  • Android Studio
  • Android SDK phù hợp với cấu hình project:
    • minSdkVersion = 21
    • compileSdkVersion = 33
    • targetSdkVersion = 35

Running the development server

1. Cấu hình môi trường API

Project này không dùng .env để chọn API runtime. Base URL được khai báo trong code:

  • app/constants/ApiService.js
  • app/constants/ApiServiceUpload.js

Giá trị hiện tại:

export const BASE_URL_DEV = "https://dev.admin.shopship.winds.vn/";
export const BASE_URL_PRO = "https://admin.shopship.winds.vn/";
export const BASE_URL_STAGING = "https://staging.admin.shopship.winds.vn/";
export const BASE_URL_STAGING2 = "https://staging2.admin.shopship.winds.vn/";
export const BASE_URL_LOCAL = "https://local.apishopship.winds.vn/";

Mặc định app đang để:

ENVIROMENT: "pro";

Ngoài ra có thể đổi môi trường ngay ở màn login thông qua Switch Domain (app sẽ lưu vào AsyncStorage key enviroment).

2. Cài đặt dependencies

Trong thư mục chứa package.json, chạy:

yarn install

Nếu chạy iOS, cài pod:

yarn pod

3. Chạy project local

Chạy Metro + app

yarn start
yarn android
# hoặc
yarn ios

Dùng script có sẵn cho Android emulator/device

yarn 8081
# hoặc
yarn 8082

Release / Deploy (CodePush)

1. Đăng nhập các CLI cần thiết

appcenter login
sentry-cli login

Nếu team dùng internal CLI code-push-ws, cần đảm bảo đã cài và đăng nhập.

2. Release CodePush

Production

yarn cpa   # Android
yarn cpi # iOS
yarn cp # iOS + Android

Staging + Source map Sentry

yarn cpa-sentry
yarn sentry-push-android

yarn cpi-sentry
yarn sentry-push-ios

Clear deployment staging

yarn cpa-clear
yarn cpi-clear

Lưu ý quan trọng

  1. Sau khi thêm ảnh hoặc text resources, chạy lại:
yarn li
  1. i18n text: không dùng R.string.user, dùng R.strings().user.

  2. Nếu iOS lỗi dependency, chạy lại:

yarn pod
  1. Trước khi release, kiểm tra đúng deployment/channel và môi trường API để tránh app gọi sai server.