How ivanbrillo/bioconnect works
Project Type & Purpose
• BioConnect is a back-end API service built in Java using Maven and following the Spring Boot framework.
• Its purpose appears to be the management and processing of biomedical-related data (drug documents, protein documents, graphs related to diseases and drugs, etc.) with built-in REST endpoints, authentication using JWT, and integration of various biomedical datasets.
• The presence of a Swagger folder and accompanying documentation suggests the API is well-documented and intended for client consumption (possibly by front-end UIs or third-party consumers).
Analyzing the File Structure
• The top-level “BioConnect” directory contains a standard Maven project structure:
• The “src/main/java” tree houses multiple packages such as controllers, services, repositories, configurations, security (JWT), DTOs, models, and exception handlers.
• The controllers are organized by resource type (for example, DrugDoc, ProteinDoc, various Graph controllers) supporting a layered MVC or more generally a layered service architecture.
• The services and repositories indicate clear separation of concerns (i.e., controllers delegate to services; services access the persistence layer via repositories).
• The “config” package holds database, security, and OpenAPI documentation configurations.
• The “JWT” package implements token filtering and token provisioning, crucial for security.
• Additional folders (dataset, Swagger, doc) indicate that the project integrates or demonstrates usage with various biomedical data sources and provides external API documentation via Swagger UI.
a. Main Components:
• Client / API Consumer: Represents front-end applications or external systems that interact with the API.
• API Gateway / REST Controllers: Modules like AdminController, AuthController, Document controllers (DrugDocController, ProteinDocController), Graph controllers (DiseaseGraphController, DrugGraphController, ProteinGraphController), etc.
• Business Logic / Service Layer: Includes services such as DrugDocService, ProteinDocService, DiseaseGraphService, etc., that contain the application’s core business logic.
• Data Persistence / Repository Layer: Repositories interacting with the underlying databases (document-oriented or possibly relational) as configured by DatabaseConfig.
• Security Layer: JWTTokenFilter, JWTTokenProvider along with SecurityConfig and MongoUserDetailsService handling authentication and authorization.
• External Interfaces: Swagger documentation (SwaggerUI), and integration with external datasets (as observed in the “dataset” folder) that might be used for initial data seeding or ongoing data processing.
• Configuration Components: Configuration classes for database connections (DatabaseConfig), OpenAPI (OpenApiConfig), and security.
b. Relationships and Interactions:
• Clients initiate API calls that pass through a security layer (JWTTokenFilter via Spring Security) before reaching the Controllers.
• Controllers handle the REST endpoints and forward requests to the Service layer.
• The Service layer processes business logic and interacts with the Repository layer to perform CRUD operations.
• Repositories link to the underlying database(s) as defined by DatabaseConfig.
• Some services may also make use of utility methods (GraphUtils) or specialized components (DatabaseOperationExecutor) for batch operations or complex queries.
• The Swagger UI acts as the interactive API documentation interface, enabling clients to explore and test endpoints.
• Additionally, the project includes scripts and datasets that show an integration pipeline for data ingestion (though these might be run separately, they influence the overall data handling strategy).
c. Architectural Patterns & Design Principles:
• The structure follows a layered architecture (Controller → Service → Repository) which is common to Spring Boot applications.
• It utilizes configuration-based dependency injection and aspect-oriented programming evident from the global exception handling and security configuration.
• JWT-based stateless authentication is implemented as a core security mechanism.
• Data transfer objects (DTOs) are used to decouple the domain models from external representations.
• There’s an emphasis on modularity (separate packages for documents, graphs, and user management) which promotes extensibility.
d. Relevant Technologies & Frameworks:
• Java with Spring Boot (via Maven): Core framework for application development.
• Spring Security & JWT: For authentication and stateless security management.
• Maven: For project build and dependency management.
• Swagger / OpenAPI: For API documentation and exploration.
• Data Access: Likely using Spring Data repositories (and Mongo DB integration suggested by “MongoUserDetailsService”) and perhaps a graph database based on the “GraphDB” dataset folder.
• Standard Java libraries and utility packages for processing and batch operations.
Specific Elements
• A “Client” block representing external users and other client systems.
• A “Security Layer” block (with JWTTokenFilter and SecurityConfig) positioned between the client and the core API.
• A “Controller Layer” block that lists the different controllers (AuthController, AdminController, Document Controllers, Graph Controllers, etc.).
• A “Service Layer” block that contains various business service components.
• A “Repository/Database” block showing interactions with databases (document databases, graph databases) as configured in DatabaseConfig.
• A “Configuration/Utility” block for components like OpenApiConfig, DatabaseOperationExecutor, and utility classes.
• A side component or note indicating the external datasets and scripts used for data ingestion and preparation.
• A Swagger UI block for API documentation/interaction, potentially connected back to the Client block.