How renuka010/vendorms works
Project’s Main Components
• REST API Layer: Highlight the endpoints for authentication and CRUD operations. This includes:
• Vendor endpoints (vendor_views.py)
• Purchase Order endpoints (purchase_order_views.py)
• Performance endpoints (performance_views.py)
• Webapp Module: This contains business logic centered around models, serializers, and signals.
• Models: Representing Vendor, PurchaseOrder, and Performance.
• Serializers: For JSON data handling and validation.
• Django Signals: Used to automatically trigger updates (especially for real-time metric updates).
• Scheduler Component: A dedicated component (scheduler.py) that runs background tasks (using APScheduler) to capture historical performance on a weekly basis.
• Database: Represented by an SQLite database (db.sqlite3). It shows that data storage is managed by Django ORM.
Component Interactions and Relationships
• The Client (Postman or any API consumer) interacts with the REST API layer over HTTP.
• The API views call the underlying business logic in the webapp module:
• They use serializers to validate and process incoming JSON data.
• They interact with the Django ORM via models.
• Django Signals are hooked into CRUD operations; these trigger events to update performance metrics in real-time.
• The Scheduler periodically triggers background processing to record historical vendor performance data.
• The database (SQLite) serves as the persistent data store for models.
Architectural Patterns and Principles
• Layered Architecture: Separate layers for request handling (views), business logic/data validation (serializers & signals), and persistence (models & database).
• Event-Driven Updates: Use of Django Signals for real-time metric updates.
• Background Tasks: Use of APScheduler (in scheduler.py) to manage periodic data recording.
• RESTful Design: Clear segregation of endpoints for vendors, purchase orders, and performance metrics.
Incorporate Technology Stack
• Django and Django Rest Framework are central in the backend component.
• SQLite is used for database interactions.
• APScheduler (inside scheduler.py) is used for periodic tasks.
• Token-based authentication is used for securing API endpoints.