The Urban Tree Observatory is a data-driven platform for monitoring and conserving urban trees in Ibagué, Colombia. The project centralizes tree data and tracks conservation efforts.
- Docker and Docker Compose
- Git
-
Clone this repository:
git clone https://github.com/OmdenaAI/GibdetColombiaChapter_UrbanTreeObservatory cd GibdetColombiaChapter_UrbanTreeObservatory -
Start the development environment:
docker compose up
-
Access the different components:
- Django backend: http://localhost:8000/
- Django admin: http://localhost:8000/admin/
- Angular frontend: http://localhost:4200/
- PostgreSQL database: localhost:5432
- PgAdmin: http://localhost:5050/
To connect to the database through PgAdmin:
- Go to http://localhost:5050/browser/
- Login with:
- Email: admin@omdena.com
- Password: admin
- Right-click on "Servers" and select "Register > Server"
- In the General tab, name it "Local PostgreSQL"
- In the Connection tab, enter:
- Host: db
- Port: 5432
- Database: urban_tree_db
- Username: postgres
- Password: postgres
After starting the containers for the first time, you'll need to create a superuser:
docker compose exec backend python manage.py createsuperuserTo get the initial data, you can use one of the following links:
To import initial data into the database:
-
Download the latest version of the CSV snd JSON files from the project's shared Google Drive.
-
Save the CSV files to
backend/data/csvand the JSON files tobackend/data/json. -
Run the import command:
docker compose exec backend python manage.py import_initial_data --local-dir=data
backend/- Django projectconfig/- Django project settingsapps/- Django appscore/- Core functionalityusers/- User managementplaces/- Geographic locations and spatial datataxonomy/- Family, genus, and species managementbiodiversity/- Tree data management with GISreports/- Tree measurements and observationsclimate/- Climate data management
frontend/- Angular applicationsrc/app/- Angular components and modulescore/- Core functionalityshared/- Shared componentsfeatures/- Feature modulesmap/- Map visualizationtrees/- Tree management interfacesreports/- Reporting interfaceanalysis/- Data analysis dashboards
- PostgreSQL with PostGIS for geospatial data
- Run the application with Docker Compose
- Make changes to your code (the development server will auto-reload)
- Run tests to verify your changes
- Commit and push your changes
This project uses pre-commit hooks to ensure code quality. To set up pre-commit:
# Install pre-commit
pip install pre-commit
# Install the git hooks
pre-commit installPre-commit will now run automatically on every commit. You can also run it manually:
pre-commit run --all-files# Backend tests
docker compose exec backend pytest
# Backend tests with coverage
docker compose exec backend pytest --cov=. --cov-config=.coveragerc
# Frontend tests
docker compose exec frontend ng testThe API documentation is available at:
- Swagger UI: http://localhost:8000/api/v1/swagger/
- ReDoc: http://localhost:8000/api/v1/redoc/