AnnotationEngine is a Flask-based service for managing annotations in a PostgreSQL/PostGIS database using the DynamicAnnotationDB library. It provides a REST API and web interface for creating, managing, and querying annotation tables with support for spatial annotation data and user permissions on given tables.
git clone https://github.com/CAVEConnectome/AnnotationEngine.git
cd AnnotationEngine
pip install -r requirements.txt
# start all the services
docker compose up
# Start the PostgreSQL database (for local db debugging)
docker compose up -d db
# Optional: Start adminer for database management
docker compose up -d adminer
Required environment variables (see .env.dev as an example):
FLASK_CONFIGURATION=development # or production
POSTGRES_USER=postgres
POSTGRES_PASSWORD=yourpassword
POSTGRES_DB=annotation
AUTH_URI=your_auth_service
The service requires PostgreSQL with PostGIS extension. Configure the database connection in your environment or config file:
SQLALCHEMY_DATABASE_URI = "postgresql://user:password@localhost:5432/annotation"
- Install development requirements:
pip install -r dev_requirements.txt
- Run tests:
# this will create a temporary postgis database for testing
pytest --docker=true
Development server:
python run.py
The server will start on port 4001.
Full API documentation is available at /annotation/api/doc
when the server is running.
This project is licensed under the MIT License - see the LICENSE file for details.