Aller au contenu

Processus Application Mobile

Ce document décrit les processus spécifiques à l'app mobile. Voir le workflow global pour le processus projet.

Développement d'un écran

1. Définition

Besoin UX identifié
Wireframe/Maquette
Définir composants nécessaires
Définir state management

2. Implémentation

Créer Screen
Créer Composants
Connecter au Store
Ajouter Navigation

3. Tests

Tests unitaires composants
Tests hooks
Vérifier coverage

Structure d'un écran

src/screens/<feature>/
├── <Feature>Screen.tsx
├── components/
│   ├── <Component>.tsx
│   └── index.ts
├── hooks/
│   └── use<Feature>.ts
└── __tests__/
    └── <Feature>Screen.test.tsx

Ajout d'une fonction crypto

Checklist obligatoire

  • Vecteurs de test RFC/NIST
  • Validation paramètres (longueurs, formats)
  • Effacement mémoire (zeroize)
  • Pas de logging données sensibles
  • Documentation inline

Structure

src/services/crypto/
├── <function>.ts
└── __tests__/
    └── <function>.test.ts

Gestion du state

Zustand Store

// src/store/<feature>Store.ts
export const use<Feature>Store = create<State>((set) => ({
  // state
  data: null,
  loading: false,
  error: null,

  // actions
  fetch: async () => { ... },
  reset: () => set({ data: null }),
}));

Bonnes pratiques

  • Un store par domaine fonctionnel
  • Actions async avec loading/error
  • Reset au logout

Tests

Composants

import { render, fireEvent } from '@testing-library/react-native';

describe('Component', () => {
  it('should render correctly', () => {
    const { getByText } = render(<Component />);
    expect(getByText('Label')).toBeTruthy();
  });
});

Hooks

import { renderHook, act } from '@testing-library/react-hooks';

describe('useHook', () => {
  it('should return initial state', () => {
    const { result } = renderHook(() => useHook());
    expect(result.current.value).toBe(initial);
  });
});

Services crypto

describe('cryptoFunction', () => {
  it('should pass RFC test vectors', () => {
    // Vecteur RFC
    const input = ...;
    const expected = ...;
    expect(cryptoFunction(input)).toEqual(expected);
  });
});

Build et déploiement

Development

npm start           # Démarrer Expo
npm run ios         # Lancer sur iOS
npm run android     # Lancer sur Android

Production

eas build --platform ios --profile production
eas submit --platform ios

Référence complète

Voir le workflow global.