How andonny1up/benigan works
Project Type and Purpose
• This is a Django-based full-stack web application (“Software SAS Para la administracion de ganaderia”) packaged with Docker Compose.
• Key features include a web frontend built with Django templates + Tailwind CSS and a PostgreSQL database back end.
File Structure
• Top-level files:
• Dockerfile & docker-compose.yml: container definitions
• .env.example: environment variables
• manage.py: Django CLI entry point
• package.json & src/input.css: Node/Tailwind CSS pipeline
• Directories:
• core/: Django project settings (asgi.py, wsgi.py, urls.py, static assets)
• livestockregistry/: Django app containing models.py, views.py, urls.py, templates/, forms.py, tests.py
• Recognize an MVT (Model-View-Template) pattern in Django.
README for Architecture Clues
• Services spun up via Docker Compose: web (Django/Python), node (for Tailwind build), db (PostgreSQL)
• Python ≥3.13.5, Node ≥20, Postgres are primary runtimes.
Main Components & How They Interact
a. User (Browser)
– Sends HTTP(S) requests, receives HTML/CSS/JS.
b. web Service (Django)
– Core settings & routing (core/urls.py → livestockregistry/urls.py).
– Handles authentication, CRUD of livestock, breeds, parent-child relationships.
– Loads environment variables from .env.
– Renders templates and serves dynamic content.
c. node Service (Tailwind CSS)
– Watches src/input.css, compiles to core/static/css/main.css.
– Rebuilds on file changes.
d. db Service (PostgreSQL)
– Stores all application data via Django ORM migrations.
e. Docker Compose Network
– Connects web, node, and db on an isolated bridge network.
Within the Django web service:
• Requests → URL router → Views
• Views ↔ Models (ORM) ↔ PostgreSQL
• Views → Templates + Static files → Response
Architectural Patterns and Design Principles
• MVT (Django’s variant of MVC): clear separation of models, views, templates.
• Containerization: each service in its own Docker container for environment isolation.
• Asset pipeline: Node container dedicated to CSS compilation.
• Single-host orchestration: Docker Compose for development and staging.
Putting It All Together
• Small text notes for key technologies: Django, Python, PostgreSQL, Tailwind CSS, Docker.