📱 Upgrade and Refactor of the Mobile Application
Author: Martin Kedmenec
🎯 Introduction and Rationale
- Technical Debt: Outdated branches, dependencies (2–3 years old), inconsistent styles, old directory structure, no TypeScript.
- Google Play Requirement: New apps must target Android 15 (API 35) → impossible in current state.
- Impact: Outdated practices caused bugs, slowed development, and made deployments unreliable.
- Key Question: How can we fix this?
⚡ Initial Upgrade and Challenges
npm update
/npm audit fix
insufficient due to unused and blocking dependencies.- Examples:
react-native-dotenv
(obsolete, replaced by Expo).- Outdated Nativewind requiring peer dependency upgrades.
- Many unused dependencies and inconsistent configurations.
🛠️ The Proper Fix
- Created a fresh Expo project from template.
- Reorganized files and directories.
- Reinstalled only necessary dependencies.
- Migrated to TypeScript.
- Renamed files to kebab-case.
- Added Prettier.
- Added Dockerized setup +
.nvmrc
fallback.
📚 Major Improvements
✅ General Best Practices
- Moved sources from
eml/
→ root. - Migrated to TypeScript/TSX (except configs).
- Upgraded all dependencies (Expo 54, Node.js 24).
- Standardized imports (absolute).
- Removed redundant/legacy files.
- Updated
.gitignore
to Expo standard.
🎨 Common Platform & Style
- Prettier (
.prettierc
,.prettierignore
) + full reformat. - Added
.editorconfig
. - Added
Dockerfile
+compose.yaml
. - Added
.nvmrc
. - IDE configurations (JetBrains, VSCode).
- Arrow functions, TSDoc adoption, exports refactor (WIP).
📝 To Do
- Convert more components to typed props.
- Fix failing Jest tests (100+ pass).
- Full migration to TypeScript + fix
tsc
errors. - Migrate tests to
@testing-library/react-native
. - Add proper i18n (EN/PT-BR).
- Migrate
app/index.tsx
→ Expo Router. - Resolve ESLint warnings.
- Fix GitHub Workflows.
- Lock Android client version in Expo config.
🚧 Future Issues and Challenges
- Large PR size: ~459 files, +67k additions, –80k deletions.
- Much due to
package-lock.json
, file renaming, formatting. - Strategy: Upgrade first, fix bugs later in smaller batches.
🌿 Branching and Versioning Strategy
- Current: Gitflow → dev ahead of main, inconsistent.
- Proposed: Trunk-Based Development (TBD):
- Single
main
as source of truth. - Frequent merges (daily).
- High-quality PRs required.
- Branch Protection: Lock
main
and enforce PRs. - Versioning: Use Semantic Versioning + auto bump on releases.
✅ Recommendations
- Keep using
educado-mobile
repo. - Merge
refactor-and-upgrade
→dev
ASAP. - Reset
main
=dev
after upgrade. - Adopt trunk-based development.
- Configure branch rulesets.
- Fix bugs incrementally with high release velocity.
- Release often.
- Strengthen CI/CD.
- Use Semantic Versioning.
- Apply similar refactors to other projects.
- Gradually fix TypeScript and ESLint issues.
- Pause new features until upgrade complete.