How indexstorm/git-rec-back works
Main Components
• API Server: The central application is built using Flask (located in app.py) and acts as the entrypoint for client requests.
• Embeddings/ML Module: The embeddings directory, which includes the “sbert.py” script, handles the creation of vector embeddings using the SBERT framework.
• Vector Search Engine: Although no dedicated service is shown in the file tree, FAISS is used as part of the similarity search process, so make sure to include a component indicating the vector storage and search mechanism.
• Docker Infrastructure: The “docker-compose.yml” and the Dockerfile under the “docker/ml” directory represent containerized components – these encapsulate the backend and potentially the ML service in isolated environments.
• External Clients: Represent browsers using the GitHub Recommender extension (Chrome/Firefox) that interact with this backend.
Relationships and Interactions
• API Workflow: When a request comes in (the client sending a repository description), the server invokes the SBERT-based embedding service (from embeddings/sbert.py) to compute a vector.
• Similarity Search: This vector is then compared against a precomputed FAISS-based index to find the nearest, similar vectors which represent other GitHub repositories.
• Response Flow: The result is then sent back to the client application.
Architectural Patterns and Design Principles
• Modularity: Clearly show the separation of concerns between the web server (Flask), the ML processing (SBERT embeddings), and the similarity search (FAISS). This modular structure not only improves maintainability but also potentially allows for future microservices or separate scaling for the ML components.
• API-Driven Architecture: Emphasize the RESTful interaction between clients and the backend, and the processing pipeline inside the server.
Technology Specifics
• Python 3.9 as runtime.
• Flask for the web server and API endpoint handling.
• SBERT from the sentence-transformers library for generating embeddings from repository descriptions.
• FAISS for fast vector searches (vector cosine similarity).
• Docker for containerizing components, facilitating development and deployment.
• Optionally, note by side labels the use of Python 3.9, Flask, SBERT, and FAISS for clarity.