Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

95 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mobile App Base (Expo + TypeScript)

This folder is the future Expo/React Native client for AssRep. The goal is a single, strictly typed codebase that mirrors the Telegram student journey while keeping the architecture and tooling clean from day one.

Vision

  • Expo-managed app (Android / iOS / Web from one codebase) with TypeScript strict compliance.
  • Feature-first layers (src/features, src/entities, src/shared, src/screens) so new functionality plugs into predictable folders.
  • Reusable UI kit (shared/components) with consistent Button, Text, Input, Card, and design tokens (shared/constants/tokens).
  • Shared API client in shared/api (one entrypoint + typed responses) so UI never calls fetch/axios directly.
  • Global state via a single solution (Zustand or Redux Toolkit; TBD) with selectors outside components.
  • i18n-ready strings, accessibility-aware props, centralized logging, and an Error Boundary.

Stack & Tooling

  • Language: TypeScript strict flags (noImplicitAny, strictNullChecks, etc.).
  • Formatting: Prettier (one config in the repo root).
  • Linting: ESLint + shared config (extendable by features).
  • Pre-commit: Husky + lint-staged (pnpm fmt, pnpm lint on staged files).
  • Package manager: pnpm.
  • Testing: Unit tests targeting API layer and business logic (jest/vitest as appropriate).
  • CI baseline: pnpm lint, pnpm test, pnpm build (via EAS for Android when ready).
  • Beta delivery: OTA (EAS Update) + Android Internal Track + TestFlight via .github/workflows/mobile-beta-distribution.yml.

Directory Sketch

src/
├── entities/      # core domain models + types (User, Tutor, Slot, Notification)
├── features/      # feature-centric folders (e.g., subjects, tutors, slots, auth)
│   └── <feature>/
│       ├── hooks/  # hooks encapsulating feature logic
│       ├── components/
│       └── screens/ # feature screens
├── screens/        # routing-level screens (if separate from features)
└── shared/
    ├── api/        # single API client + response types
    ├── components/ # reusable UI kit (Button, Text, Input, Card, Layout)
    ├── constants/  # colors, spacing, typography, strings
    ├── hooks/      # shared hooks (useAuth, useNotifications, etc.)
    ├── state/      # Zustand/Redux slices + selectors
    ├── utils/       # helpers, logger, error boundary wrapper
    └── config/      # navigation, theming, i18n setup

Setup

  1. pnpm install
  2. pnpm expo start (runs Metro + dev server).
  3. pnpm lint
  4. pnpm fmt
  5. pnpm test
  6. pnpm test:smoke (critical role flows in mock mode)

Mock Mode

  • Before running mock mode, stop previously running Metro instances for this repo.
  • Run UI-only mode with rich mock data and in-memory mutations:
    • make local-mock-up
    • or pnpm start:mock
  • Demo accounts in mock mode:
    • Student: +7 999 000-00-01 / 123456
    • Tutor: +7 999 000-00-02 / 123456
    • Admin tutor: +7 999 000-00-03 / 123456

Use pnpm typecheck (via tsc --noEmit) once the feature modules exist. Use pnpm test:smoke to validate critical student/tutor/admin flows against mock API.

Environment

  • Copy .env.example to .env.local and set API_BASE_URL to the IP/port where your backend runs (e.g., http://192.168.1.42:8000/api while your Mac is on the same Wi-Fi as the phone).
  • Keep APP_ENV=local for local work. Later you can create .env.stage and run APP_ENV=stage pnpm expo start to target staging services.
  • For staging/beta values use .env.stage.example as a template.
  • To reach your Mac from the phone, start Expo with both the tunnel and your host IP:
    EXPO_PACKAGER_HOSTNAME=$(ipconfig getifaddr en0) pnpm start:local
    
    This makes Metro and the backend reachable via the same LAN address.
  • Keep .env.local out of git (.gitignore already covers it); commit only .env.example.

Android Testing

  • Connect your Android device or start an emulator.
  • Run pnpm expo start --android or pnpm expo android to push the bundle to the device.
  • For convenience, expose the development server to the device by running Metro with --host tunnel or using EXPO_DEVTOOLS_LISTEN_ADDRESS=0.0.0.0.
  • Keep EXPO_PACKAGER_HOSTNAME pointed to your machine IP if necessary so the device can fetch bundles.
  • Document any required env (API base URL, auth tokens) in a .env.example.

API & Auth Notes

  • All network calls go through shared/api/client.ts (to be created) so error handling, auth headers, retries, and serialization stay in one place.
  • Auth context (tokens, role) lives in shared/state/authStore.ts.
  • Notifications (in-app and push-ready) come through a shared shared/hooks/useNotifications.ts.

Logging & Errors

  • Use a shared logger (e.g., shared/utils/logger.ts) for warnings/errors; never log raw exceptions to UI.
  • Wrap root navigator with an Error Boundary components to display user-friendly fallback screens.

Next Milestones

  1. Sketch the student flow: Subjects → Tutors → Tutor Profile → Slots → Reviews.
  2. Connect the API client to the backend endpoints and wire auth + notifications.
  3. Build shared UI tokens (colors/spacing/typography) plus reusable components.
  4. Add Husky + lint-staged, ensure pnpm lint/test/build runs cleanly.
  5. Document how to run Android tests and keep this README in sync as the app grows.

Beta Deployment

  • Workflow: .github/workflows/mobile-beta-distribution.yml
  • Full runbook: docs/beta-distribution.md
  • EAS profile config: eas.json (preview for internal beta, beta for store/TestFlight submission)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages