DDialog is an advanced, AI-powered conversation platform that enables meaningful interactions with your documents. It leverages OpenRouter API and FastAPI to provide intelligent responses based on your document context.
- ๐ง Integration with OpenRouter API for advanced language model capabilities
- ๐๏ธ Workspace-based document organization
- ๐ฌ Real-time chat interface with AI responses
- ๐ Support for document upload and management
- ๐ Dark/Light theme toggle
- ๐จ Customizable chat interface (font size, color)
- ๐ Built with modern technologies: React, TypeScript, FastAPI, and PostgreSQL
The project consists of two main components:
- Frontend (React + TypeScript + Vite)
- Backend (FastAPI + SQLAlchemy + PostgreSQL)
-
Clone the repository:
git clone https://github.com/yourusername/ddialog.git cd ddialog
-
Create a
.env
file in thebackend
directory and add your OpenRouter API key:OPENROUTER_API_KEY=your_api_key_here
-
Build and run the Docker containers:
docker compose -f docker-compose.dev.yml up --build
-
Access the application at
http://localhost:5173
-
Navigate to the backend directory:
cd backend
-
Install dependencies:
pip install -r requirements.txt
-
Set up the database:
alembic upgrade head
-
Run the FastAPI server:
uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
pnpm install
-
Run the development server:
pnpm run dev
-
Access the application at
http://localhost:5173
Once the backend is running, you can access the API documentation at http://localhost:8000/docs
main.py
: FastAPI application setup and configurationrouters/chat.py
: API routes for conversation and message handlingmodels.py
: SQLAlchemy models for database tablesschemas.py
: Pydantic models for data validationservices/llm_service.py
: Handles communication with the OpenRouter API
src/features/Chat/ChatWindow.tsx
: Main component for the chat interfacesrc/features/Workspace/WorkspaceMenu.tsx
: Component for managing workspacessrc/services/api.ts
: Axios setup for API communication
- Create a workspace
- Upload documents to the workspace
- Start a conversation in the chat window
- The AI will provide responses based on the uploaded documents and conversation context
- The project uses Alembic for database migrations
- Frontend styling is done using Tailwind CSS and Shadcn UI
- The application supports both light and dark modes
- CORS is configured for local development
- Frontend configuration files:
vite.config.ts
,tsconfig.json
,tailwind.config.js
,postcss.config.js
- Backend configuration:
.env
file for environment variables,alembic.ini
for database migrations
The project includes Dockerfiles for both frontend and backend, as well as a docker-compose.dev.yml
for easy development setup.
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature-name
- Submit a pull request
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- OpenRouter for their API
- FastAPI team for their excellent web framework
- React team for their powerful frontend library
- Tailwind CSS for the utility-first CSS framework
- Shadcn UI for the beautiful UI components
If you encounter any issues or have questions, please file an issue on the GitHub repository.
Happy chatting with DDialog! ๐