How biocomputingup/dome-registry works
Project type and purpose
• This is a full-stack web application, the DOME Registry, composed of three NPM packages:
• dome-registry-core: a shared TypeScript library with business logic used by both front- and back-end.
• dome-registry-ui: an Angular single-page application (SPA) that provides the user interface.
• dome-registry-ws: a NestJS-based web service (REST API) that implements the server side, data persistence, authentication, and integrations.
File structure
• Top-level directories:
• dome-registry-core/ – shared modules, utility functions, review logic, built with Webpack for distribution.
• dome-registry-ui/ – Angular CLI project: components (pages, services, directives, assets), environment configs, build scripts.
• dome-registry-ws/ – NestJS project: modules (app, review, user, ORCID OAuth, JWT-auth, email, caching, Apicuron integration), controllers, services, DTOs, schemas, scripts, Swagger setup, tests.
• Notice architectural pattern in the WS: NestJS modules follow a layered approach (controllers → services → data schemas), with cross-cutting concerns (auth guards, interceptors, caching decorators).
Extract insights from the README
• The README confirms the three-part split and gives installation, linking, and run instructions.
• The UI is served by Apache/nginx in production; the WS runs on Node with npm run start:dev.
• dome-registry-core is linked into both UI and WS via npm link to share type definitions and logic.
Main components
a. Frontend (Angular SPA)
– Components/pages, AuthInterceptor, ReviewService, UserService
– Consumes REST endpoints exposed by dome-registry-ws
b. Backend (NestJS web service)
– API Gateway layer: controllers (review, user, ORCID, JSON-LD, documents)
– Business logic: services orchestrating review workflows, ORCID integration, email notifications, caching
– Data layer: schemas (MongoDB via Mongoose or a similar ODM)
– Shared core logic: imported from dome-registry-core for review-specific utilities
c. Database
– A persistent store (e.g., MongoDB) mapping to the WS schemas
d. External services
– ORCID OAuth provider (authentication, identity checks)
– Apicuron subscription API (apicuron-sub module)
– Email system (SMTP or an email-as-a-service client)
e. Cross-cutting infrastructure
– Caching (Redis or in-memory) via cache-decorator
– JWT auth guard/strategy
– Swagger (API documentation module)
Relationships & interactions
• Angular UI → HTTP(S) requests → NestJS controllers.
• Controllers invoke Services → apply business rules → read/write to Database.
• Certain operations trigger:
• Email client for notifications
• ORCID OAuth strategy for user identity
• Apicuron client for external subscription events
• Cache decorator wraps selected Service methods to reduce load.
• dome-registry-core functions are invoked by both UI (for shared types, review form logic) and WS (for shared review validations).
Architectural patterns & design principles
• Separation of concerns: UI vs. API vs. core library
• Modular backend: NestJS modules for each domain (review, user, auth, OAuth, email, caching)
• Dependency injection: services injected into controllers and other services
• Layered architecture in WS: Controllers → Services → Data/Schemas
• Shared code extracted into a standalone package (core) for DRY and consistency
Essential details to capture
• The three‐package split (core, ui, ws) and how core is linked
• Angular’s AuthInterceptor enforcing JWT on every request
• NestJS modules (ORCID, JWT-auth, Apicuron, Email, Review, User)
• DB persistence and cache decorator placement
• External integrations (ORCID OAuth, Apicuron events, email notifications)