A comprehensive Django-based productivity tracking application that enables users to create collaborative study/work rooms, manage sessions, track todos, and monitor progress through detailed statistics and leaderboards.
- Create password-protected rooms for collaborative sessions
- Room admin controls and member management
- Room-specific settings and configurations
- Room leaderboards to track member performance
- Admin-controlled session creation and management
- Session joining for room members
- Auto-end sessions with configurable deadlines (middleware-powered)
- Real-time deadline monitoring and automatic session termination
- Session-specific leaderboards and rankings
- Detailed session descriptions and metadata
- Personal todo creation and management within sessions
- Track completion times and progress
- Todo analytics and insights
- Time-based todo tracking with daily organization
- Personal Stats: Individual user performance metrics
- Session Stats: Detailed session analytics with charts
- Room Stats: Overall room performance tracking
- Interactive charts and visualizations
- Historical data analysis and trends
- Custom user authentication system
- User profiles with customizable settings
- Password change functionality
- User activity tracking (last online status)
- Permission-based access control
- Room leaderboards with total hours tracking
- Session rankings based on participation and completion
- Real-time ranking updates
- Performance comparison tools
- Admin notices and announcements
- Notice read status tracking
- HTML-formatted notices support
- User-specific notification preferences
- Custom signals for automated notification triggers
- One-click demo login from homepage
- Pre-populated demo user with sample data
- Demo tasks and sessions for immediate exploration
- Full feature showcase without registration required
- Backend: Django 4.x
- API: Django REST Framework
- Database: SQLite (development) / PostgreSQL (production ready)
- Authentication: Custom Django Authentication
- Frontend: Django Templates with HTML/CSS/JavaScript
- Testing: Django TestCase with 120+ test cases
- Advanced Django Features:
- Custom Middleware (3 implementations)
- Custom Signals for notifications
- Custom Mixins for access control
- Custom Permission Classes for API security
βββ api/ # RESTful API endpoints
βββ authapp/ # Authentication & user management
βββ challenge/ # Main Django project configuration
βββ pages/ # Core application logic
β βββ models.py # Database models
β βββ views.py # View controllers
β βββ urls.py # URL routing
β βββ forms.py # Django forms
β βββ middleware.py # Custom middleware implementations
β βββ signals.py # Custom signals for notifications
β βββ mixins.py # Custom mixins (Member/Admin/NotDemo)
β βββ permissions.py # Custom permission classes
β βββ templates/ # HTML templates
β βββ tests/ # Comprehensive test suite
βββ stats/ # Statistics & analytics
βββ static/ # Static assets
- Python 3.8+
- pip
- Git
-
Clone the repository
git clone https://github.com/Pr45H4nt/CtrlD cd CtrlD -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Run migrations
python manage.py migrate
-
Create superuser (optional)
python manage.py createsuperuser
-
Run the development server
python manage.py runserver
-
Access the application
- Open your browser to
http://127.0.0.1:8000/ - Admin panel:
http://127.0.0.1:8000/admin/
- Open your browser to
- Session Auto-End Middleware: Automatically terminates sessions when deadlines are reached
- Last Active Middleware: Tracks user activity and updates last online status
- Admin URL Protection Middleware: Restricts
/admin/access to admin users only (404 for regular users)
- Notification Signals: Automated notification triggers for system events
- User Activity Signals: Real-time user status updates
- Session Lifecycle Signals: Session start/end event handling
MemberRequiredMixin: Ensures only room/session members can access viewsAdminRequiredMixin: Restricts access to admin users onlyNotDemoUserMixin: Prevents demo users from performing certain actions
- MemberOnlyPermission: API access limited to room/session members
- AdminOnlyPermission: API endpoints restricted to administrators
- AllowAllPermission: Public API access with proper validation
The project includes a comprehensive test suite with 120+ test cases covering:
- Model functionality and relationships
- View logic and permissions
- API endpoints
- User authentication flows
- Room and session management
- Statistics calculations
Run all tests:
python manage.py testRun specific app tests:
python manage.py test authapp
python manage.py test pages
python manage.py test api
python manage.py test statsTest coverage:
- Authentication & User Management
- Room Creation & Management
- Session Lifecycle Management (including auto-end)
- Todo Operations
- Statistics Calculations
- API Endpoints & Custom Permissions
- Custom Middleware Functionality
- Custom Mixins & Access Control
- Signal Processing
- Demo User Functionality
- CustomUser: Extended user model with profile information
- Room: Collaborative spaces with password protection
- Session: Time-tracked work/study sessions
- Todo: Task management within sessions
- SessionRanking: Performance tracking and leaderboards
- Notice: System-wide notifications and announcements
The project includes a full REST API for:
- User authentication and management
- Room operations (CRUD)
- Session management
- Todo operations
- Statistics retrieval
- Real-time data updates
API documentation available at /api/ when running the development server.
- Demo Experience: Click "Demo Login" on homepage for instant access with sample data
- User Registration/Login: Create account or sign in for full functionality
- Room Creation: Create a new room or join existing one with password
- Session Management: Room admin starts a session with configurable deadline
- Todo Tracking: Members join session and add their todos
- Real-time Monitoring: Sessions auto-end when deadlines are reached
- Progress Analysis: Track completion and view comprehensive statistics
- Leaderboards: Compare performance with other members
- Pre-configured rooms and sessions
- Sample todos and completed tasks
- Historical statistics and charts
- Full leaderboard demonstrations
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you find a bug, please create an issue with:
- Bug description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
For support and questions, please open an issue in the GitHub repository.
Built with β€οΈ using Django