How huyhoangbcvt/django_rest_template works
Project Type and Purpose
• This is a monolithic full‐stack web application built with Django and Django REST Framework.
• It serves both server‐rendered HTML pages (templates in each app) and RESTful JSON APIs (in each app’s apis/ and serializers).
• Main domains:
• user_app: authentication, profile management, admin docs
• catalog_app: product & category CRUD, comments, contact forms
• upload_app: file/image upload and display
High‐Level Architecture Overview
• Client Layer
• Web browsers or mobile frontends
• Load HTML (templates + static assets) and invoke REST endpoints (AJAX/fetch)
• Web / Application Layer (Django monolith)
• Reverse proxy (e.g., Nginx) → WSGI/ASGI server (Gunicorn/Daphne)
• Django project django_rest_template: settings, URL dispatch, middleware
• Three Django apps (user_app, catalog_app, upload_app)
– Each app provides: models, views (Django views + DRF viewsets or function‐based views in apis/), serializers, URLs
– Modules subfolders (form controllers, view controllers) implement MVC separation internally
• API Documentation via drf‐yasg (Swagger / Redoc) under /api/swagger/ and /api/redoc/
• Data Storage Layer
• PostgreSQL for relational data (accounts, products, categories, uploaded file metadata)
• Local file system (or object storage) for media uploads (media/ directory)
• Static files served from static/ directory (CSS/JS frameworks, CKEditor, Bootstrap, jQuery plugins)