How rakaiskandar/sobat-hukum-be works
Main Components
• Django Configuration/Router: Represent the “config” module that includes the primary routing setup (in “urls.py”) and the server interface via WSGI/ASGI.
• API Modules: Break out the distinct Django apps:
– Cases: Responsible for case management, with dedicated models, serializers, views, and migrations.
– Chat: Designed for conversation functionalities, using both HTTP views and asynchronous consumers (as indicated by “consumers.py”).
– Documents: Handling document-related data.
– Users: Managing user-related information and authentication.
• Shared/Common Utilities: The “api/common” directory covers shared fields, permissions, and utility functions that are used across the apps.
• Database Layer: Represent the database that Django interacts with via its ORM. This includes tables/migrations for each app.
Relationships and Interactions
• How incoming HTTP requests are routed by the URLs configured in the “config/urls.py” into the appropriate Django app (cases, chat, documents, users).
• Within each app, display the flow: URL -> View -> Serializer (for parsing/validating data) -> Model -> Database.
• In the “chat” module, specifically indicate a branch for asynchronous communication (websocket consumer) and its interaction with the same data storage.
• Utility or common modules that are referenced by multiple apps. These should be drawn as supporting components that inject shared logic across other components.
Key Architectural Patterns and Technologies
• MVC/MVT pattern: Even though Django uses the Model-View-Template paradigm, note that the “views” and “serializers” serve as intermediate layers between models and client responses.
• Asynchronous Communication: Specifically note the “chat” module’s use of consumers for handling real-time messaging.
• Configuration and Dependency Management: Highlight the existence of configuration controls (i.e., “config/settings.py”, environment variables managed via the provided “.env.example”, and dependency management via “requirements.txt”).