How reshz18/employee-and-task-management-system works
Project Type and Purpose
• This is a full-stack, web-based Employee and Task Management System built with Django.
• It combines HTTP-driven CRUD interfaces, real-time communication (chat + video meetings), file management, and data analytics.
File Structure
• Top Level
• manage.py – Django’s command-line utility
• office_emp_proj/ – Django project settings (settings.py, urls.py, asgi.py, wsgi.py)
• emp_app/ – Core Django app: models, views, forms, admin, templates, consumers (WebSockets), routing, custom backends
• media/ – Uploaded files (profile_photos, task_files)
• db.sqlite3 (dev) or MySQL in production
• requirements.txt – Dependencies (Django, Channels, ReportLab, OpenPyXL, etc.)
• Patterns
• MVC (Models in models.py, Views in views.py & templates/, Controllers in urls.py + routing.py)
• Real-time via Django Channels (asgi.py, consumers.py, routing.py)
• File storage via media/ directory
• Admin interface via admin.py & Django Auth
README for Insights
• Backend: Python 3.8+, Django Framework
• Database: MySQL (configurable), SQLite for dev
• Real-Time: Django Channels (WebSockets)
• Frontend: HTML, CSS, Bootstrap templates
• Exporting: OpenPyXL (Excel), ReportLab (PDF)
• Video Meetings: Google-Meet style (likely via WebRTC or external embed)
Main Components
a. Client Layer
– Web Browser: HTML/CSS/Bootstrap, WebSocket client
b. Web Server Layer
– Django WSGI application (HTTP endpoints)
– Django ASGI application (WebSocket endpoints)
c. Business Logic Layer (emp_app)
– Models: Employee, Task, Attendance, Leave, Salary, Chatroom, etc.
– Views & Forms: HTTP handlers for CRUD, report exports
– Consumers: Chat & meeting signaling
– Custom Auth/Backends: Extended user roles, permissions
d. Data Layer
– Relational Database (MySQL/SQLite)
– File Storage (media/ for profile photos & task attachments)
e. External Services
– Google Meet / WebRTC servers (for video calls)
– Email SMTP (for notifications, if used)
– CORS proxy, if any
Relationships and Interactions
• HTTP Flow: Browser → (HTTPS) → Django WSGI → Views → Models → Database → Views → Templates → Browser
• WebSocket Flow: Browser WS → Django ASGI → Consumers → Models (chat history) → Broadcast to Clients
• File Upload/Download: Browser → Django View/Static Server → media/ storage → Database stores file paths
• Video Meeting Signaling: Browser ↔ ASGI/Consumers (offer/answer) → External STUN/TURN servers → Peer Media Streams
• Reporting: HTTP request → Views → OpenPyXL/ReportLab → Generated document → Browser download
Architectural Patterns and Design Principles
• MVC for request handling
• Layered architecture (Presentation, Business Logic, Data)
• Asynchronous event-driven for chat (Channels)
• Separation of concerns: templates vs. Python code vs. static/media
• Single-page sections (chat, dashboard) integrated into Django templates
Diagramming Recommendations
• Frontend (blue)
• Application Server (green)
• Data Storage (orange)
• External Services (gray)
• Rectangles for services/components
• Clouds for external dependencies
Detail
• Sub-components within emp_app: Models, Views, Templates, Consumers, Forms
• Routing: urls.py → view functions; routing.py → consumer classes
• Middleware or CORS headers if relevant
• Both synchronous (HTTP) and asynchronous (WebSocket) flows