This is the backend server for the DAOMatcher project. Follow the instructions below to set up and run the server locally.
Before you begin, ensure you have the following installed on your machine:
- Python (version 3.11)
- Poetry (for dependency management and virtual environments)
- Python venv (virtual environment module)
-
Clone the Repository
Clone this repository to your local machine using the following command:
git clone https://github.com/your-username/DAOMatcher-backend.git
-
Navigate to the Project Directory
Change to the project directory:
cd DAOMatcher-backend
-
Install Dependencies
Install the project dependencies using Poetry:
poetry install
-
Activate the Virtual Environment
Activate the virtual environment:
poetry shell
-
Set Up Environment Variables
Copy the
.env.example
file to.env
and update the values as needed:cp .env.example .env
Open the
.env
file and set the appropriate values for your environment. -
Run the Setup Script
Run the setup script to initialize the project and run the server:
./setup
You can either wait for the server to finish processing or connect to the WebSocket on the update
event from your client to get live updates from the server. To get updates from the WebSocket, you must initiate the request using the get_users
event on the WebSocket server first.
The project includes model-based evaluation tests to assess prompt efficiency. To run the tests, follow these steps:
-
Activate the Virtual Environment (if not already activated):
poetry shell
-
Run the Tests
Run the tests using pytest:
pytest test_model_graded_eval.py
To see more detailed output, use:
pytest test_model_graded_eval.py -s
You can also use Docker to set up everything locally and run the application.
Docker build and tag
docker build -t daomatcher:latest .
Docker run
docker run -it daomatcher:latest
Feel free to reach out if you have any questions or encounter any issues.
Happy coding!