The system repository hosts the final application of CodeMatch. In this repository, we outline the complete workflow, from retrieving code from the web to detecting code clones for a given code snippet. The system is divided into three core services: Backend, Frontend, and Vector Database.
-
Main Page: Enter the desired code snippet to find existing GitHub projects with similar code.
-
Similar GitHub Projects Page: Displays all the GitHub projects with code similar to the input.
The system consists of two main components essential for its operation:
This includes the structure of the backend and frontend, along with their integration with the database.
This step involves retrieving code projects from GitHub to populate the database with data.
(This step is done in the following process - populate_database.py)
-
Python: 3.9+
-
Docker Desktop:
Download Docker Desktop -
Qdrant:
Download and Run Qdrant – Follow the Download and Run section for installation. -
Node.js and npm:
a. Install from Node.js – Keep the option checked to install necessary tools.
b. Verify installation:npm -v
-
Clone the Repository:
git clone https://github.com/codematch-llm/system.git
-
Acquire Access to The-Stack-V2 Dataset:
a. Get access to The-Stack-V2 dataset
b. Create a Hugging Face personal access token
c. Add the token to the.env
file in the root directory:HUGGING_FACE_TOKEN=<paste your token here>
-
Ensure you are in the project root directory (
system
). -
Start all services:
docker-compose up
- This launches:
- Backend API at http://localhost:8000
- Frontend at http://localhost:8080
- Qdrant Dashboard at http://localhost:6333/dashboard
- This launches:
-
Populate the Database:
cd backend $env:PYTHONPATH = (Get-Location).Path # Ensure the path ends with 'backend' (check with `Write-Output $env:PYTHONPATH`) python populate_database.py
-
Backend:
cd backend pip install -r requirements.txt
-
Frontend:
cd frontend npm install
-
Ensure you are in the project root directory (ends with
system
). -
Terminal 1: Start the frontend:
cd frontend npm run serve
- Access the Vue.js frontend at http://localhost:8080.
-
Terminal 2: Start the backend:
$env:PYTHONPATH = (Get-Location).Path # Ensure the path ends with 'backend' (check with `Write-Output $env:PYTHONPATH`) cd backend uvicorn backend.main:app --reload
- The backend API will be available at http://localhost:8000.
-
Terminal 3: Start the Qdrant database:
If installed separately, run Qdrant per its documentation. If a script (qdrant_server.py
) is included in this project:cd backend python qdrant_server.py
-
Populate the Vector Database:
cd backend python populate_database.py
- Verify the database is populated by checking the Qdrant dashboard at http://localhost:6333/dashboard.