File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from flask import Flask , jsonify , request
22from flask_cors import CORS
3- from app . services .topic_service import TopicService
4- from app . services .ai_service import AITopicProcessor
3+ from services .topic_service import TopicService
4+ from services .ai_service import AITopicProcessor
55
66app = Flask (__name__ )
77CORS (app , resources = {
@@ -77,4 +77,4 @@ def home():
7777 print ("Starting Flask server..." )
7878 port = 5002
7979 print (f"Server running on: http://127.0.0.1:{ port } " )
80- app .run (host = '127.0.0.1' , port = port , debug = True )
80+ app .run (host = '127.0.0.1' , port = port , debug = True )
Original file line number Diff line number Diff line change 11from collections import Counter
22import duckdb
3- from app . utils .cache import get_cached_topics , save_cached_topics
3+ from utils .cache import get_cached_topics , save_cached_topics
44import os
55
66class TopicService :
@@ -13,7 +13,7 @@ class TopicService:
1313 }
1414
1515 def __init__ (self ):
16- db_path = '../public/data/github_meta.duckdb'
16+ db_path = '../../ public/data/github_meta.duckdb'
1717
1818 # Check if database exists
1919 if os .path .exists (db_path ):
@@ -82,4 +82,4 @@ def process_topics(self, search_term: str):
8282 "success" : False ,
8383 "error" : str (e ),
8484 "message" : "An error occurred while processing the request"
85- }
85+ }
Original file line number Diff line number Diff line change 22import json
33
44def get_cached_topics (search_term ):
5- cache_file = Path ('../public/data/cached_topics' ) / f"{ search_term } .json"
5+ cache_file = Path ('../../ public/data/cached_topics' ) / f"{ search_term } .json"
66 if cache_file .exists ():
77 with open (cache_file , 'r' ) as f :
88 return json .load (f )
99 return None
1010
1111def save_cached_topics (search_term , topics_data ):
12- cache_dir = Path ('../public/data/cached_topics' )
12+ cache_dir = Path ('../../ public/data/cached_topics' )
1313 cache_dir .mkdir (exist_ok = True )
1414 cache_file = cache_dir / f"{ search_term } .json"
1515 with open (cache_file , 'w' ) as f :
16- json .dump (topics_data , f )
16+ json .dump (topics_data , f )
You can’t perform that action at this time.
0 commit comments