A Django-based system for customer support teams to log end-of-shift reports and provide managers/supervisors with real-time visibility into team activities and performance.
accounts/– Custom user model and auth logicshifts/– Shift tracking and webhook triggersreports/– End-of-shift reporting and approval flow
-
Clone the repo:
git clone https://github.com/your-org/employee-activity-tracker.git cd employee-activity-tracker -
Create a virtual environment and install dependencies:
Linux python -m venv env source env/bin/activate Windows python -m venv env venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up .env and run migrations:
python manage.py makemigrations - schema version control python manage.py migrate - Applies changes
-
Run the server:
python manage.py runserver
- POST /login/ - User login
- POST /auth/register - User register
- POST /auth/logout/ - User logout
- POST /api/auth/refresh/ - Refresh JWT token. Also updates session-based auth tokens for compatibility with the accounts app.
Uses a custom AbstractUser model with email as the primary identifier.
Signals ensure automatic profile creation and token regeneration on user creation.
- GET /api/employees/ - List employees (paginated)
- GET /api/employees/{id}/ - Get employee details
- PUT /api/employees/{id}/ - Update employee profile
- GET /api/shifts/ - List shifts (with filters)
- POST /api/shifts/ - Create new shift
- GET /api/shifts/{id}/ - Get shift details
- PUT /api/shifts/{id}/ - Update shift
- PATCH /api/shifts/{id}/start/ - Start shift
- PATCH /api/shifts/{id}/end/ - End shift
- GET /api/reports/ - List reports (with filters)
- POST /api/reports/ - Submit new report
- GET /api/reports/{id}/ - Get report details
- PUT /api/reports/{id}/ - Update report (if not approved)
- PATCH /api/reports/{id}/approve/ - Approve report (supervisors/managers only)
- GET /api/reports/export/ - Export reports (CSV)(Future) ONCE VALIDATED with Frontend library
Webhooks are triggered on shift status changes (start/end). Implemented using Django signals and dispatched to registered endpoints test(https://webhook.site/).
Future support for multichannel registry.
- TokenAuth supported
- Role-based access control (supervisors, agents,admins)
- Input validation and permission checks
- CORS configured for deployment
- Database indexing on frequently queried fields (MySQL)
- Pagination via DRF’s
PageNumberPaginationsetting
- Modular design using ViewSets, signals, and custom user models.
- Webhook dispatch system for real-time notifications on shifts and reports. Testing ground (https://webhook.site/#!/view/a66fc247-bafa-41ce-93af-a408e52ea2b3)
- Python 3.9+
- Django 4.2+
- Django REST Framework
- MySQL 8.0+
- Git
- Code editor (Pycharm)
- Postman for endpoint tests
DRF Login (use case for SessionAuth) http://127.0.0.1:8000/accounts/api/login/
Authentication and permissions required for the view functionality (http://127.0.0.1:8000/cs/shifts/)