Thank you for your interest in contributing to the FertiScan backend project! Your contributions help make this project better for everyone. This guide will help you get started with contributing.
This project adheres to the Code of Conduct. By participating, you are expected to uphold this code.
If you find a bug, please create an issue and provide detailed information about the bug, including steps to reproduce it, the expected behavior, and the actual behavior.
We welcome suggestions for new features and enhancements. Please create an issue to discuss your ideas and explain the benefits and potential use cases.
Follow the guidelines in dev-rel-docs.
- Python 3.11+
- pip
- virtualenv
- Azure Document Intelligence and OpenAI API keys
-
Clone the repository:
git clone https://github.com/ai-cfia/fertiscan-backend.git cd fertiscan-backend
-
Install dependencies:
pip install -r requirements.txt
-
Start the server in development mode:
fastapi dev app/main.py --port 5000
-
Build the Docker image:
docker build -t fertiscan-backend \ --build-arg ARG_AZURE_API_ENDPOINT=your_azure_form_recognizer_endpoint \ --build-arg ARG_AZURE_API_KEY=your_azure_form_recognizer_key \ --build-arg ARG_AZURE_OPENAI_API_ENDPOINT=your_azure_openai_endpoint \ --build-arg ARG_AZURE_OPENAI_API_KEY=your_azure_openai_key \ --build-arg ARG_PROMPT_PATH=path/to/prompt_file \ --build-arg ARG_UPLOAD_PATH=path/to/upload_file \ --build-arg ALLOWED_ORIGINS=["http://url.to_frontend/"] \ .
-
Run the Docker container:
docker run -p 5000:5000 fertiscan-backend
Create a .env
file from .env.template
:
AZURE_API_ENDPOINT=your_azure_form_recognizer_endpoint
AZURE_API_KEY=your_azure_form_recognizer_key
AZURE_OPENAI_API_ENDPOINT=your_azure_openai_endpoint
AZURE_OPENAI_API_KEY=your_azure_openai_key
AZURE_OPENAI_DEPLOYMENT=your_azure_openai_deployment
FERTISCAN_DB_URL=your_fertiscan_db_url
FERTISCAN_SCHEMA=your_fertiscan_schema
UPLOAD_PATH=path/to/file
ALLOWED_ORIGINS=["http://url.to_frontend/"]
Follow Conventional Commits for writing commit messages.
Thank you for contributing to FertiScan!