How sfbenitez/openform works
Project type and purpose
• This is a full-stack web application built in Django whose purpose is to let users model “infrastructure as code.”
• It exposes a browser-based UI where the user fills in forms (providers, flavors, instances, credentials), then generates Terraform HCL files and invokes Terraform to plan/apply against AWS, OpenStack, etc.
File structure
• Top-level:
• manage.py – Django CLI entrypoint
• openform/openform – the Django “project” (settings.py, urls.py, wsgi.py, plus models.py, forms.py, views.py)
• openform/generator – a Django “app” that encapsulates HCL generation logic, with submodules:
– instance (views & URL routes specific to instance generation)
– repository.py (state management / abstraction layer to persist Terraform plans)
– Jinja2 templates (.j2) under templates/plans for code generation
• templates/ – HTML templates for the UI (login, dashboards, plans, forms)
• static/ – front-end assets (Bootstrap, jQuery, DataTables, chart libs)
• db.sqlite3 – development database
• Configuration and deployment artifacts are minimal (no Dockerfile, no separate CI config).
README
• Confirms: uses Django + Terraform + HCL
• Primary workflows: form→generate HCL→call Terraform CLI→manage infra
• Mentions extensibility via multiple Terraform providers
Elements
• Clear labels for each component (Browser, Django Router, openform app, generator app, DB, FS, Terraform CLI, Cloud Providers)
• Browser → Django
• Django → DB / FS / CLI
• CLI → Cloud Providers → CLI → Django
• Django → Browser
• Front-end (e.g., blue rectangles)
• Back-end services (e.g., green rectangles)
Be detailed and capture essential elements
• Separate the two Django apps and show their own URL namespaces
• Template engine as the bridge between data models and UI
• Credentials management as part of the data-flow (from DB to generation)