Skip to content

Commit c0d8b71

Browse files
committed
update proxy and db path
1 parent 74ac517 commit c0d8b71

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

backend/app/services/topic_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ class TopicService:
1313
}
1414

1515
def __init__(self):
16-
db_path = '/home/user/projects/deepgit/public/data/github_meta.duckdb'
16+
db_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))), 'public', 'data', 'github_meta.duckdb')
1717

1818
# Check if database exists
1919
if os.path.exists(db_path):
2020
# Connect in read-only mode to avoid locking issues
2121
self.con = duckdb.connect(database=db_path, read_only=True)
22-
self.con.execute("SET threads TO 8;")
22+
self.con.execute("SET threads TO 2;")
23+
self.con.execute("SET memory_limit TO '0.5GB';")
2324
else:
2425
raise FileNotFoundError(
2526
f"Database not found at {db_path}. Please ensure the database file exists before running the application."

src/components/TopicRefiner.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
ThumbsUp,
1212
Settings
1313
} from "lucide-react";
14+
import { API_ENDPOINTS } from '../lib/config';
1415

1516
interface AIModel {
1617
id: string;
@@ -84,7 +85,7 @@ export const TopicRefiner: FC<TopicRefinerProps> = ({
8485
}
8586

8687
try {
87-
const response = await fetch('/api/ai-process', {
88+
const response = await fetch(API_ENDPOINTS.AI_PROCESS, {
8889
method: 'POST',
8990
headers: {
9091
'Content-Type': 'application/json',

src/lib/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Backend API configuration
2+
export const API_BASE_URL = 'http://127.0.0.1:5002';
3+
4+
// API endpoints
5+
export const API_ENDPOINTS = {
6+
PROCESS_TOPICS: `${API_BASE_URL}/api/process-topics`,
7+
AI_PROCESS: `${API_BASE_URL}/api/ai-process`,
8+
} as const;

src/views/TopicHistogram.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as d3 from "d3"; // Make sure to install @types/d3 and d3
77
// import { getErrorMessage } from "../lib/errors";
88
import { useNotifications } from "../lib/notifications";
99
import { TopicRefiner } from "../components/TopicRefiner";
10+
import { API_ENDPOINTS } from '../lib/config';
1011

1112
// Topic Histogram Component
1213
interface TopicHistogramProps {
@@ -173,7 +174,7 @@ const TopicHistogram: FC = () => {
173174

174175
setIsLoading(true);
175176

176-
fetch('/api/process-topics', {
177+
fetch(API_ENDPOINTS.PROCESS_TOPICS, {
177178
method: 'POST',
178179
headers: {
179180
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)