Skip to content

Commit dde0cf9

Browse files
committed
Initialise matching service
1 parent 2b3c42f commit dde0cf9

File tree

12 files changed

+79
-0
lines changed

12 files changed

+79
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
__pycache__/
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.venv/
6+
venv/
7+
.git
8+
.gitignore
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__pycache__/
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.venv/
6+
venv/
7+
.env
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
COPY requirements.txt .
6+
RUN pip install --no-cache-dir -r requirements.txt
7+
8+
COPY ./app ./app
9+
10+
EXPOSE 8000
11+
12+
# Dev mode (reload)
13+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]

services/matching-service/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
run:
2+
uvicorn app.main:app --reload --port 8000
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Matching Service
2+
Overview
3+
The Matching Service is responsible for pairing users in PeerPrep based on selected topic, difficulty, and programming language. It manages user queues, handles match creation, and communicates with other services (User Service, Question Service, Collaboration Service).
4+
5+
This service is built using FastAPI and is designed to be containerised using Docker.
6+
7+
Features
8+
9+
- Join a match queue for a specific topic, difficulty, and programming language
10+
- Automatic peer matching from the queue
11+
- Cancel a queue request
12+
- Integration points for collaboration sessions
13+
- Health check endpoint for service monitoring

services/matching-service/app/__init__.py

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from fastapi import FastAPI
2+
from app.routers import hello
3+
4+
app = FastAPI()
5+
6+
app.include_router(hello.router)
7+
8+
@app.get("/")
9+
def root():
10+
return {"message": "Matching Service is running"}

services/matching-service/app/models/__init__.py

Whitespace-only changes.

services/matching-service/app/routers/__init__.py

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from fastapi import APIRouter
2+
3+
router = APIRouter()
4+
5+
@router.get("/hello")
6+
def hello():
7+
return {"message": "Hello from Matching Service!"}

0 commit comments

Comments
 (0)