A modern, scalable bug tracking application built with cutting-edge technologies. Streamline issue management, enhance team collaboration, and boost productivity with advanced features and best practices.
- JWT-based authentication with refresh tokens
- Role-based access control (RBAC)
- Secure password hashing and validation
- CORS protection and CSRF mitigation
- Token blacklisting for enhanced security
- Full CRUD operations for issues
- Priority levels (Low, Medium, High, Critical)
- Status tracking (Open, In Progress, Closed)
- Advanced filtering and search capabilities
- Real-time status updates
- Multi-user project management
- Comment system for issue discussions
- User assignment and reassignment
- Activity tracking and audit logs
- Email notifications (planned)
- Responsive design with Tailwind CSS
- Dark/light theme support (planned)
- Mobile-first approach
- Intuitive navigation and user flows
- Accessibility compliance (WCAG 2.1)
- Hot reload development servers
- Comprehensive API documentation
- Automated testing with 92% coverage
- Docker containerization
- CI/CD ready configuration
graph TB
A[React 18 Frontend] --> B[REST API]
B --> C[Django REST Framework]
C --> D[Django 4.2]
D --> E[PostgreSQL 15]
D --> F[Redis Cache - Planned]
C --> G[JWT Authentication]
C --> H[Swagger/OpenAPI]
- Django 4.2 - High-level Python web framework
- Django REST Framework 3.14 - Powerful API toolkit
- PostgreSQL 15 - Advanced open-source database
- Simple JWT - JSON Web Token authentication
- drf-spectacular - API documentation generation
- Gunicorn - Python WSGI HTTP Server
- pytest - Testing framework with 92% coverage
- React 18 - Declarative UI library with concurrent features
- React Router v6 - Declarative routing for React
- Axios - Promise-based HTTP client
- Tailwind CSS - Utility-first CSS framework
- Lucide React - Beautiful icon library
- React Toastify - Toast notifications
- Docker & Docker Compose - Containerization
- PostgreSQL - Primary database
- Gunicorn - Production WSGI server
- Nginx - Reverse proxy (planned)
- Redis - Caching layer (planned)
- Celery - Background task processing (planned)
- Python 3.12+ - Latest Python features
- Node.js 18+ - JavaScript runtime
- GitHub Actions - CI/CD pipelines (planned)
- Pre-commit hooks - Code quality enforcement
- ESLint & Prettier - Code formatting
- Black & isort - Python code formatting
bug-reporting-system/
βββ backend/
β βββ manage.py
β βββ requirements.txt
β βββ Dockerfile
β βββ pytest.ini
β βββ conftest.py
β βββ bug_tracking/
β β βββ settings.py
β β βββ urls.py
β β βββ wsgi.py
β β βββ exception_handler.py
β βββ accounts/
β β βββ models.py
β β βββ serializers.py
β β βββ views.py
β β βββ urls.py
β β βββ admin.py
β β βββ tests.py
β βββ projects/
β β βββ models.py
β β βββ serializers.py
β β βββ views.py
β β βββ urls.py
β β βββ admin.py
β β βββ tests.py
β βββ issues/
β β βββ models.py
β β βββ serializers.py
β β βββ views.py
β β βββ permissions.py
β β βββ urls.py
β β βββ admin.py
β β βββ tests.py
β βββ comments/
β βββ models.py
β βββ serializers.py
β βββ views.py
β βββ urls.py
β βββ admin.py
β βββ tests.py
βββ frontend/
β βββ public/
β β βββ index.html
β βββ src/
β β βββ components/
β β β βββ Navbar.js
β β β βββ PrivateRoute.js
β β β βββ LoadingSpinner.js
β β βββ contexts/
β β β βββ AuthContext.js
β β βββ pages/
β β β βββ LoginPage.js
β β β βββ RegisterPage.js
β β β βββ DashboardPage.js
β β β βββ IssueListPage.js
β β β βββ IssueDetailPage.js
β β βββ services/
β β β βββ api.js
β β βββ App.js
β β βββ index.js
β β βββ index.css
β βββ package.json
β βββ tailwind.config.js
β βββ postcss.config.js
β βββ Dockerfile
β βββ .env.example
βββ docker-compose.yml
βββ README.md
- Python 3.12+ - Latest Python with advanced features
- Node.js 18+ - Modern JavaScript runtime with ES modules
- PostgreSQL 15+ - Advanced database features
- Docker & Docker Compose - Containerization platform
- Git - Version control system
git clone https://github.com/mangeshraut712/Bug-Reporting-System.git
cd Bug-Reporting-System
docker-compose up -dThat's it! The application will be running at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/api/docs/
- Clone the repository:
git clone https://github.com/mangeshraut712/Bug-Reporting-System.git
cd Bug-Reporting-System/backend- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create .env file:
cp .env.example .env- Run migrations:
python manage.py migrate- Create a superuser:
python manage.py createsuperuser- Run the development server:
python manage.py runserverThe backend API will be available at http://localhost:8000
API documentation: http://localhost:8000/api/docs/
Admin panel: http://localhost:8000/admin/
- Navigate to frontend directory:
cd ../frontend- Install dependencies:
npm install- Create .env file:
cp .env.example .env- Start the development server:
npm startThe frontend will be available at http://localhost:3000
POST /api/auth/register/- Register a new userPOST /api/auth/login/- Login userPOST /api/auth/logout/- Logout userGET /api/auth/users/me/- Get current user
GET /api/projects/- List all projectsPOST /api/projects/- Create a new projectGET /api/projects/{id}/- Retrieve a projectPATCH /api/projects/{id}/- Update a projectDELETE /api/projects/{id}/- Delete a projectGET /api/projects/{id}/issues/- Get issues for a project
GET /api/issues/- List all issuesPOST /api/issues/- Create a new issueGET /api/issues/{id}/- Retrieve an issuePATCH /api/issues/{id}/- Update an issueDELETE /api/issues/{id}/- Delete an issuePATCH /api/issues/{id}/update_status/- Update issue statusPATCH /api/issues/{id}/assign/- Assign an issuePOST /api/issues/create-for-project/{project_id}/- Create issue for project
GET /api/comments/- List all commentsPOST /api/comments/- Create a new commentGET /api/comments/{id}/- Retrieve a commentPATCH /api/comments/{id}/- Update a commentDELETE /api/comments/{id}/- Delete a commentPOST /api/comments/create-for-issue/{issue_id}/- Create comment for issue
- Build and start services:
docker-compose up -d- Run migrations:
docker-compose exec backend python manage.py migrate- Create superuser:
docker-compose exec backend python manage.py createsuperuserServices will be available at:
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:8000 - API Docs:
http://localhost:8000/api/docs/ - Database:
localhost:5432
docker-compose down33 Test Cases Implemented:
- Accounts: 5 tests (registration, login, authentication)
- Projects: 7 tests (CRUD, filtering, relationships)
- Issues: 11 tests (CRUD, status updates, permissions)
- Comments: 10 tests (CRUD, filtering, relationships)
# Run all tests
pytest
# Run with coverage report
pytest --cov=. --cov-report=html
# Run specific test file
pytest accounts/tests.py
# Run specific test class
pytest projects/tests.py::TestProjectEndpoints
# Run specific test
pytest issues/tests.py::TestIssueEndpoints::test_create_issue
# Run with verbose output
pytest -v
# Run with coverage and HTML report
pytest --cov=. --cov-report=html --cov-report=term-missing======================= 33 passed, 105 warnings in 3.50s =======================
Coverage: 92% (725 lines tested)
api_client- Unauthenticated API clientuser- Test useranother_user- Second test userauthenticated_client- Authenticated API clientauthenticated_client_other- Authenticated client for different userproject- Test projectissue- Test issuecomment- Test comment
SECRET_KEY=your-secret-key-here-change-in-production
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# Database
DB_ENGINE=django.db.backends.sqlite3
DB_NAME=db.sqlite3
# For PostgreSQL:
# DB_ENGINE=django.db.backends.postgresql
# DB_NAME=bug_tracking
# DB_USER=postgres
# DB_PASSWORD=your-password
# DB_HOST=localhost
# DB_PORT=5432
# CORS
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
REACT_APP_API_URL=http://localhost:8000/api
- User registers with email, username, and password
- User logs in with email and password
- Backend returns JWT access and refresh tokens
- Frontend stores tokens in localStorage
- Axios interceptor automatically adds Authorization header to requests
- If token expires, user is redirected to login page
- email (unique)
- username (unique)
- first_name
- last_name
- password (hashed)
- name
- description
- created_by (ForeignKey to User)
- created_at
- updated_at
- title
- description
- status (open, in_progress, closed)
- priority (low, medium, high, critical)
- project (ForeignKey to Project)
- reporter (ForeignKey to User)
- assignee (ForeignKey to User, nullable)
- created_at
- updated_at
- content
- issue (ForeignKey to Issue)
- author (ForeignKey to User)
- created_at
- updated_at
- IsAuthenticated: All API endpoints require authentication
- IsReporterOrAssignee: Only issue reporter or assignee can update issue status/assignee
- JWT Tokens: Stateless authentication with access/refresh token pattern
- Password Security: Django's built-in password hashing (PBKDF2 + SHA256)
- Token Blacklisting: Automatic token invalidation on logout
- CORS Protection: Configured allowed origins for cross-origin requests
- CSRF Protection: Django's CSRF middleware for form security
- Input Validation: Comprehensive serializers with field validation
- SQL Injection Prevention: Django ORM with parameterized queries
- XSS Protection: React's built-in XSS prevention
- Rate Limiting: Planned implementation for API endpoints
- Data Encryption: Secure storage of sensitive information
- Permission Classes: Granular access control per endpoint
- Request Throttling: Configurable rate limits (planned)
- Audit Logging: Comprehensive logging of user actions
- Secure Headers: Security middleware for production deployment
- Resource-Based URLs: Intuitive, hierarchical URL structure
- HTTP Methods: Proper use of GET, POST, PATCH, DELETE
- Status Codes: Appropriate HTTP status codes for all responses
- Content Negotiation: JSON responses with proper content types
- Versioning: API versioning strategy for future compatibility
- Filtering & Search: Query parameters for complex data retrieval
- Pagination: Efficient data pagination for large datasets
- Sorting: Multi-field sorting capabilities
- Field Selection: Sparse fieldsets for optimized responses
- Related Resources: Embedded relationships and hypermedia links
- Database Optimization: select_related() and prefetch_related() for N+1 query elimination
- Indexing Strategy: Strategic database indexes on frequently queried fields
- Caching Layer: Redis caching for improved response times (planned)
- Query Optimization: Efficient ORM queries with minimal database hits
- Response Compression: Gzip compression for reduced bandwidth
- Unit Tests: Comprehensive coverage of business logic
- Integration Tests: API endpoint testing with realistic data
- Authentication Tests: Security-focused test scenarios
- Permission Tests: Access control validation
- Database Tests: Model and migration testing
- Type Hints: Python type annotations for better code maintainability
- Linting: ESLint for JavaScript, flake8 for Python
- Code Formatting: Black and Prettier for consistent styling
- Pre-commit Hooks: Automated code quality checks
- Documentation: Comprehensive docstrings and comments
name: CI/CD Pipeline
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
cd backend
pip install -r requirements.txt
- name: Run tests
run: |
cd backend
pytest --cov=. --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v3- Go to https://www.heroku.com
- Sign up/Login with GitHub account
- Install Heroku CLI:
brew install heroku(macOS) or download from heroku.com/cli - Login:
heroku login
# Create app
heroku create bug-reporting-backend
# Add PostgreSQL database
heroku addons:create heroku-postgresql:hobby-dev
# Set environment variables
heroku config:set DEBUG=False
heroku config:set SECRET_KEY=$(python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())')
heroku config:set CORS_ALLOWED_ORIGINS=https://bug-reporting-system.vercel.app# Add Heroku remote
heroku git:remote -a bug-reporting-backend
# Deploy
git push heroku main
# Run migrations
heroku run python manage.py migrate
# Create superuser (optional)
heroku run python manage.py createsuperuser# Check logs
heroku logs --tail
# Test API
curl https://bug-reporting-backend.herokuapp.com/api/projects/- Go to https://vercel.com
- Sign up/Login with GitHub account
- Click "Add New Project"
- Import your GitHub repository:
mangeshraut712/Bug-Reporting-System
- Framework Preset: React (auto-detected)
- Build Command:
npm run build(auto-detected from vercel.json) - Output Directory:
build(auto-detected) - Root Directory:
./(default)
- Go to Settings β Environment Variables
- Add variable:
- Name:
REACT_APP_API_URL - Value:
https://bug-reporting-backend.herokuapp.com/api - Environments: Production, Preview, Development
- Name:
- Click "Deploy"
- Wait for build completion (2-3 minutes)
- Note the frontend URL:
https://bug-reporting-system.vercel.app
# Update CORS to allow Vercel frontend
heroku config:set CORS_ALLOWED_ORIGINS=https://bug-reporting-system.vercel.app- Visit your Vercel frontend URL
- Try to register a new user
- Check browser developer tools for any CORS errors
- Verify API calls are working
- β Frontend loads without errors
- β User registration works
- β API endpoints respond correctly
- β No CORS errors in browser console
- β SSL certificates active (automatic on both platforms)
- Go to Settings β Domains
- Add custom domain
- Configure DNS records as instructed
- Update Heroku CORS settings with new domain
# Add custom domain
heroku domains:add www.yourdomain.com
# Configure DNS records as instructed
# Update Vercel environment variables with new backend URL# Check logs
heroku logs --tail
# Common fixes:
# 1. Environment variables not set: heroku config
# 2. Database connection issues: heroku pg:info
# 3. Static files not collected: heroku run python manage.py collectstatic
# 4. Migration errors: heroku run python manage.py migrate --fake-initial# Check deployment logs in Vercel dashboard
# Settings β Deployments β Click on failed deployment
# Common fixes:
# 1. REACT_APP_API_URL not set in environment variables
# 2. Build command failures: check build logs
# 3. Node version compatibility: verify node version- Verify
CORS_ALLOWED_ORIGINSin Heroku matches Vercel URL exactly - Check for
https://vshttp://mismatch - Ensure no trailing slashes in URLs
- Redeploy backend after updating CORS:
git push heroku main
- Heroku Account: Created and CLI installed
- Heroku App: Created with PostgreSQL database
- Backend Deployed: Successfully pushed to Heroku
- Database Migrations: Run successfully
- Backend URL: Noted for frontend configuration
- Vercel Account: Created and connected to GitHub
- Frontend Deployed: Successfully deployed to Vercel
- Environment Variables: REACT_APP_API_URL set correctly
- CORS Settings: Updated in Heroku with Vercel URL
- API Testing: All endpoints working in production
- User Registration: Working end-to-end
- SSL Certificates: Active on both services
# One-time setup
heroku create bug-reporting-backend
heroku addons:create heroku-postgresql:hobby-dev
heroku git:remote -a bug-reporting-backend
# Deploy
git push heroku main
heroku run python manage.py migrate
# View logs
heroku logs --tail
# Set environment variables
heroku config:set CORS_ALLOWED_ORIGINS=https://bug-reporting-system.vercel.app# Deploy via Vercel CLI
npm i -g vercel
vercel --prod
# Or deploy via GitHub (automatic)
# Push to main branch and Vercel will auto-deployAfter deployment, your application will be available at:
- Frontend:
https://bug-reporting-system.vercel.app - Backend API:
https://bug-reporting-backend.herokuapp.com - API Docs:
https://bug-reporting-backend.herokuapp.com/api/docs/
DEBUG=False
SECRET_KEY=your-generated-secret-key
DB_ENGINE=django.db.backends.postgresql
CORS_ALLOWED_ORIGINS=https://bug-reporting-system.vercel.app
ALLOWED_HOSTS=bug-reporting-backend.herokuapp.comREACT_APP_API_URL=https://bug-reporting-backend.herokuapp.com/api- Backend deployed on Heroku
- Frontend deployed on Vercel
- Environment variables configured
- CORS settings updated
- Database migrations run
- API endpoints tested
- Frontend connects to backend
- SSL certificates active
- Ensure
CORS_ALLOWED_ORIGINSincludes your frontend URL - Check that frontend API URL matches backend URL
- Verify JWT tokens are being stored in localStorage
- Check that Authorization header is being sent with requests
- Ensure tokens haven't expired
- For PostgreSQL, verify credentials in .env
- Ensure PostgreSQL service is running
- Check database name and user permissions
- Fork the repository
- Create a feature branch
- Make your changes
- Write tests
- Submit a pull request
MIT License - see LICENSE file for details
For issues and questions, please open an issue on GitHub.
For testing purposes, you can use:
- Email:
test@example.com - Password:
testpass123
(Create these via the registration page or admin panel)
Interactive API documentation is available at:
- Swagger UI:
http://localhost:8000/api/docs/ - ReDoc:
http://localhost:8000/api/redoc/
- Average API response time: < 200ms
- Database query optimization: Eliminated N+1 queries
- Frontend bundle size: ~150KB (gzipped)
- Test coverage: > 80%
# Backend development
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
# Frontend development (new terminal)
cd frontend
npm install
npm start# Python formatting and linting
pip install black isort flake8
black . --check
isort . --check-only
flake8 .
# JavaScript formatting
npm install -g prettier eslint
prettier --check "src/**/*.{js,jsx,json,css}"
eslint src/# Feature development
git checkout -b feature/new-feature
# Make changes...
git add .
git commit -m "feat: add new feature"
git push origin feature/new-feature
# Create pull request
# Code review and testing
git checkout main
git merge feature/new-feature# Development with hot reload
docker-compose -f docker-compose.dev.yml up
# Production build
docker-compose up --build
# Clean up
docker-compose down -v --remove-orphans- Real-time Notifications: WebSocket integration for live updates
- Email Notifications: SMTP configuration for issue updates
- User Mentions: @username notifications in comments
- Activity Feed: Timeline of project activities
- File Attachments: Upload images and documents to issues
- Issue Templates: Pre-defined templates for common issue types
- Time Tracking: Log time spent on issues
- Custom Fields: Flexible issue metadata
- Dashboard Analytics: Charts and metrics for project insights
- Advanced Search: Full-text search with Elasticsearch
- Export Capabilities: CSV/PDF export for reports
- API Rate Limiting: Prevent abuse with configurable limits
- Multi-tenancy: Organization-based isolation
- SSO Integration: SAML/OAuth authentication
- Audit Logs: Comprehensive activity tracking
- Advanced Permissions: Granular access control
- GraphQL API: Alternative to REST for complex queries
- Microservices: Break down monolithic architecture
- Kubernetes: Container orchestration for scaling
- CDN Integration: Global content delivery
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/bug-reporting-system.git - Set up development environment (see Quick Start)
- Create feature branch:
git checkout -b feature/amazing-feature
- Python: Follow PEP 8, use Black for formatting
- JavaScript: Use Prettier and ESLint
- Commits: Use conventional commits (
feat:,fix:,docs:, etc.) - Tests: Write tests for new features, maintain 90%+ coverage
- Update documentation for API changes
- Add tests for new functionality
- Ensure CI/CD pipeline passes
- Request review from maintainers
- Merge after approval
- Use issue templates for bug reports and feature requests
- Provide detailed reproduction steps for bugs
- Include environment information and error logs
This project is licensed under the MIT License - see the LICENSE file for details.
- Django Community - For the excellent web framework
- React Team - For the innovative frontend library
- Open Source Contributors - For the amazing tools and libraries
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: API Docs (when running locally)
Built with β€οΈ using modern web technologies
Features β’ Quick Start β’ API β’ Contributing β’ License