How takilu/edi-working works
Project Type and Purpose
• Full-stack web application for EDI-Community.
• Backend: Django REST framework with modular apps (accounts, contracts, training).
• Frontend: React/Vite single-page application (“frapp”).
• Deployment: Docker Compose with Nginx reverse proxy, media storage, static files.
File Structure
• Top level:
– Dockerfile, docker-compose.yml → defines container builds and orchestration.
– manage.py, edi/ → Django project entry point, settings, ASGI/WSGI.
– accounts/, contracts/, training/ → Django apps (models, views, serializers, URLs).
– frontend/frapp/ → React app (components, contexts, lib, assets).
– nginx/ → Nginx config for routing and SSL.
– media/, staticfiles/ → uploaded files and collected Django static assets.
– requirements.txt → Python dependencies; edi/requirements.txt for Django.
• Patterns:
– MVC (Django apps: Models → Views (REST endpoints) → Templates [n/a]).
– REST API layer between backend and frontend.
– Containerized micro-services style via Docker Compose.
README
• Minimal description: "This System created for EDI-Community".
• Implies core EDI features implemented across contracts, training, and account management.
Main Components
a. Client Layer
– Web Browser / SPA (React)
– Mobile clients (if any REST consumers)
b. Edge/Proxy Layer
– Nginx container:
• Serves React build (static files)
• Proxies API calls to Django backend
c. Frontend Layer
– React application (Vite dev server or built assets)
– Context/API module for authentication, data fetching
d. Backend Layer
– Django app container (ASGI/WSGI):
• Apps: accounts, contracts, training
• REST endpoints (Django REST framework)
• Business logic and serializers
e. Data Layer
– Database service (e.g., PostgreSQL container)
– media storage (mounted volume/container)
– staticfiles volume (collected static assets)
f. Orchestration Layer
– Docker Compose: defines services and networks
g. External Services (if applicable)
– Email/SMS gateway, third-party auth, payment gateway
Relationships and Data Flows
• User → HTTP(S) → Nginx
– GET “/” → React SPA served
– GET/POST “/api/…” → proxied to Django
• React → REST API → Django
– Auth flow (login/register → accounts)
– Data fetch/update (contracts, training)
• Django → Database
– ORM CRUD operations
• Django → Media/Static volumes
– File upload/download
• Docker Compose network connects all containers
Architectural Patterns
• Separation of concerns: UI vs API vs Data
• RESTful services in backend
• Containerization for environment consistency
• MVC (in Django)
• SPA pattern in frontend
• Volume mounting for persistent media/static storage
Relevant Technologies and Frameworks
• Frontend: React, Vite, JSX, Tailwind/UI components
• Backend: Python, Django, Django REST framework
• Infrastructure: Docker, Docker Compose, Nginx
• Database: PostgreSQL (or specified in compose)
• Authentication: JWT or session (AuthContext.jsx)
• CI/CD (optional): add if present