API-Manager/development
2025-09-03 15:09:27 +02:00
..
.env.example feature/Add development docker compose 2025-09-03 15:09:27 +02:00
dev-setup.sh feature/Add development docker compose 2025-09-03 15:09:27 +02:00
docker-compose.yml feature/Add development docker compose 2025-09-03 15:09:27 +02:00
docker-entrypoint-dev.sh feature/Add development docker compose 2025-09-03 15:09:27 +02:00
Dockerfile.dev feature/Add development docker compose 2025-09-03 15:09:27 +02:00
local_settings_dev.py feature/Add development docker compose 2025-09-03 15:09:27 +02:00
README.md feature/Add development docker compose 2025-09-03 15:09:27 +02:00
SETUP-COMPLETE.md feature/Add development docker compose 2025-09-03 15:09:27 +02:00

API Manager Development Environment

This folder contains Docker development setup for the Open Bank Project API Manager.

Quick Start

# 1. Navigate to development directory
cd development

# 2. Copy environment template
cp .env.example .env

# 3. Run the setup script
./dev-setup.sh

# 4. Access the application
open http://localhost:8000

What's Included

  • docker-compose.yml - Orchestrates web and database services
  • Dockerfile.dev - Development-optimized container image
  • local_settings_dev.py - Django development settings
  • docker-entrypoint-dev.sh - Container startup script
  • .env.example - Environment variables template

Services

  • api-manager-web - Django application (port 8000)
  • api-manager-db - PostgreSQL database (port 5434)

Features

Hot code reloading - changes reflect immediately
PostgreSQL database with persistent storage
Static files properly served
Automatic database migrations
Development superuser (admin/admin123)
OAuth integration with OBP API

Development Commands

# View logs
docker-compose logs api-manager-web

# Access container shell
docker-compose exec api-manager-web bash

# Django management commands
docker-compose exec api-manager-web bash -c 'cd apimanager && python manage.py shell'

# Database shell
docker-compose exec api-manager-db psql -U apimanager -d apimanager

# Stop services
docker-compose down

Configuration

The setup uses environment variables defined in .env:

  • OAUTH_CONSUMER_KEY - OAuth consumer key from OBP API
  • OAUTH_CONSUMER_SECRET - OAuth consumer secret from OBP API
  • API_HOST - OBP API server URL (default: http://host.docker.internal:8080)

Testing OAuth Integration

  1. Ensure OBP API is running on http://127.0.0.1:8080/ (accessible as host.docker.internal:8080 from containers)
  2. Start the development environment
  3. Navigate to http://localhost:8000
  4. Click "Proceed to authentication server" to test OAuth flow

Troubleshooting

  • Port conflicts: Database uses port 5434 to avoid conflicts
  • OAuth errors: Verify OAUTH_CONSUMER_KEY and OAUTH_CONSUMER_SECRET in .env
  • Connection refused to OBP API: The setup uses host.docker.internal:8080 to reach the host machine's OBP API from containers
  • Static files missing: Restart containers with docker-compose down && docker-compose up -d

Docker Networking

The development setup uses host.docker.internal:8080 to allow containers to access the OBP API running on the host machine at 127.0.0.1:8080. This is automatically configured in the docker-compose.yml file.

This development environment provides hot reloading and mirrors the production setup while remaining developer-friendly.