Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
node_modules/
/.pnp
.pnp.*
.yarn/*
Expand Down Expand Up @@ -37,7 +37,7 @@ wheels/
/coverage

# next.js
/.next/
.next/
/out/

# production
Expand Down
107 changes: 0 additions & 107 deletions Dockerfile

This file was deleted.

5 changes: 3 additions & 2 deletions Ollama-instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ cp api/config/embedder.ollama.json.bak api/config/embedder.json

Start the backend:
```bash
pip install -r api/requirements.txt
python -m api.main
pip install -r backend/api/requirements.txt
cd backend && python -m api.main
```

Start the frontend:
```bash
cd frontend
npm install
npm run dev
```
Expand Down
37 changes: 21 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](./docs/README.md) | [简体中文](./docs/README.zh.md) | [繁體中文](./docs/README.zh-tw.md) | [日本語](./docs/README.ja.md) | [Español](./docs/README.es.md) | [한국어](./docs/README.kr.md) | [Tiếng Việt](./docs/README.vi.md) | [Português Brasileiro](./docs/README.pt-br.md) | [Français](./docs/README.fr.md) | [Русский](./docs/README.ru.md)

## ✨ Features

Expand Down Expand Up @@ -81,16 +81,17 @@ OLLAMA_HOST=your_ollama_host

```bash
# Install Python dependencies
pip install -r api/requirements.txt
pip install -r backend/api/requirements.txt

# Start the API server
python -m api.main
cd backend && python -m api.main
```

#### Step 3: Start the Frontend

```bash
# Install JavaScript dependencies
cd frontend
npm install
# or
yarn install
Expand Down Expand Up @@ -162,21 +163,25 @@ graph TD

```
deepwiki/
├── api/ # Backend API server
│ ├── main.py # API entry point
│ ├── api.py # FastAPI implementation
│ ├── rag.py # Retrieval Augmented Generation
│ ├── data_pipeline.py # Data processing utilities
│ └── requirements.txt # Python dependencies
├── backend/ # Backend API server
│ ├── api/ # API source code
│ │ ├── main.py # API entry point
│ │ ├── api.py # FastAPI implementation
│ │ ├── rag.py # Retrieval Augmented Generation
│ │ ├── data_pipeline.py # Data processing utilities
│ │ └── requirements.txt # Python dependencies
│ └── Dockerfile # Backend Docker configuration
├── src/ # Frontend Next.js app
├── frontend/ # Frontend Next.js app
│ ├── app/ # Next.js app directory
│ │ └── page.tsx # Main application page
│ └── components/ # React components
│ └── Mermaid.tsx # Mermaid diagram renderer
│ ├── components/ # React components
│ ├── lib/ # Utility libraries
│ ├── public/ # Static assets
│ ├── package.json # JavaScript dependencies
│ └── Dockerfile # Frontend Docker configuration
├── public/ # Static assets
├── package.json # JavaScript dependencies
├── docs/ # Documentation
├── docker-compose.yml # Docker Compose configuration
└── .env # Environment variables (create this)
```

Expand Down Expand Up @@ -452,7 +457,7 @@ The API server provides:
- RAG (Retrieval Augmented Generation)
- Streaming chat completions

For more details, see the [API README](./api/README.md).
For more details, see the [API README](./backend/api/README.md).

## 🔌 OpenRouter Integration

Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# backend/Dockerfile
FROM python:3.11-slim
WORKDIR /app

# Install curl for health checks
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY backend/api/requirements.txt ./api/
RUN python -m venv /opt/venv && \
/opt/venv/bin/pip install --no-cache -r api/requirements.txt

# Copy source
COPY backend/api/ ./api/

ENV PATH="/opt/venv/bin:$PATH"
ENV PORT=8001

# Health check endpoint is implemented at /health
EXPOSE 8001
CMD ["python", "-m", "api.main"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 28 additions & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
version: '3.8'

services:
deepwiki:
backend:
build:
context: .
dockerfile: Dockerfile
dockerfile: backend/Dockerfile
container_name: deepwiki-backend
ports:
- "${PORT:-8001}:${PORT:-8001}" # API port
- "3000:3000" # Next.js port
- "8001:8001"
env_file:
- .env
Comment on lines 9 to 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The new backend service is missing the volumes and resource limits (mem_limit, mem_reservation) that were present in the old deepwiki service.

  • Volumes: The removed volumes (~/.adalflow:/root/.adalflow and ./api/logs:/app/api/logs) were responsible for persisting repository data, embeddings, and logs. Without them, all this data will be lost when the container is stopped or restarted. This is likely a critical regression.
  • Resource Limits: The memory limits helped ensure the container doesn't consume excessive resources.

I recommend re-adding these configurations to the backend service to ensure data persistence and resource management.

    env_file:
      - .env
    volumes:
      - ~/.adalflow:/root/.adalflow      # Persist repository and embedding data
      - ./backend/api/logs:/app/api/logs # Persist log files across container restarts
    mem_limit: 6g
    mem_reservation: 2g

environment:
- PORT=${PORT:-8001}
- NODE_ENV=production
- SERVER_BASE_URL=http://localhost:${PORT:-8001}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- LOG_FILE_PATH=${LOG_FILE_PATH:-api/logs/application.log}
volumes:
- ~/.adalflow:/root/.adalflow # Persist repository and embedding data
- ./api/logs:/app/api/logs # Persist log files across container restarts
# Resource limits for docker-compose up (not Swarm mode)
mem_limit: 6g
mem_reservation: 2g
# Health check configuration
- ./backend/api/logs:/app/api/logs # Persist log files across container restarts
Comment on lines 9 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The backend service configuration is missing some environment variables (LOG_LEVEL, LOG_FILE_PATH) and resource limits (mem_limit, mem_reservation) that were present in the original deepwiki service. While these might be set in the .env file, explicitly defining them with defaults in the compose file improves clarity and makes the service more resilient. Resource limits are also important for production stability.

    env_file:
      - .env
    environment:
      - LOG_LEVEL=${LOG_LEVEL:-INFO}
      - LOG_FILE_PATH=${LOG_FILE_PATH:-/app/api/logs/application.log}
    volumes:
      - ~/.adalflow:/root/.adalflow      # Persist repository and embedding data
      - ./backend/api/logs:/app/api/logs # Persist log files across container restarts
    mem_limit: 6g
    mem_reservation: 2g

healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${PORT:-8001}/health"]
interval: 60s
timeout: 10s
test: ["CMD-SHELL", "curl -f http://localhost:8001/health || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s

frontend:
build:
context: .
dockerfile: frontend/Dockerfile
args:
- SERVER_BASE_URL=http://backend:8001
container_name: deepwiki-frontend
ports:
- "3000:3000"
environment:
- NODE_ENV=production
Comment on lines +29 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The frontend service needs to know how to communicate with the backend service. The next.config.ts file uses the SERVER_BASE_URL environment variable for this, but it's not set for the frontend service.

Without it, the frontend will default to http://localhost:8001, which will not resolve to the backend container. You should set SERVER_BASE_URL to http://backend:8001 so the frontend can reach the backend service within the Docker network.

    environment:
      - NODE_ENV=production
      - SERVER_BASE_URL=http://backend:8001

Comment on lines +29 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The frontend service needs to communicate with the backend service. The next.config.ts file uses process.env.SERVER_BASE_URL with a fallback to http://localhost:8001. Inside the frontend container, localhost refers to the container itself, not the backend container. To fix this, you should set SERVER_BASE_URL to http://backend:8001 in the frontend service's environment, as the services are on the same Docker network.

    environment:
      - NODE_ENV=production
      - SERVER_BASE_URL=http://backend:8001

- SERVER_BASE_URL=http://backend:8001
depends_on:
backend:
condition: service_healthy

networks:
default:
driver: bridge
2 changes: 1 addition & 1 deletion README.es.md → docs/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ Características

Expand Down
2 changes: 1 addition & 1 deletion README.fr.md → docs/README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ Fonctionnalités

Expand Down
2 changes: 1 addition & 1 deletion README.ja.md → docs/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ 特徴

Expand Down
2 changes: 1 addition & 1 deletion README.kr.md → docs/README.kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ 주요 기능

Expand Down
2 changes: 1 addition & 1 deletion README.pt-br.md → docs/README.pt-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ Recursos

Expand Down
2 changes: 1 addition & 1 deletion README.ru.md → docs/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ Возможности

Expand Down
4 changes: 2 additions & 2 deletions README.vi.md → docs/README.vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ Tính năng

Expand Down Expand Up @@ -243,7 +243,7 @@ API server cung cấp:
- RAG (Retrieval Augmented Generation)
- Trò chuyện liên tục

Biết thêm chi tiết truy cập [ API README](./api/README.md).
Biết thêm chi tiết truy cập [ API README](../api/README.md).

## 🤖 Hệ thống lựa chọn mô hình dựa trên nhà cung cấp

Expand Down
2 changes: 1 addition & 1 deletion README.zh-tw.md → docs/README.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ 特點

Expand Down
2 changes: 1 addition & 1 deletion README.zh.md → docs/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
[English](../README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)

## ✨ 特点

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading