backend/
├── app/ # Contains the main application code
│ ├── Api/ # Contains the API router for handling requests
│ │ └── router.py # Endpoints for FastAPI to test features and handle incoming requests
│ ├── chats/ # Handles chat functionalities
│ ├── Features/ # Contains feature-specific modules
│ │ ├── Feature1/
│ │ │ ├── core.py
│ │ │ ├── tools.py
│ │ │ ├── Prompt/
│ │ │ └── metadata.json
│ │ ├── Feature2/
│ │ │ ├── core.py
│ │ │ ├── tools.py
│ │ │ ├── Prompt/
│ │ │ └── metadata.json
│ ├── services/ # Contains service modules
│ ├── utils/ # Contains utility modules
│ ├── app.yaml # Application configuration file
│ ├── Dependencies.py # Dependency management
│ ├── Main.py # Main entry point for the application
│ └── requirements.txt # Python dependencies
├── Dockerfile # Dockerfile for containerizing the application
└── README.md # Documentation file
cd backend/app
python -m venv env
source env/bin/activate
pip install -r requirements.txt
.env
in the root of the project..env.example
file into the .env
file.ENV_TYPE
variable to dev
../local-start.sh
This guide is designed to help contributors set up and run the backend service using Docker. Follow these steps to ensure that your development environment is configured correctly.
Before you start, ensure you have the following installed:
Navigate to the project's root directory and build the Docker image. Typically, this is done with the following command:
docker build -t <image_name> .
Run the Docker container using the following command:
docker run -p 8000:8000 <image_name>
This command starts a detached container that maps port 8000 of the container to port 8000 on the host.
The Docker container uses several key environment variables:
LANGCHAIN_TRACING_V2
LANGCHAIN_ENDPOINT
LANGCHAIN_API_KEY
LANGCHAIN_PROJECT
You can access the backend by visiting:
http://localhost:8000/docs
After your container starts, you should see the FastAPI landing page, indicating that the application is running successfully.