A full-stack web application for musicians to track, analyze, and improve their practice sessions. Built with Django REST Framework and Next.js 15.
- Real-time Practice Timer - Start/stop timer with live duration tracking
- Session Management - Full CRUD operations for practice sessions
- Tag System - Organize sessions with custom colored tags
- Multiple Instruments - Track practice across different instruments
- Dashboard Stats - Total hours, weekly practice, current streak, favorite instrument
- Calendar Heatmap - 365-day practice activity visualization
- Instrument Breakdown - Pie chart showing time distribution across instruments
- Practice Trends - Line chart tracking session duration over time
- User Authentication - Secure registration and login with token-based auth
- Dark/Light Mode - Theme toggle with system preference detection
- Responsive Design - Mobile-friendly UI built with Tailwind CSS
- Interactive Charts - Dynamic visualizations using Chart.js
- Django 5.1.4
- Django REST Framework 3.15.2
- PostgreSQL (production) / SQLite (development)
- dj-rest-auth + django-allauth for authentication
- OpenAI API integration for practice recommendations
- drf-spectacular for API documentation
- Next.js 15 (App Router)
- TypeScript
- Tailwind CSS
- shadcn/ui components
- Chart.js + react-chartjs-2
- Axios for API calls
- Docker & Docker Compose
- CORS enabled for API access
MusiciansPracticeApp/
├── django_project/ # Django settings & configuration
├── accounts/ # User authentication app
│ └── models.py # CustomUser model
├── session/ # Practice session app
│ ├── models.py # Session & Tag models
│ ├── views.py # API endpoints
│ ├── serializers.py # DRF serializers
│ └── urls.py # API routes
├── frontend/next-app/ # Next.js 15 frontend
│ ├── src/app/ # App router pages
│ ├── src/components/ # React components
│ └── src/providers/ # Theme provider
├── manage.py # Django CLI
├── requirements.txt # Python dependencies
├── docker-compose.yml # Docker configuration
└── .env # Environment variables (not in repo)
- Python 3.10+
- Node.js 18+
- PostgreSQL (for production) or SQLite (for development)
- Docker (optional)
-
Clone the repository
git clone https://github.com/Dandiggas/MusiciansPracticeApp cd MusiciansPracticeApp -
Set up environment variables
Create a
.envfile in the root directory:SECRET_KEY=your-django-secret-key OPENAI_API_KEY=your-openai-api-key # Optional -
Backend Setup
# Create virtual environment python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Run migrations python3 manage.py migrate # Create superuser (for admin access) python3 manage.py createsuperuser # Start Django server python3 manage.py runserver
-
Frontend Setup
# In a new terminal cd frontend/next-app # Install dependencies npm install # Start development server npm run dev
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000/api/v1/
- Admin Panel: http://localhost:8000/admin
- API Docs: http://localhost:8000/api/schema/swagger-ui/
# Start both Django and PostgreSQL
docker-compose up
# Run migrations
docker-compose exec web python manage.py migrate
# Create superuser
docker-compose exec web python manage.py createsuperuserThen start the Next.js frontend separately:
cd frontend/next-app
npm install
npm run devPOST /api/v1/dj-rest-auth/login/- User loginPOST /api/v1/dj-rest-auth/registration/- User registrationPOST /api/v1/logout/- User logout
GET /api/v1/- List all sessionsPOST /api/v1/- Create new sessionGET /api/v1/<id>/- Get session detailsPUT /api/v1/<id>/- Update sessionDELETE /api/v1/<id>/- Delete session
GET /api/v1/tags/- List all tagsPOST /api/v1/tags/- Create new tagDELETE /api/v1/tags/<id>/- Delete tag
GET /api/v1/stats/- User practice statisticsGET /api/v1/calendar/?days=365- Calendar heatmap dataGET /api/v1/by-instrument/?days=30- Instrument breakdown
POST /api/v1/timer/start/- Start practice timerPOST /api/v1/timer/<id>/stop/- Stop timer and save sessionGET /api/v1/timer/active/- Get active timer status
POST /api/v1/recommendations/- Get AI practice recommendationsGET /api/v1/current-user/- Get current user info
For complete API documentation, visit the Swagger UI at http://localhost:8000/api/schema/swagger-ui/
Extends Django's AbstractUser with additional fields:
name- User's display name
Practice session model:
user- Foreign key to CustomUserinstrument- Instrument nameduration- Practice durationdescription- Session descriptionsession_date- Date of practicedisplay_id- User-specific session IDskill_level- Beginner/Intermediate/Advancedinstrument_preference- Primary instrumentgoals- Practice goalsin_progress- Active timer flagstarted_at- Timer start timestamppaused_duration- Cumulative pause timetags- Many-to-many relationship with Tag
Custom tags for organizing sessions:
name- Tag name (unique per user)color- Hex color codeuser- Foreign key to CustomUser
# Backend tests
python3 manage.py test
# Frontend tests (if configured)
cd frontend/next-app
npm test# Create new migrations
python3 manage.py makemigrations
# Apply migrations
python3 manage.py migrate
# Show migration status
python3 manage.py showmigrationsCreate a superuser to access the Django admin:
python3 manage.py createsuperuserThen visit http://localhost:8000/admin
- Timer pause/resume functionality
- Practice recommendations integration (frontend)
- Session filtering and search
- User profile editing
- Email verification
- Password reset functionality
- Social authentication
- Practice goal tracking
- Achievement system
- Export practice data (CSV/PDF)
- Add comprehensive test coverage
- Set up CI/CD pipeline
- Production environment configuration
- Performance optimization
- Error tracking (Sentry)
- Analytics integration
This is a personal project, but suggestions and feedback are welcome! Feel free to open an issue or submit a pull request.
This project is open source and available under the MIT License.
Created by Dandiggas
Note: This is a work in progress. Some features may be incomplete or under development.