This Angular application was extracted from production sourcemaps and reconstructed for local development.
- This application was reverse-engineered from webpack sourcemaps
- The API endpoints require authentication via integrated proxy server
- Some assets (images, fonts, stylesheets) may be missing and need to be recreated
- The original production app is at:
https://sites.motor.com/m1/
This application includes an integrated proxy server that handles authentication and API proxying automatically.
-
Configure credentials (one-time setup):
cd proxy-server cp .env.example .env # Edit .env and add your EBSCO password
-
Start the proxy server (Terminal 1):
cd proxy-server npm install npm startThe proxy will automatically authenticate with EBSCO on startup! β
-
Start the Angular app (Terminal 2):
npm install --legacy-peer-deps npm start
-
Use the app - All API requests (including assets) are automatically proxied with authentication!
π Detailed Instructions: See PROXY_INTEGRATION.md for complete setup guide. π API Documentation: See API_SCHEMA.md for complete API reference. β‘ Quick Reference: See API_QUICK_REFERENCE.md for common endpoints.
Deploy the Angular app to Firebase and proxy server to Vercel:
-
Deploy Proxy Server (Required First):
cd proxy-server npm install -g vercel vercel --prod -
Update Environment: Edit
src/environments/environment.prod.tswith your proxy URL -
Deploy to Firebase:
npm install -g firebase-tools firebase login npm run deploy
π₯ Complete Guide: See FIREBASE_DEPLOYMENT.md
Both proxy server and Angular app can be deployed to Vercel:
cd proxy-server
vercel --prod
# Then deploy Angular app
npm run build:prod
vercel --prodπ See proxy-server/VERCEL_DEPLOYMENT.md for complete deployment guide.
- Node.js 14.x or higher
- npm 6.x or higher
# Install dependencies
cd /Users/phobosair/unwebpack-sourcemap/output
npm install# Start dev server on http://localhost:4200
npm startThe application will automatically reload if you change any source files.
# Development build
npm run build
# Production build
npm run build:prodBuild artifacts will be stored in the dist/ directory.
The app connects to the Motor.com M1 API at https://sites.motor.com/m1/api/
All API requests require these headers:
{
'x-correlation-id': '<correlation-id>',
'x-session-id': '<session-id>',
'Authorization': 'Bearer <api-token>'
}You need to obtain credentials from the authentication endpoint (not included in extracted sources).
Edit src/app/app.module.ts:
ApiModule.forRoot({ rootUrl: 'https://sites.motor.com/m1' })Or use a proxy configuration for development (see below).
To avoid CORS issues during development, create proxy.conf.json:
{
"/api": {
"target": "https://sites.motor.com/m1",
"secure": true,
"changeOrigin": true,
"headers": {
"x-correlation-id": "YOUR_CORRELATION_ID",
"x-session-id": "YOUR_SESSION_ID",
"Authorization": "Bearer YOUR_TOKEN"
}
}
}Then update package.json start script:
"start": "ng serve --proxy-config proxy.conf.json"src/
βββ app/
β βββ app.component.ts # Root component
β βββ app.module.ts # Root module
β βββ app-routing.module.ts # Router configuration
β βββ assets/ # Assets state management
β βββ core/ # Core services & components
β β βββ components/ # Shared components (layout, nav, modals)
β β βββ state/ # Layout state (Akita)
β β βββ user-settings/ # User settings service
β βββ delta-report/ # Change tracking feature
β βββ directives/ # Custom directives (zoom, routing)
β βββ generated/ # Auto-generated API client
β β βββ api/
β β βββ models/ # TypeScript models
β β βββ services/ # API service classes
β βββ guards/ # Route guards
β βββ labor-operation/ # Labor operations feature
β βββ maintenance-schedules/ # Maintenance schedules feature
β βββ pipes/ # Custom pipes (SafeHtml)
β βββ search/ # Search feature with state
β βββ vehicle-selection/ # Vehicle selection feature
β βββ utilities.ts # Helper functions
βββ assets/ # Static assets
βββ environments/ # Environment configs
βββ main.ts # Application entry point
βββ polyfills.ts # Browser polyfills
The app uses Akita for state management with the Store β Query β Facade pattern:
- Layout Store - UI layout state
- Vehicle Selection Store - Selected vehicle (persisted to sessionStorage)
- Search Results Store - Search results and active article
- Filter Tabs Store - Search filter tabs
- Assets Store - Asset data
- Maintenance Schedules Store - Maintenance schedule data
Vehicle selection is persisted to sessionStorage with key 'selected-vehicle'.
/β Redirects to/vehicles/vehiclesβ Vehicle selection (Year/Make/Model)/docs/:filterTabβ Main content area with articles/maintenance-schedulesβ Maintenance schedules view/delta-reportβ Change tracking reports (guarded)/**β 404 Error page
GET /api/years- Get available yearsGET /api/year/{year}/makes- Get makes for yearGET /api/year/{year}/make/{make}/models- Get models
GET /api/source/{contentSource}/vehicle/{vehicleId}/articles/v2- Search articles
GET /api/source/{contentSource}/vehicle/{vehicleId}/article/{articleId}- Get articleGET /api/source/{contentSource}/vehicle/{vehicleId}/maintenance-schedules/...- Schedules
- Bookmark API - Manage bookmarks
- Parts API - Parts information
- UI API - UI configuration
- Error Logging API - Client error tracking
- Track Change API - Change tracking
- Logout API - Session termination
The app uses SCSS for styling with Bootstrap via @ng-bootstrap/ng-bootstrap.
Component-specific styles should be created as *.component.scss files.
- Angular 12.x - Framework
- Akita - State management
- ng-bootstrap - Bootstrap UI components
- ng-select - Advanced select dropdowns
- ngx-extended-pdf-viewer - PDF viewing
- RxJS 6.x - Reactive programming
- Missing Assets - Images, fonts, and some stylesheets extracted from sourcemaps may not work
- API Authentication - You need valid credentials to use the API
- CORS - Direct API calls from localhost may be blocked (use proxy)
- Component Styles - Some component SCSS files are missing and may need recreation
- Environment Variables - May need additional configuration
This code was extracted from production sourcemaps which exposed:
- Full application source code
- API structure and endpoints
- Business logic
- Authentication patterns
This is a security issue in the production deployment.
Create an HTTP interceptor to automatically add auth headers:
// src/app/core/auth.interceptor.ts
import { Injectable } from '@angular/core';
import { HttpInterceptor, HttpRequest, HttpHandler } from '@angular/common/http';
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler) {
const authReq = req.clone({
setHeaders: {
'x-correlation-id': 'YOUR_ID',
'x-session-id': 'YOUR_SESSION',
'Authorization': 'Bearer YOUR_TOKEN'
}
});
return next.handle(authReq);
}
}Register in app.module.ts:
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { AuthInterceptor } from './core/auth.interceptor';
providers: [
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }
]Enable Akita DevTools in development (already configured):
- Open browser DevTools
- Look for "Akita" tab
- Monitor state changes in real-time
This is a reverse-engineered application. Contributions should focus on:
- Recreating missing assets
- Documenting API endpoints
- Improving type safety
- Adding tests
Unknown - This code was extracted from a production application.
- API_SCHEMA.md - Complete API endpoint reference with request/response schemas
- API_QUICK_REFERENCE.md - Quick reference for common API endpoints
- PROXY_INTEGRATION.md - Complete proxy server integration guide
- Proxy Server README - Proxy server API documentation
- SETUP.md - Original setup notes
- PROJECT_STRUCTURE.md - Project organization guide
Articles from Motor.com often reference images, PDFs, and other assets using URLs like /api/assets/{unique-id}.
How it works:
- Article HTML contains:
<img src="/api/assets/abc-123-def" /> - Angular's
ProxyAuthInterceptorautomatically rewrites to:http://localhost:3001/api/motor-proxy/api/assets/abc-123-def - Proxy server forwards to Motor.com with authentication:
https://sites.motor.com/m1/api/assets/abc-123-def - Asset is returned with proper authentication and CORS headers
No special configuration needed - assets are automatically proxied! π
See API_SCHEMA.md for complete details on the /api/assets/{assetId} endpoint.
Generated from sourcemaps on October 20, 2025
Proxy integration added on October 23, 2025
API schema and asset proxying documented on October 31, 2025