A React Native TypeScript app simulating a historical Enigma cipher machine. Users configure rotors and a plugboard, then type on a keyboard to encrypt and decrypt messages.
- Node.js (v16 or later recommended)
- React Native CLI environment set up for your target platform (Android and/or iOS)
- For Android: Android Studio with an emulator or a connected device
- For iOS (macOS only): Xcode with CocoaPods installed
-
Clone the repository:
git clone https://github.com/<your-username>/EnigmaProject.git cd EnigmaProject
-
Install dependencies:
npm install
-
For iOS, install CocoaPods:
cd ios && pod install && cd ..
Start the Metro bundler:
npm run startThen, in a separate terminal, build and run on your target platform:
# Android
npm run android
# iOS
npm run iosRun all tests:
npm testRun a specific test file:
npm test -- --testPathPattern=<pattern>Type-check and lint:
npm run lintAuto-fix lint issues:
npm run lint:fixFormat with Prettier and fix lint issues:
npm run formatsrc/
├── components/pages/machine/ # Main Enigma interface (keyboard + settings)
├── constants/ # UI strings (labels) and testID selectors
├── features/ # Redux slices (rotors, plugboard, reflector)
├── store/ # Redux store configuration
├── styles/ # Shared StyleSheet definitions
├── types/ # TypeScript interfaces
└── utils/ # Test utilities
- Navigation: Drawer navigator with screens for the Enigma Machine, Break Cipher, About, and Settings. The Machine screen uses a nested Stack navigator.
- State management: Redux Toolkit with slices for rotors, plugboard, and reflector.
- Keyboard layout: Follows the historical German Enigma layout —
QWERTZUIOP / ASDFGHJKL / YXCVBNM.