Skip to content

Latest commit

 

History

History
192 lines (131 loc) · 3.8 KB

File metadata and controls

192 lines (131 loc) · 3.8 KB

Nedaa

Prerequisites

Before running the project, make sure you have the following installed:

Code Quality Tools

This project uses several tools to maintain code quality:

  • Husky: Manages git hooks to run checks before commits(.husky/pre-commit)
  • lint-staged: Runs linters on staged git files
  • ESLint: Checks code for potential errors and enforces coding standards
  • Prettier: Automatically formats code for consistency
  • Act: Test GitHub Actions workflows locally

The pre-commit hook will automatically:

  1. Run ESLint to check code quality
  2. Run Prettier to format staged files
  3. Prevent commits if there are any linting errors

Installation

  1. Clone the repository:
git clone https://github.com/NedaaDevs/nedaa
cd nedaa
  1. Install dependencies using Bun:
bun install


# Alternative: Install using Bun with Yarn compatibility
bun install --yarn
  1. Install Act for local CI testing:
# macOS with Homebrew
brew install act

# Or with Bun globally
bun add -g @nektos/act

Running the App

For iOS (Mac is required)

  1. Make sure you have Xcode installed and set up properly
  2. Install iOS Simulator (through Xcode)
  3. Run the following command:
bun run ios

Alternatively, you can use:

npx expo run:ios

For Android

  1. Make sure you have Android Studio installed
  2. Set up an Android Virtual Device (AVD) through Android Studio
  3. Run the following command:
bun run android

Alternatively, you can use:

npx expo run:android

Development Mode

To start the metro server:

bun start

This will start the Expo development server, and you can choose to run on either iOS or Android from the Expo Developer Tools.

Local CI Testing

Test GitHub Actions workflows locally using Act:

Code Quality Checks

# Test code quality workflow
act -j quality-checks

# Test with specific triggers
act pull_request -j quality-checks
act push -j quality-checks

# Test with reusable containers (faster)
act -j quality-checks --reuse

Workflow Validation

# List available workflows
act -l

# Dry run (validate without execution)
act -n -j quality-checks

# Verbose output for debugging
act -j quality-checks -v

Troubleshooting

Common Issues

  1. Pod installation fails (iOS)

    cd ios
    pod install
  2. Android build fails

    • Clean the Android build:
    cd android
    ./gradlew clean
  3. Metro bundler issues

    • Clear Metro bundler cache:
    bun start --clear
  4. Act Docker issues

    • Clean up Docker containers:
    docker system prune -f
    • Check Docker is running and accessible

Scripts

Available scripts in package.json:

  • bun start: Start the Expo development server
  • bun run android: Run on Android
  • bun run ios: Run on iOS
  • bun run lint: Run ESLint checks
  • bun run format: Format code with Prettier

Note: You can add --no-build-cache flag to any run command to execute without using the build cache, e.g.:

bun run ios --no-build-cache

Additional Resources