{"id":24782572,"url":"https://github.com/lehcode/angularjs-migration","last_synced_at":"2025-03-24T05:29:25.517Z","repository":{"id":271216202,"uuid":"912592812","full_name":"lehcode/angularjs-migration","owner":"lehcode","description":"Migration of a simple AngularJS  application to Angular","archived":false,"fork":false,"pushed_at":"2025-01-06T10:07:25.000Z","size":2449,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T11:18:02.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lehcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-06T01:43:35.000Z","updated_at":"2025-01-06T10:07:28.000Z","dependencies_parsed_at":"2025-01-06T10:45:44.775Z","dependency_job_id":"ee14069b-4206-452d-bb7a-763ebba7223f","html_url":"https://github.com/lehcode/angularjs-migration","commit_stats":null,"previous_names":["lehcode/angularjs-migration"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lehcode%2Fangularjs-migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lehcode%2Fangularjs-migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lehcode%2Fangularjs-migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lehcode%2Fangularjs-migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lehcode","download_url":"https://codeload.github.com/lehcode/angularjs-migration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245215664,"owners_count":20579015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-29T11:18:05.555Z","updated_at":"2025-03-24T05:29:25.462Z","avatar_url":"https://github.com/lehcode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AngularJS to Angular Migration Project\n\nThis project demonstrates a hybrid application that combines AngularJS (1.8) and Angular (19) using the ngUpgrade module. It's structured as a monorepo using NX and uses Yarn for package management.\n\n## Migration Strategy\n\nThe project follows these migration principles:\n\n1. **Bottom-Up Migration**:\n   - Start with leaf components\n   - Gradually move up the component tree\n   - Keep parent components in AngularJS until children are migrated\n\n2. **Service Migration**:\n   - Create interfaces for AngularJS services\n   - Use upgradeService to access AngularJS services in Angular\n   - Gradually replace with Angular services\n\n3. **Router Migration**:\n   - Use hash-based routing during migration\n   - Maintain both router configurations\n   - Gradually move routes to Angular\n\n## Architecture Decisions\n\n1. **Standalone Components**:\n   - All new Angular components are standalone\n   - Reduces need for NgModule configuration\n   - Easier lazy loading\n\n2. **State Management**:\n   - Legacy state handled by AngularJS services\n   - New state management in Angular services\n   - Gradual migration of state management\n\n3. **Styling Strategy**:\n   - Legacy styles maintained in SCSS\n   - New styles use standalone component CSS\n   - Global styles managed through angular.json\n\n## Project Structure\n\n```\n.\n├── apps/\n│   ├── barq/           # Main Angular 19 application\n│   ├── legacy/         # Legacy AngularJS 1.8 application\n│   └── barq-e2e/       # E2E tests\n├── libs/\n│   ├── feature/        # Feature library\n│   └── shared/         # Shared library\n└── package.json\n```\n\n## Prerequisites\n\n- Node.js \u003e= 20.18.1\n- Package manager (`Yarn`)\n- Git\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/your-repo/angularjs-migration.git\n   cd angularjs-migration\n   ```\n\n2. Clone the legacy repository into the `apps/legacy` directory:\n\n   ```bash\n   mkdir -p apps/legacy\n   git clone https://github.com/lehcode/delivery-admin-ui.git apps/legacy\n   ```\n\n3. Install dependencies:\n\n   ```bash\n   yarn install\n   ```\n\n## Development\n\n### Running the Applications\n\n1. Start the development server:\n\n   ```bash\n   yarn start\n   ```\n\n   This will start the hybrid application at `http://localhost:4200`\n\n2. Run the legacy application separately (for development/comparison):\n\n   ```bash\n   cd apps/legacy\n   yarn install\n   yarn start\n   ```\n\n   The legacy application will be available at `http://localhost:8000`\n\n### Development Workflow\n\nThe project uses a hybrid approach where:\n\n- New features are developed in Angular (`apps/barq`)\n- Legacy features are gradually migrated from AngularJS (`apps/legacy`)\n- Shared code is placed in the libs directory\n\n#### Key Files\n\n- `apps/barq/src/main.ts`: Bootstrap file for the hybrid application\n- `apps/barq/src/app/upgrade/upgrade.service.ts`: Service for AngularJS integration\n- `apps/legacy/app/legacy-init.js`: AngularJS initialization\n- `apps/barq/src/app/app.component.ts`: Root Angular component\n\n### Building\n\n1. Development:\n\n   ```bash\n   yarn start --watch\n   ```\n\n2. Production build:\n\n   ```bash\n   yarn build\n   ```\n\n### Testing\n\n1. Run unit tests:\n\n   ```bash\n   yarn test\n   ```\n\n2. Run e2e tests:\n\n   ```bash\n   yarn e2e\n   ```\n\n3. Run linting:\n\n   ```bash\n   yarn lint\n   ```\n\n## License\n\nMIT\nSee LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flehcode%2Fangularjs-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flehcode%2Fangularjs-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flehcode%2Fangularjs-migration/lists"}