How bl19/sumhub works
Main Components
• User Interface / Frontend:
– Built using Next.js (React based) with server-side rendering.
– Handles page routing, SEO friendly content, and provides UI components (using Tailwind CSS and ShadCN UI).
– Exists as a separate module (“frontend/sumhub”) packaged into a Docker image.
• Backend API Server:
– An Express.js application running in Bun.
– Provides various API endpoints (e.g., /api/routes for paper search, get, and post operations).
– Serves as a bridge to database access and external services.
• Database Services:
– MongoDB Atlas is used to store all papers and supporting data.
– Pinecone acts as the vector database to store document embeddings.
• AI/Embedding Service:
– Google Gemini is used to generate 768-dimensional vectors for research papers.
• DevOps / CI-CD Pipeline:
– GitHub Actions (configured in the .github/workflows directory) to build and publish Docker images upon pushes to main.
– These images are pushed to Docker Hub (for both frontend and backend).
Relationships and Interactions
• Users access the frontend application via a web browser.
• The Frontend interacts with the Backend API for data fetching and search operations.
• The Backend communicates with two principal data stores: MongoDB Atlas (for structured paper metadata) and Pinecone (for vector search).
• Before or during the ingestion process, the Backend calls out to Google Gemini to obtain the embeddings.
• Both Frontend and Backend are independently containerized.
– Group them with “Docker Containers” and indicate their deployment via Docker Compose or Kubernetes.
• CI/CD Integration:
– Include “GitHub Actions” as a distinct component that pushes to “Docker Hub”.
Architectural Patterns and Design Principles
• Separation of Concerns:
– Differentiate the UI (Next.js) from the API & business logic (Express/Bun) and data management layers.
• Containerization & Continuous Deployment:
– Emphasize that both modules are built, tested, and deployed in isolation via Docker, fostering reproducible builds.
• Data Flow and Microservices Elements:
– Although not strictly microservices, the modular separation paints a similar picture: the Frontend consumes data from a clearly defined API, and the API further orchestrates between multiple services (MongoDB, Pinecone, Gemini).