(Le français est disponible au bas de la page)
Thank you for your interest in contributing to the FertiScan backend! 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.secrets.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!
Merci de votre intérêt pour contribuer au backend de FertiScan ! Vos contributions aident à améliorer ce projet pour tout le monde. Ce guide vous aidera à commencer.
- Code de conduite
- Comment contribuer
- Configuration pour le développement
- Guides de style
- Ressources supplémentaires
Ce projet adhère au Code de conduite. En participant, vous vous engagez à respecter ce code.
Si vous trouvez un bug, veuillez créer une issue et fournir des informations détaillées sur le problème, y compris les étapes pour le reproduire, le comportement attendu et le comportement réel.
Nous accueillons avec plaisir les suggestions pour de nouvelles fonctionnalités et améliorations. Veuillez créer une issue pour discuter de vos idées et expliquer les avantages et cas d'utilisation potentiels.
Suivez les directives dans dev-rel-docs.
- Python 3.11+
- pip
- virtualenv
- Clés API Azure Document Intelligence et OpenAI
-
Clonez le dépôt :
git clone https://github.com/ai-cfia/fertiscan-backend.git cd fertiscan-backend
-
Installez les dépendances :
pip install -r requirements.txt
-
Lancez le serveur en mode développement :
fastapi dev app/main.py --port 5000
-
Construisez l'image Docker :
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/"] \ .
-
Lancez le conteneur Docker :
docker run -p 5000:5000 fertiscan-backend
Créez un fichier .env
à partir de .env.secrets.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
PROMPT_PATH=path/to/file
UPLOAD_PATH=path/to/file
ALLOWED_ORIGINS=["http://url.to_frontend/"]
Suivez Conventional Commits pour rédiger les messages de commit.
Merci de contribuer à FertiScan !