{"id":51632968,"url":"https://github.com/devbaraus/kuehne-server","last_synced_at":"2026-07-13T10:30:51.002Z","repository":{"id":330039866,"uuid":"1121382771","full_name":"devbaraus/kuehne-server","owner":"devbaraus","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-22T23:20:15.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-24T12:27:33.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devbaraus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-22T22:49:08.000Z","updated_at":"2025-12-22T23:20:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devbaraus/kuehne-server","commit_stats":null,"previous_names":["devbaraus/kuehne-server"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/devbaraus/kuehne-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbaraus%2Fkuehne-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbaraus%2Fkuehne-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbaraus%2Fkuehne-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbaraus%2Fkuehne-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devbaraus","download_url":"https://codeload.github.com/devbaraus/kuehne-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devbaraus%2Fkuehne-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35420322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-13T10:30:50.885Z","updated_at":"2026-07-13T10:30:50.998Z","avatar_url":"https://github.com/devbaraus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kuehne + Nagel Logistics API\n\nBackend API for managing locations and shipments with token-based auth, soft-delete, audit trails and generated OpenAPI docs.\n\n## Features\n- Python 3.14+ and Django 6 with Django REST Framework.\n- Token-based authentication with `django-rest-knox`.\n- Role-based access control: `admin`, `moderator`, `viewer`.\n- CRUD endpoints for `Location` and `Shipment` models with filtering and search.\n- Soft-delete functionality using `django-soft-delete`.\n- Audit logging of create/update/delete actions via `django-auditlog`.\n- Auto-generated OpenAPI schema and interactive docs with `drf-spectacular` and `django-scalar`.\n- PostgreSQL database backend with Docker Compose setup for local development.\n\n## Models\n- `Location`: warehouses/ports/airports with geographic metadata (latitude, longitude, city, country).\n- `Shipment`: origin/destination locations, tracking and order numbers, status lifecycle, and date checks.\n- `User`: email-as-username auth model; groups managed by `setup_roles` command to provision `admin`, `moderator`, `viewer` roles.\n\n## Getting started\nPrereqs: Python 3.14+, Poetry, Docker (for Postgres), and a `.env` with database and Django settings.\n\n1) Install deps\n```\npoetry install\n```\n\n2) Start Postgres (local dev)\n```\ndocker compose up -d postgres\n```\n\n3) Run migrations and seed roles\n```\npoetry run python manage.py migrate\npoetry run python manage.py setup_roles\n```\n\n4) Create a superuser (optional but useful)\n```\npoetry run python manage.py createsuperuser\n```\n\n5) Run the API\n```\npoetry run python manage.py runserver\n```\n\nAuthentication\n--------------\n- Obtain token: `POST /v1/auth/login/` with username/password → returns knox token and permissions.\n- Current user info: `GET /v1/auth/user/` with `Authorization: Token \u003ctoken\u003e`.\n- Logout: `POST /v1/auth/logout/`.\n\nAPI surface\n-----------\n- `GET/POST /v1/locations/` plus detail routes; filter by `type`, search by `name`, `city`, `country`.\n- `GET/POST /v1/shipments/` plus detail routes; filter by `status`, search across origin/destination, tracking, order numbers.\n- OpenAPI schema: `GET /v1/schema/`; Scalar UI: `GET /v1/docs/`.\n\nEnvironment variables\n---------------------\n- `DJANGO_SECRET_KEY` (required)\n- `DJANGO_DEBUG` (`True`/`False`, default `False`)\n- `DJANGO_ALLOWED_HOSTS` (comma-separated)\n- `CORS_ALLOWED_ORIGINS`, `CSRF_TRUSTED_ORIGINS` (comma-separated)\n- `DATABASE_NAME`, `DATABASE_USER`, `DATABASE_PASSWORD`, `DATABASE_HOST` (default `localhost`), `DATABASE_PORT` (default `5432`), `DATABASE_TEST_NAME` (default `test_db`)\n\nRunning tests\n-------------\n```\npoetry run python manage.py test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevbaraus%2Fkuehne-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevbaraus%2Fkuehne-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevbaraus%2Fkuehne-server/lists"}