Skip to content

Commit 62e7d53

Browse files
Refactor codebase into core and server subpackages
- Moved shared logic (config, exceptions, ignore_patterns, etc.) into `core/`. - Created `server/` to host FastAPI modules, static files, and templates. - Updated import paths for CLI and tests to reference `core.*` and `server.*`. - Changed static references from `"/static"` to `"/server/static"` and templates from `"/templates"` to `"/server/templates"`. - Adjusted references in `base.jinja`, `server/main.py`, `server/query_processor.py`, and routers to reflect the new server paths. - Ensured Docker builds now correctly serve static and template files from `server/`.
1 parent 3ce8e7e commit 62e7d53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+84
-93
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ USER appuser
4141

4242
EXPOSE 8000
4343

44-
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
44+
CMD ["python", "-m", "uvicorn", "server.main:app", "--host", "0.0.0.0", "--port", "8000"]

src/core/__init__.py

Whitespace-only changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pathlib import Path
77
from typing import Any
88

9-
from gitingest.exceptions import InvalidNotebookError
9+
from core.exceptions import InvalidNotebookError
1010

1111

1212
def process_notebook(file: Path, include_output: bool = True) -> str:
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66

77
import tiktoken
88

9-
from gitingest.exceptions import (
10-
AlreadyVisitedError,
11-
InvalidNotebookError,
12-
MaxFileSizeReachedError,
13-
MaxFilesReachedError,
14-
)
15-
from gitingest.notebook_utils import process_notebook
9+
from core.exceptions import AlreadyVisitedError, InvalidNotebookError, MaxFileSizeReachedError, MaxFilesReachedError
10+
from core.notebook_utils import process_notebook
1611

1712
MAX_FILE_SIZE = 10 * 1024 * 1024 # 10 MB
1813
MAX_DIRECTORY_DEPTH = 20 # Maximum depth of directory traversal
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
from typing import Any
1010
from urllib.parse import unquote, urlparse
1111

12-
from config import TMP_BASE_PATH
13-
from gitingest.exceptions import InvalidPatternError
14-
from gitingest.ignore_patterns import DEFAULT_IGNORE_PATTERNS
15-
from gitingest.repository_clone import _check_repo_exists, fetch_remote_branch_list
12+
from core.config import TMP_BASE_PATH
13+
from core.exceptions import InvalidPatternError
14+
from core.ignore_patterns import DEFAULT_IGNORE_PATTERNS
15+
from core.repository_clone import _check_repo_exists, fetch_remote_branch_list
1616

1717
HEX_DIGITS: set[str] = set(string.hexdigits)
1818

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import asyncio
44
from dataclasses import dataclass
55

6-
from gitingest.utils import async_timeout
6+
from core.utils import async_timeout
77

88
TIMEOUT: int = 20
99

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import inspect
55
import shutil
66

7-
from config import TMP_BASE_PATH
8-
from gitingest.query_ingestion import run_ingest_query
9-
from gitingest.query_parser import parse_query
10-
from gitingest.repository_clone import CloneConfig, clone_repo
7+
from core.config import TMP_BASE_PATH
8+
from core.query_ingestion import run_ingest_query
9+
from core.query_parser import parse_query
10+
from core.repository_clone import CloneConfig, clone_repo
1111

1212

1313
async def ingest(

0 commit comments

Comments
 (0)