This repository contains the CannaHealth analytics backend and the accompanying frontend used to review analysis snapshots. The backend now operates entirely on the Python standard library so that it can run in restricted environments without needing to download external dependencies.
Install the following tools before working with the project:
- Python 3.11 or newer
- Node.js 18+ with
npm - Git
- Create and activate a virtual environment.
- Install dependencies:
pip install -r web/backend/requirements.txt
- Execute the test suite:
python -m unittest discover web/backend/tests
- Install the Node.js dependencies:
cd web/frontend npm install - Run the lint checks and tests:
npm run lint npm test - Configure
NEXT_PUBLIC_API_BASE_URLto point at the backend's public URL. If no environment variable is provided the UI defaults tohttp://localhost:8000. - Build and start the Next.js frontend:
npm run dev # or npm run build npm run start
Validate the model manifest prior to committing model changes:
python tools/validate_model.py --model-dir model