How camillepressense/pause_empathique works
Project type and purpose
• This is a monolithic, full-stack Django web application called “Pause Empathique,” designed to guide users through an empathic self-reflection journal inspired by Nonviolent Communication.
• Key goals: present a responsive UI (mobile/desktop), guide users through steps (Observation, Feelings, Needs), persist user entries in a relational database, and serve HTML via Django templates.
File structure
• Top-level scripts and configs
• Dockerfile, docker-compose.yml, .env.example → containerized deployment
• pyproject.toml, Poetry → dependency and environment management
• manage.py → Django CLI entry point
• Core Django project:
• pause_empathique/ → project settings (settings.py), URL dispatch (urls.py), ASGI/WGSI entrypoints
• Django application “users”:
• models.py, views.py, admin.py → MVC components for user and journal data
• migrations/ → database schema evolution
• tests.py → unit tests for app logic
• tests/ → end-to-end or integration test suite
• (Implicit) Frontend assets
• Tailwind CSS toolchain via Node.js (likely configured in package.json)—static files compiled into a static/ directory
• Django Templates for HTML pages under templates/
README for additional insights
• Backend stack: Django 5.2, PostgreSQL, Python 3.13
• Frontend stack: Tailwind CSS 4.1, vanilla JS, Django Templates
• Dev tools: Docker & Docker Compose, Poetry, Node.js (for CSS build)
• Future work: Alpine.js, data visualization, CI/CD, Railway deployment
a. Main components
1. Client (Browser/Mobile)
2. Load balancer or reverse proxy (e.g., Nginx) – optional, sits in front of the app
3. Django Application Container
– Gunicorn (WSGI) or Daphne (ASGI) server
– Django views, URL router, business logic
– Django templates + static files (Tailwind-compiled CSS, JS)
4. PostgreSQL Database Container
5. (Build-time) Node.js container or step for Tailwind CSS compilation
6. Docker-Compose orchestrator
b. Data flows & interactions
• Browser sends HTTP(S) requests → Nginx (reverse proxy) → Gunicorn/Daphne → Django URL router → views → ORM → PostgreSQL
• ORM maps to models and returns data → views render templates → static assets served by Nginx or Django static serve
• Docker-Compose brings up both web and DB containers, orchestrates network and environment variables
• Local development: manage.py commands (runserver, migrate, test) inside the web container
c. Architectural patterns
• monolithic MVC layered structure (presentation / business / data)
• Containerization pattern using Docker-Compose to isolate services
• Separation of concerns: CSS/JS build (Node) vs runtime (Django)
d. Key technologies
• Django 5.2, Gunicorn/Daphne, PostgreSQL
• Tailwind CSS (Node.js build), vanilla JavaScript, Django templates
• Docker, Docker-Compose, Poetry