How joferdev2022/frontend_litmap_ai_tool works
1. Repository scope
- This is the frontend-only part of LitMap AI.
- It is an Angular 16 single-page application that acts as the user interface for a literature-mapping workflow, while delegating document processing and analysis to a separate FastAPI backend.
2. Overall application shape
- The app is organized around a root Angular shell, a shared UI layer, and several feature pages.
- The main user flow is: home/start → categorization → results, with a persistent navigation shell around the routed content.
3. Bootstrap and root composition
- main.ts boots the Angular app.
- AppModule and AppComponent form the application root.
- AppComponent is the top-level container that likely hosts the global layout and the router outlet.
4. Routing structure
- Routing is split into a root routing module plus feature routing modules.
- pages-routing.module.ts acts as the main feature entry point for page navigation.
- Each feature page has its own routing module:
- home-routing.module.ts
- categorization-routing.module.ts
- results-routing.module.ts
- This indicates route-level modularization, which helps separate page concerns and supports lazy-loading or isolated feature bundles.
5. Feature modules
- The main pages are split into dedicated Angular modules:
- HomeModule
- CategorizationModule
- ResultsModule
- PagesModule
- These modules isolate each stage of the workflow and keep page-specific logic separate from shared UI.
6. Shared UI components
- Reusable UI is grouped under src/app/components.
- The key shared components are:
- NavbarComponent
- SidebarComponent
- ComponentsModule likely exports these shared building blocks so they can be used across pages.
- This suggests a classic shell + feature content architecture: the shell provides global navigation, while routed pages fill the main area.
7. Page responsibilities
- HomeComponent is the entry point for the user journey, likely introducing the tool and starting the process.
- CategorizationComponent appears to represent the document-classification or screening step in the systematic mapping workflow.
- ResultsComponent is the output/visualization step where analysis outcomes are displayed.
- PagesComponent likely acts as a wrapper or container around the routed pages.
8. State and data flow
- The only service present is AnswersService.
- This suggests that shared state or workflow data is centralized in one Angular service, probably used to pass user inputs, document selections, or classification results between pages.
- Data flow is likely:
- user actions in page components
- shared state updates via AnswersService
- backend/API communication for analysis
- results rendered in the results page
9. Backend boundary
- The frontend is explicitly integrated with a REST API built in FastAPI.
- The boundary is clear: Angular handles interaction, navigation, and visualization; the backend handles the AI/document-processing logic.
- No backend code is included here, so the architecture diagram should show the backend as an external service consumed by the frontend.
10. Assets and presentation layer
- Static assets live under src/assets, including category-related images.
- Global styling is in styles.scss, while component-level styles are colocated with each component.
- This separation supports a presentation layer composed of reusable shell components and feature-specific page styling.
11. Deployment and runtime
- The app runs in the browser after being built with the Angular toolchain.
- Development uses the standard Angular CLI flow (ng serve).
- The README mentions a deployed frontend on Vercel, so the client is likely hosted as static assets behind a managed frontend deployment platform.
12. What is not in this repo
- There is no server, database, job queue, or ML pipeline in this repository.
- Those responsibilities are externalized to the FastAPI backend and any services it calls.
- For an architecture diagram, the frontend should be shown as a presentation and orchestration layer, not as the system of record or processing engine.
13. Best diagram boundaries
- Draw the system as:
- Browser / Angular SPA
- inside it: App shell, shared components, feature pages, shared service
- outside it: FastAPI backend API
- The primary interaction path is user-driven and route-driven, with the frontend coordinating workflow steps and presenting backend-generated outcomes.
Main entry points: pages-routing.module.ts Pages Routing · app.module.ts AppModule · app.component.ts AppComponent · components.module.ts ComponentsModule
Components 21
App shell
Root Angular bootstrap and global layout
- main.ts · Angular entry point
src/main.ts - AppModule · Root application module
src/app/app.module.ts - AppComponent · Top-level app container
src/app/app.component.ts - App Routing · Root router configuration
src/app/app-routing.module.ts
Shared UI
Reusable presentation components
- ComponentsModule · Shared UI exports
src/app/components/components.module.ts - Navbar · Top navigation bar
src/app/components/navbar/navbar.component.ts - Sidebar · Persistent side navigation
src/app/components/sidebar/sidebar.component.ts - AnswersService · Shared workflow state
src/app/services/answers.service.ts
Pages
Route-driven workflow stages
- PagesModule · Feature container for routed pages
src/app/pages/pages.module.ts - Pages Routing · Main page routing entry
src/app/pages/pages-routing.module.ts - PagesComponent · Wrapper around routed pages
src/app/pages/pages.component.ts - HomeModule · Home page feature module
src/app/pages/home/home.module.ts - Home Routing · Home route definition
src/app/pages/home/home-routing.module.ts - HomeComponent · Start page for the workflow
src/app/pages/home/home.component.ts - CategorizationModule · Categorization feature module
src/app/pages/categorization/categorization.module.ts - Categorization Routing · Categorization route definition
src/app/pages/categorization/categorization-routing.module.ts - CategorizationComponent · Screening and classification step
src/app/pages/categorization/categorization.component.ts - ResultsModule · Results feature module
src/app/pages/results/results.module.ts - Results Routing · Results route definition
src/app/pages/results/results-routing.module.ts - ResultsComponent · Output and visualization page
src/app/pages/results/results.component.ts
External API
Backend boundary outside this repository
- FastAPI API · Document processing and analysis backend
Connections 24
- main.ts → AppModule: boots · Angular bootstrap into root module
- AppModule → AppComponent: declares · Root module hosts the top-level shell
- AppModule → App Routing: imports · Connects application routing
- AppComponent → ComponentsModule: uses · Shell composes shared navigation UI
- AppComponent → PagesComponent: hosts · Router outlet renders page wrapper
- App Routing → Pages Routing: delegates · Root routes forward to page routes
- PagesModule → PagesComponent: declares · Page container module
- PagesModule → Pages Routing: imports · Feature routing for pages
- Pages Routing → HomeModule: routes to · Home route loads the home feature
- Pages Routing → CategorizationModule: routes to · Categorization route loads the workflow step
- Pages Routing → ResultsModule: routes to · Results route loads the output view
- HomeModule → HomeComponent: declares · Home page module
- HomeModule → Home Routing: imports · Home route configuration
- CategorizationModule → CategorizationComponent: declares · Categorization page module
- CategorizationModule → Categorization Routing: imports · Categorization route configuration
- ResultsModule → ResultsComponent: declares · Results page module
- ResultsModule → Results Routing: imports · Results route configuration
- ComponentsModule → Navbar: exports · Shared top navigation component
- ComponentsModule → Sidebar: exports · Shared side navigation component
- HomeComponent → AnswersService: reads/writes · Starts workflow state
- CategorizationComponent → AnswersService: reads/writes · Stores categorization progress
- ResultsComponent → AnswersService: reads · Consumes shared answers and results state
- CategorizationComponent → FastAPI API: calls · Sends documents for processing
- ResultsComponent → FastAPI API: fetches · Loads analysis outcomes for display